docker 문제 5: swarm에 Worker 버그를 추가합니다. 정보는 "Error response from daemon: rpc error: code = Unavailable desc ="
11082 단어 docker
VM 2개 만들기
cappuccinooos-MacBook-Pro:part3 cappuccinooo$ docker-machine create --driver virtualbox myvm1
Running pre-create checks...
Creating machine...
(myvm1) Copying /Users/cappuccinooo/.docker/machine/cache/boot2docker.iso to /Users/cappuccinooo/.docker/machine/machines/myvm1/boot2docker.iso...
(myvm1) Creating VirtualBox VM...
(myvm1) Creating SSH key...
(myvm1) Starting the VM...
(myvm1) Check network to re-create if needed...
(myvm1) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env myvm1
cappuccinooos-MacBook-Pro:part3 cappuccinooo$ docker-machine create --driver virtualbox myvm2
Running pre-create checks...
Creating machine...
(myvm2) Copying /Users/cappuccinooo/.docker/machine/cache/boot2docker.iso to /Users/cappuccinooo/.docker/machine/machines/myvm2/boot2docker.iso...
(myvm2) Creating VirtualBox VM...
(myvm2) Creating SSH key...
(myvm2) Starting the VM...
(myvm2) Check network to re-create if needed...
(myvm2) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env myvm2
VM 생성 보기
cappuccinooos-MacBook-Pro:~ cappuccinooo$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
myvm1 - virtualbox Running tcp://192.168.99.100:2376 v18.05.0-ce
myvm2 - virtualbox Running tcp://192.168.99.101:2376 v18.05.0-ce
Swarm 클러스터 관리자 만들기
cappuccinooos-MacBook-Pro:part3 cappuccinooo$ docker-machine ssh myvm1 "docker swarm init"
Error response from daemon: could not choose an IP address to advertise since this system has multiple addresses on different interfaces (10.0.2.15 on eth0 and 192.168.99.100 on eth1) - specify one with --advertise-addr
exit status 1
공식 문서에 유사한 오류 메시지가 나타나면 IP 주소와 포트를 지정해야 하며 조정된 명령은 다음과 같습니다.
cappuccinooos-MacBook-Pro:part3 cappuccinooo$ docker-machine ssh myvm1 "docker swarm init --advertise-addr 192.168.99.100:2377"
Swarm initialized: current node (56rvohie5wacjc9pt4y96pfbd) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-15dtlp88h8s12s6e76l8v3vtvj5rm32wor0rg36bjongv36qd3-82m58k6bp2dk2ugez1ksp5p2w 192.168.99.100:2377
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
Swarm 관리자 생성 보기
cappuccinooos-MacBook-Pro:~ cappuccinooo$ docker-machine env myvm1
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/cappuccinooo/.docker/machine/machines/myvm1"
export DOCKER_MACHINE_NAME="myvm1"
# Run this command to configure your shell:
# eval $(docker-machine env myvm1)
창설이 성공했다는 것을 설명하는 관리자 정보를 볼 수 있습니다
Swarm 클러스터 Worker 작성
cappuccinooos-MacBook-Pro:part3 cappuccinooo$ docker-machine ssh myvm2 "docker swarm join --token SWMTKN-1-15dtlp88h8s12s6e76l8v3vtvj5rm32wor0rg36bjongv36qd3-82m58k6bp2dk2ugez1ksp5p2w 192.168.99.101:2377"
Error response from daemon: rpc error: code = Unavailable desc = grpc: the connection is unavailable
exit status 1
오류 원인을 조사한 결과 IP 주소를 잘못 썼습니다. 관리자의 IP 주소를 써야 합니다. 192.168.99.101을 192.168.99.100으로 바꾸면 문제가 해결됩니다. 아래와 같습니다.
cappuccinooos-MacBook-Pro:part3 cappuccinooo$ docker-machine ssh myvm2 "docker swarm join --token SWMTKN-1-15dtlp88h8s12s6e76l8v3vtvj5rm32wor0rg36bjongv36qd3-82m58k6bp2dk2ugez1ksp5p2w 192.168.99.100:2377"
This node joined a swarm as a worker.
Swarm Worker 작성 보기
cappuccinooos-MacBook-Pro:~ cappuccinooo$ docker-machine env myvm2
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.101:2376"
export DOCKER_CERT_PATH="/Users/cappuccinooo/.docker/machine/machines/myvm2"
export DOCKER_MACHINE_NAME="myvm2"
# Run this command to configure your shell:
# eval $(docker-machine env myvm2)
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Swarm의 도커 비밀이 게시물에서는 Redis를 사용한 실제 시나리오 예제를 제공하여 사용 방법을 보여주고자 합니다. Docker 기술에 대한 기본 지식 Docker Swarm 오케스트레이터에 대한 기본 지식 "Docker Swarm ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.