goduplicator icon indicating copy to clipboard operation
goduplicator copied to clipboard

Can mirror server be the same server but different port?

Open prayyapp-swi opened this issue 5 years ago • 5 comments

I am using the goduplicator to forward and mirror the request to the same server on different ports. The client keeps getting errors. I can forward requests just fine to either ports. Does the mirror server need to be a different host?

goduplicator]# ./goduplicator -l :8000 -f 127.0.0.1:13306 -m 127.0.0.1:23306 2020/12/07 18:46:06 accepted connection 739 (127.0.0.1:32612 <-> 127.0.0.1:8000) 2020/12/07 18:46:06 accepted connection 740 (127.0.0.1:32622 <-> 127.0.0.1:8000) 2020/12/07 18:46:06 got error (EOF), will close client connection 2020/12/07 18:46:06 got error (EOF), will close client connection 2020/12/07 18:46:06 accepted connection 741 (127.0.0.1:32632 <-> 127.0.0.1:8000) 2020/12/07 18:46:06 got error (EOF), will close client connection 2020/12/07 18:46:06 accepted connection 742 (127.0.0.1:32642 <-> 127.0.0.1:8000)

prayyapp-swi avatar Dec 07 '20 19:12 prayyapp-swi

Infact, I am not able to use the -m (mirror) parameter on any host. Is this a known issue?

prayyapp-swi avatar Dec 07 '20 21:12 prayyapp-swi

Hi, @prayyapp-swi. It is not a known issue. Can you elaborate a bit on what exactly you are doing? Quick tests shows that it is working as expected.

mkevac avatar Dec 07 '20 21:12 mkevac

Hi @mkevac I downloaded the old version of the code(0.2.1) and see this error-

2020/12/07 21:48:28 got error from mirror: EOF 2020/12/07 21:48:28 got error from mirror: write tcp 127.0.0.1:55036->127.0.0.1:3308: use of closed network connection

This is our usecase- We currently have an HAProxy server that forwards request to 1 Mysql instance. We are migrating this Mysql server to AWS Aurora and would like to test the performance of Aurora. So, HAProxy will essentially send all the requests to goduplicator and then goduplicator will forward the requests to the EC2 Mysql and mirror the same request to AuroraDB. I am able to use the forward "-f" option to send the request to either instances (EC2 and Aurora) but I cannot use -f and -m together.

prayyapp-swi avatar Dec 07 '20 21:12 prayyapp-swi

@prayyapp-swi can you reproduce the problem with the latest version?

mkevac avatar Dec 07 '20 22:12 mkevac

@mkevac yes I can. I started with the latest version and then tried the older one. It looks like this in the new version-

./goduplicator -l :8000 -f '127.0.0.1:3307' -m '127.0.0.1:3308' 2020/12/07 22:01:39 accepted connection 0 (127.0.0.1:17864 <-> 127.0.0.1:8000) 2020/12/07 22:01:40 accepted connection 1 (127.0.0.1:17874 <-> 127.0.0.1:8000) 2020/12/07 22:01:40 accepted connection 2 (127.0.0.1:17880 <-> 127.0.0.1:8000) 2020/12/07 22:01:40 got error (EOF), will close client connection 2020/12/07 22:01:40 got error (EOF), will close client connection 2020/12/07 22:01:40 accepted connection 3 (127.0.0.1:17894 <-> 127.0.0.1:8000) 2020/12/07 22:01:40 accepted connection 4 (127.0.0.1:17900 <-> 127.0.0.1:8000) 2020/12/07 22:01:40 got error (EOF), will close client connection 2020/12/07 22:01:40 got error (EOF), will close client connection

prayyapp-swi avatar Dec 07 '20 22:12 prayyapp-swi