oceanbase / docker-images

Official source of container configurations and images for OceanBase products.
https://hub.docker.com/r/oceanbase
Apache License 2.0
0 stars 5 forks source link

[Feature]: Set oceanbase root service list to oceanbase container ip #25

Closed namewxt1220 closed 3 weeks ago

namewxt1220 commented 9 months ago

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.

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.

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. -->
caifeizhi commented 9 months ago

@wangzelin19961202 please take a look

whhe commented 3 weeks ago

Supported in https://github.com/oceanbase/docker-images/commit/e56c8107d63fe1d9fa0d157738af18ba9344a0fb.