LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-25-2020, 11:54 PM   #1
esolve
LQ Newbie
 
Registered: Oct 2012
Posts: 18

Rep: Reputation: Disabled
Telnet issues in docker networks


in a host machine (its LAN ip is 192.168.0.94), I have the following services

1) mysql , its docker-compose.yml is as below. It creates a bridge network called `mysql_default`,it is assigned a VIP 172.24.0.2

Quote:
version: '2'
services:
mysql:
image: mysql:5.7
restart: always
container_name: mysql
volumes:
- /etc/localtime:/etc/localtime
- /data/mysql:/var/lib/mysql
ports:
- 3306:3306


2) nacos, its docker-compose.yml is as below. It starts 3 services, and all of them are in the same bridge network and with a fixed IP address.

Quote:
version: "2"

services:
nacos1:
container_name: nacos1
image: nacos:latest
networks:
nacos_net:
ipv4_address: 10.0.2.10
ports:
- 8848:8848
volumes:
- /root/nacos/application.properties:/app/conf/application.properties
nacos2:
container_name: nacos2
image: nacos:latest
networks:
nacos_net:
ipv4_address: 10.0.2.11
ports:
- 8849:8848
volumes:
- /root/nacos/application.properties:/app/conf/application.properties
nacos3:
container_name: nacos3
image: nacos:latest
networks:
nacos_net:
ipv4_address: 10.0.2.12
ports:
- 8850:8848
volumes:
- /root/nacos/application.properties:/app/conf/application.properties

networks:
nacos_net:
ipam:
driver: default
config:
- subnet: "10.0.2.0/24"

3) user service, for this service, I create a docker swarm in the host and a docker overlay network called `pica_net` and the service resides in this overlay network

Quote:

version: "3"

services:
pica_user:
#container_name: pica_user
image: pica-user:latest
networks:
- pica_net
ports:
- 8010:8010
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 3s
restart_policy:
condition: on-failure
volumes:
- /root/pica/user/logs:/app/logs
entrypoint: ["java", "-Xmx150m", "-Xss512k", "-Dserver.port=8810", "-Dspring.profiles.active=prod", "-jar", "/app/pica-user.jar"]
networks:
pica_net:
external: true

I find that it is not possible for user service to connect to Nacos service, so I do a series of telnet connection test to the following IP-Port pairs

a: (target at nacos containers with their VIPs in the overlay network) 10.0.2.10:8848/10.0.2.11:8848/10.0.2.12:8848

b: (target at nacos container 1 with LAN IP of host machine) 192.168.0.94:8848

c: (target at nacos container 2 with LAN IP of host machine) 192.168.0.94:8849

d: (target at nacos container 3 with LAN IP of host machine) 192.168.0.94:8850

e: (target at mysql container with LAN IP of host machine) 192.168.0.94:3306

f: (target at mysql container with its VIP in the bridge network) 172.24.0.2:3306

according to my test, my observation is:

1) on the host machine, successfully telnet to all the above IP-Port pairs
2) from inside `mysql` container: successfully telnet to `a`,`b`, but failed in telnet to `c` and `d`
3) from inside `user` container: successfully telnet to `e`,`f`, but failed in telnet to `a`, `b`, `c`, `d`
4) from inside `nacos` containers: successfully telnet to `e`,`f`, but failed in telnet to `a`, `b`, `c`, `d`

from all of them ping to the above LAN IP or VIPs are all successful

I'm wondering why there are failures in telnet as indicated in 2), 3) and 4), what are the reasons? and how can I make the telnet successful?

Last edited by esolve; 03-25-2020 at 11:56 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Red Hat partners with Docker to create Linux/Docker software stack LXer Syndicated Linux News 0 03-12-2015 05:54 PM
LXer: Ubuntu LXD: Not a Docker replacement, a Docker enhancement LXer Syndicated Linux News 0 11-05-2014 08:40 PM
LXer: Docker Founder Explains What Docker is all About LXer Syndicated Linux News 0 08-21-2014 09:20 PM
telnet slowness - linux telnet vs windows telnet vahab Linux - Networking 4 01-23-2013 02:25 PM
ssh then telnet vs telnet then telnet sanabani Linux - Networking 1 12-20-2011 07:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration