Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

630
Visualizações
Creating a MySQL cluster, using mysql-server docker containers, on multiple servers

I'm trying to create an MySQL cluster of 3 nodes using mysql-server docker containers.

I have 3 separate cloud instances and docker is setup on all 3 of them. Each server will have only 1 container running on it - to achieve High Availability when in cluster.

I start the containers on all 3 servers, individually, with the command

docker run --name=db -p 3301:3306 -v db:/var/lib/mysql -d mysql/mysql-server

I'm mapping the port 3306 of container to my server's 3301 port. I've also created a new user 'clusteradmin' for remote access.

Next, from mysql-shell, I ran following command - for all 3 servers

dba.configureInstance('clusteradmin@serverIp:3301')

I get similar message for all- enter image description here

Note that it says 'This instance reports its own address as 39xxxxxxxxxx:3306'.

Next I create a cluster in one of the server successfully. But, when adding the other 2 servers to this cluster, I'm getting the following error

enter image description here

On checking the logs for that particular server, I see the following lines

enter image description here

It says 'peer address a9yyyyyyyyyy:33061 is not valid'. This is because, since the containers are running on different servers, the container-id is not recognised by other containers on other server.

I tried many options but to no avail. One method was to use report-host and report-port options when starting the container, like so

docker run --name=db2 -p 3301:3306 -v db2:/var/lib/mysql -d mysql/mysql-server --report-host=139.59.11.215 --report-port=3301

But, the issue with this approch is that, during dba.configureInstance(), it wants to update the port to default value and throws error like so

enter image description here

Anybody who has managed to create such a cluster of mysql-server containers running on different servers, I would really appreciate pointers in this regard.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I have gone over the documentation and source code but have not found an explanation why listening and advertising different ports is problematic.

I have solved the problem by using --port 3301 when invoking mysql-server:

docker run --name=db2 -p 3301:3301 -v db2:/var/lib/mysql -d mysql/mysql-server --report-host=139.59.11.215 --port 3301
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda