Cassandra in Docker cant connect from outside

送分小仙女□ 提交于 2020-01-05 06:00:15

问题


Hi I am new to word Docker and Cassandar. I have a problem connecting to Cassandra in Docker from my computer.

I run container Cassandra and I see that exposed ips and ports are 192.168.99.100:9042.(first image) In docker I can even see that "Test cluster" is running but when I want to connect to Cassandra by NoSQL Manager for Cassandra there is always error message "None of the hosts tried for query are available".

Thank you.


回答1:


you don't expose a port. 9042 is docker port. When you run the docker image you must remember this:

docker run -p 9042:9042 image-name

first 9042 define the port number where outer world will connect and 2nd 9042 defines docker's port number which will be bound with outer port number 9042.



来源:https://stackoverflow.com/questions/41867381/cassandra-in-docker-cant-connect-from-outside

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!