I have deployed two containers, oceanbase-ce and centos, on one physical machine at the same time, they are under the same network and can communicate with each other by name.
create a docker network:
docker network create test-net
run the oceanbase-ce container and connect it to the custom network:
docker run -itd --name oceanbase-ce --network test-net oceanbase/oceanbase-ce
run the centos container and connect it to the custom network:
docker run -itd --name centos --network test-net centos:7
Now, both containers, oceanbase-ce and centos, are connected to the "test-net" network. I will ping the oceanbase-ce container from the centos container.
ping oceanbase-ce
PING oceanbase-ce (172.31.0.2) 56(84) bytes of data.
64 bytes from oceanbase-ce.test-net (172.31.0.2): icmp_seq=1 ttl=64 time=0.085 ms
64 bytes from oceanbase-ce.test-net (172.31.0.2): icmp_seq=2 ttl=64 time=0.076 ms
64 bytes from oceanbase-ce.test-net (172.31.0.2): icmp_seq=3 ttl=64 time=0.092 ms
64 bytes from oceanbase-ce.test-net (172.31.0.2): icmp_seq=4 ttl=64 time=0.090 ms
64 bytes from oceanbase-ce.test-net (172.31.0.2): icmp_seq=5 ttl=64 time=0.064 ms
172.31.0.2 is the ip of the container where oceanbase-ce is located, connect to oceanbase via mysql command.
exec mysql command:
mysql -uroot -hoceanbase-ce -P2881
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 3221488329
Server version: 5.7.25 OceanBase_CE 4.1.0.0 (r100000192023032010-0265dfc6d00ff4f0ff4ad2710504a18962abaef6) (Built Mar 20 2023 10:12:57)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]>
It's okay up to here, but get the rootservice list.
MySQL [(none)]> show parameters like 'rootservice_list';
+-------+----------+-----------+----------+------------------+-----------+---------------------+------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level |
+-------+----------+-----------+----------+------------------+-----------+---------------------+------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone1 | observer | 127.0.0.1 | 2882 | rootservice_list | NULL | 127.0.0.1:2882:2881 | a list of servers against which election candidate is checked for validation | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+-----------+----------+------------------+-----------+---------------------+------------------------------------------------------------------------------+----------+---------+---------+-------------------+
1 row in set (0.02 sec)
MySQL [(none)]>
127.0.0.1 is the rootservice ip address, but I was expecting 172.31.0.2, because I need to get 172.31.0.2 to access the rootservice.
The IP address here (172.31.0.2) is unknown until the oceanbase-ce container is started, so I can't get the actual address of oceanbase-ce, and I would imagine that any program that wants to access the rootservice would have a similar problem present.
**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->
Set oceanbase root service list to oceanbase container ip.
**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->
Use Case
I have deployed two containers, oceanbase-ce and centos, on one physical machine at the same time, they are under the same network and can communicate with each other by name.
docker network create test-net
docker run -itd --name oceanbase-ce --network test-net oceanbase/oceanbase-ce
docker run -itd --name centos --network test-net centos:7
Now, both containers, oceanbase-ce and centos, are connected to the "test-net" network. I will ping the oceanbase-ce container from the centos container.
docker exec -it centos bash
172.31.0.2 is the ip of the container where oceanbase-ce is located, connect to oceanbase via mysql command.
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]>
MySQL [(none)]> show parameters like 'rootservice_list'; +-------+----------+-----------+----------+------------------+-----------+---------------------+------------------------------------------------------------------------------+----------+---------+---------+-------------------+ | zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level | +-------+----------+-----------+----------+------------------+-----------+---------------------+------------------------------------------------------------------------------+----------+---------+---------+-------------------+ | zone1 | observer | 127.0.0.1 | 2882 | rootservice_list | NULL | 127.0.0.1:2882:2881 | a list of servers against which election candidate is checked for validation | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | +-------+----------+-----------+----------+------------------+-----------+---------------------+------------------------------------------------------------------------------+----------+---------+---------+-------------------+ 1 row in set (0.02 sec)
MySQL [(none)]>