-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nats streaming - client connection fails (timeout) #242
Comments
As explained on slack, you have set a cluster name in your server, so you need to use that same cluster name in the client when connecting. With the bench program, that would be |
PS C:\Users\XXXX\go\src\github.com\nats-io\go-nats-streaming\examples\stan-bench> .\stan-bench.exe -c streamer1 -s nats://192.168.99.100:4223 -qgroup test1 -np 1 -ns 1 -n 10 -ms 7212212 -csv 10x10x100kx7m_result.csv foo I am still getting the error after using -c streamer1 |
Can you telnet the server machine from your client machine? By that I mean you should be able to telnet the machine and NATS Streaming port and get an INFO protocol from the embedded NATS server. (do you use external NATS or is it embedded)? |
Hey @kozlovic - yes I did the telnet test before posting. It does return the JSON with all info correctly. I also hit the url on browser and it returns the raw text same as telnet. And I am running docker on windows using Virtual Box. I am using Windows 10 and no external NATS. My intention is to run ants-streaming container (no connection to external NATS server). |
Please post your config file.. |
Are you sure about how you start the docker image? As described here, for Windows images if you pass any argument, you actually need to specify the executable name, like so:
From the command that you posted, it does not look like this is what you are doing. When I run a docker image of nats streaming for Windows, I usually do this (I run from macOS):
then my client uses the IP of the VM and 4223 for the port. But the server itself runs on port 4222 in the container. If I want it to run on 4223, I would have to export a different port on my host. Like so:
that makes the container listen on port 4223 but then client needs to use port 4224. |
|
Ok, the problem is that you specify |
No its incorrect. This command will be rejected by docker saying "invalid command nets-streaming-server". I have just tried with MacOS on my person machine - it's the same error. |
My host is macOS and the docker image is the NATS Streaming image nano server 0.12.2. If I try to pass an argument without the executable name:
If I pass the executable name:
I wrote the docker file and instructions on Docker hub.. |
Here the docker file used to create the official image: https://github.com/nats-io/nats-streaming-docker/blob/master/windows/nanoserver/Dockerfile |
I am getting error on both windows and MacOS with your command. Also, you are mapping Host 4224 to container 4223 (I am mapping 4223 to 4223). when I telnet, I get the following response INFO {"server_id":"W2L6anhIotnnvrLWjUkdSq","version":"1.4.1","proto":1,"git_commit":"3e64f0b","go":"go1.11.6","host":"0.0.0.0","port":4223,"max_payload":1048576,"client_id":16} Also, below is my server startup screen mne$ docker run --rm -ti --name gnatsd-streamer -p 4223:4223 -p 8223:8223 -v /Users/mne/Desktop/streamer_conf.conf:/streamer_conf.conf -v /Users/mne/streamer1:/streamer1 nats-streaming:latest -p 4223 -m 8223 -c /streamer_conf.conf |
On the subject of the entry point and need for me to pass the executable name: You may have missed my earlier comment regarding the actual issue: the problem is with the |
To be clear, issue of |
I have tried without it (Attached new conf file) and I am still getting the same issue. I am using
|
@kozlovic Okay got it to pass through connection issue. The reason it kept failing was because of the volume mapping where it kept the client and server .dat files. Once I deleted them and restarted the streaming server, it went past the connection issue. +1 for that. |
I still see the Note that if you run a test that sends and reads messages from a channel, the next time you restart the test, if you use the same channel, there will be more messages added to the channel, while the subscriber will read at the beginning of the channel, which will cause perf to drop because server has to read data back from disk. You can use |
Received email notification from "kSpacer201" linked to this issue. I don't see the post in here, so copying for reference:
kSpacer201, not sure what you are stating/asking here. Could you elaborate? |
i also encountered the same case when i change to use cluster mode in Kubernetes. If using single model (no cluster config with memory), everything works fine. I am now testing different situation and update here later. |
@reidlai Few things you need to check when getting this timeout error:
|
I have started a nats streaming server using the attached conf file and the below docker command:
docker run --rm -ti -p 4223:4223 -p 4222:4222 -p 6223:6223 -p 8223:8223 -p 6222:6222 --name gnatsd-streamer --net host -v /home/docker/streamer_conf.conf:/streamer_conf.conf -v /home/docker/streamer1:/streamer1 nats-streaming:latest -p 4223 -m 8223 -c /strea
mer_conf.conf
But Upon stan-bench startup, I am getting connection timeout (tried with telnet first to confirm if the connection works):
.\stan-bench.exe -s nats://192.168.99.100:4223 -qgroup test1 -np 1 -ns 1 -n 10 -ms 7212212 -csv 10x10x100kx7m_result.csv foo
Subscriber benchmark-sub-0 can't connect: stan: connect request timeout
i am running it on Single Node, so no cluster info is required. I couldn't see any connection issue on the docker logs, so this issue is slightly unusual for me.
The text was updated successfully, but these errors were encountered: