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

143
Visualizações
Docker swarm join error

I am writing a bash script to automatically provision an environment, but at the stage of adding workers to the manager node it results in an error.

#!/bin/bash

WORKERSARRAY=(worker1)

banner() {
 figlet SysMonAutogen
}

create_docker_machine() {
 docker-machine create \
  -d amazonec2 \
  --amazonec2-region eu-west-1 \
  $1
}
create_infrastructure_manager() {
  echo Generating System Infrastructure...
  echo creating manager node...
  create_docker_machine manager
  echo created manager node...
}
create_infrastructure_worker() {
  for i in "${WORKERSARRAY[@]}"
  do
    echo creating $i node...
    create_docker_machine $i
   echo created $i node...
  done
 echo Nodes created...
}



machine_do() {
 docker-machine ssh $@
}

add_workers() {
  for i in "${WORKERSARRAY[@]}"
  do
   echo adding $i node as worker...
   machine_do $i docker swarm join --token $WORKER_TOKEN \
   $manager_ip:2377
   echo added $i node as worker...
  done
 echo workers added..

 }
 main() {
   banner
   create_infrastructure_manager
   create_infrastructure_worker
   manager_ip=$(machine_do manager ifconfig eth0 | grep "inet " | awk F'[: ]+' '{print $4}')
   machine_do manager sudo docker swarm init --advertise-addr      $manager_ip
   WORKER_TOKEN=$(sudo docker swarm join-token -q worker)
   add_workers
   echo infrastructure setup has finished...
   }

   main $@

Running the script produces the following error when it gets to the stage of adding workers:

remote CA does not match fingerprint

Oddly, if i manually ssh into the machine and type the swarm join command , the node is added.

about 4 years ago · Santiago Trujillo
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