Closed jihoon-seo closed 3 years ago
두 번째 시도에서는 성공했습니다. (MCIR 삭제하지 않고 재활용)
INFO[7365] create MCIS OK.. (name=sjh1)
INFO[7365] start k8s bootstrap
INFO[7369] start script file copy (vm=sjh1-w-2-lj1o0, src=/home/jhseo/go/src/github.com/cloud-barista/cb-ladybug/src/scripts, dest=/tmp)
INFO[7369] start script file copy (vm=sjh1-w-1-hxxrm, src=/home/jhseo/go/src/github.com/cloud-barista/cb-ladybug/src/scripts, dest=/tmp)
INFO[7372] end script file copy (vm=sjh1-w-1-hxxrm, server=34.64.215.181:22)
INFO[7373] end script file copy (vm=sjh1-w-2-lj1o0, server=34.64.173.210:22)
Created symlink /etc/systemd/system/kubelet.service.wants/ladybug-bootstrap.service → /lib/systemd/system/ladybug-bootstrap.service.
Created symlink /etc/systemd/system/kubelet.service.wants/ladybug-bootstrap.service → /lib/systemd/system/ladybug-bootstrap.service.
INFO[7384] start script file copy (vm=sjh1-c-1-9k16i, src=/home/jhseo/go/src/github.com/cloud-barista/cb-ladybug/src/scripts, dest=/tmp)
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
Warning: apt-key output should not be parsed (stdout is not a terminal)
Warning: apt-key output should not be parsed (stdout is not a terminal)
...
INFO[7676] install networkCNI
INFO[7678] end k8s init
INFO[7678] start k8s join
INFO[7678] worker join (vm=sjh1-w-1-hxxrm)
W0708 10:27:02.911064 14105 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
INFO[7699] worker join (vm=sjh1-w-2-lj1o0)
W0708 10:27:23.498776 13779 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
INFO[7708] end k8s join
INFO[7708] duration := 6m30.624747945s
(by @powerkimhub)
제가 SP, TB, LB 만 실행하고 CB-Dragonfly 는 실행하지 않은 상태였습니다.
CB-Dragonfly 가 실행되어 있었으면 CB-Tumblebug 이 VM을 생성하고 CB-Dragonfly 모니터링 에이전트를 설치하는 과정에서 SSH 접속이 가능하다는 것이 검증되므로 CB-Ladybug이 SSH 접속에 실패하지 않았을 것입니다.
@sykim-etri
~현 이슈는 Spider로 이관합니다. 🕷~
다음 이슈 참고하시기 바랍니다.
~현 이슈는 판단하시어 close해도 될 것 같습니다.~
@jihoon-seo @powerkimhub
CB-Dragonfly 가 실행되어 있었으면
CB-Tumblebug 이 VM을 생성하고 CB-Dragonfly 모니터링 에이전트를 설치하는 과정에서
SSH 접속이 가능하다는 것이 검증되므로
CB-Ladybug이 SSH 접속에 실패하지 않았을 것입니다.
이 문구 관련해서, 오해의 소지가 있는 듯해서 댓글을 답니다.
CB-TB 가 Dragonfly Agent 를 MCIS(VM) 생성시, 디폴트로 SSH 접속 여부도 확인하고 Agent 설치를 지속적으로 Try 하지만 Agent 설치가 가능하다는 것과 그 이후로도 SSH가 계속 가능하다는 것을 보장하지는 않습니다.
따라서, Spider나 TB에 의존하기 보다는, CB-ladybug도 SSH 불가 가능성을 염두에 두고 관련 로직이 처리되는 것이 바람직하지 않을까 생각합니다. (CB-Ladybug에서 당연히 그렇게 해나가실거라 생각합니다..^^)
@sykim-etri
@sykim-etri
@seokho-son
@seokho-son @powerkimhub
@sykim-etri @seokho-son @jihoon-seo
Spider에서 처리하게 되면, 상위 계층(TB, LB 등)에서 편의성은 증가하겠지만, Spider 정책을 따를 수 밖에 없습니다.
상위 계층에서 여러 상황을 감안하여 자율적으로 대처하고 싶다면,
당초에는 유사 오류 방지 및 편의성 제공을 감안하여 반영코자하였습니다만,
의견 수집 및 현황을 다시 파악해본 결과, 현재의 모습으로 유연성을 유지토록 하겠습니다.
의견 수렴에 캄사 드립니다.
@seokho-son 현재 CB-TB에서 SSH 접속 여부 체크 방식은 어디서 확인할 수 있을까요?
따로 SSH 접속 여부 체크 기능을 API로 제공하지는 않고욤.
원격 거맨드 기능으로 임의의 명령을 수행해보시면 될 것 같습니다. (TB에서는 hostname이나 ls를 해보고 있습니다.)
@seokho-son 제가 질문을 잘못했습니다. 현재 CB-TB에서 Dragonfly 설치를 위해 SSH 접속을 시도하는 코드를 어디서 찾으면 좋을까요? 현재 CB-LB는 2회만 접속시도하므로 CB-TB와 동일한 수준에서 접속을 시도하려고 합니다.ㅎㅎ
@sykim-etri
https://github.com/cloud-barista/cb-tumblebug/blob/be7aeb8720c25be657a92afc3557f8d71176bb00/src/core/mcis/control.go#L314 여기에서 verifySSHUserName 을 하고, SSH 가능 여부가 확인 되게 됩니다.
1) vm status 확인 (running 아니면 추가 진행하지 않음)
2) vm ip 확인 (ip 지정되어 있지 않으면 추가 진행하지 않음)
3) ssh를 위한 username이 CB-TB에 의해 검증되었는지 확인
4) 검증이 안 되어 있는 경우, TCP SSH 포트가 열려있는지 VM 연결성 재확인 10회 (타임아웃: 10초, 매 2초 슬립)
: https://github.com/cloud-barista/cb-tumblebug/blob/be7aeb8720c25be657a92afc3557f8d71176bb00/src/core/mcis/sshrun.go#L189
5) username 탐색을 위해 ssh (ls
) 를 수행하여 정상 응답이 오는지 확인
실재 Agent 를 탑재하는 코드는 https://github.com/cloud-barista/cb-tumblebug/blob/be7aeb8720c25be657a92afc3557f8d71176bb00/src/core/mcis/control.go#L2000 이고,
VM 생성 후 강제로 20초의 딜레이를 주고 에이전트 설치 전에 상기 verifySSHUserName 를 수행합니다.
일단 CB-TB는 초안으로 이렇게 되어 있고요.. (상당히 오래 여러번 확인...하는 방어적인 코드..)
CB-LB에서는 더 바람직한 방법으로 하시면 좋을 것 같습니다. (저는 프로그래밍을 잘하는 사람이 아니어요...ㅠㅠ)
@seokho-son 상세한 안내 감사합니다. 안정성 제공을 위한 CB-TB의 노력을 간접적으로 확인할 수 있었습니다.^^
일부 CSP(오픈스택)에서 생성한 VM의 경우 cloud-init 스크립트 실행으로 SSHD 실행이 꽤 지연되는 경우도 있음. 이를 고려한 해결 방안이 필요합니다. https://cloud-barista.slack.com/archives/CLFCLNFTJ/p1625817016229400?thread_ts=1625801251.224700&cid=CLFCLNFTJ
참조: https://www.golinuxcloud.com/test-ssh-connection/
# cat /tmp/check_connectivity.sh
#!/bin/bash
server=10.10.10.10 # server IP
port=22 # port
connect_timeout=5 # Connection timeout
ssh -q -o BatchMode=yes -o StrictHostKeyChecking=no -o ConnectTimeout=$connect_timeout $server 'exit 0'
if [ $? == 0 ];then
echo "SSH Connection to $server over port $port is possible"
else
echo "SSH connection to $server over port $port is not possible"
fi
What happened :
13.113.190.119
에 대해서WARN[5908] connection test error
가 2번 발생했고INFO[5908] start script file copy
에서 SSH 접속이 가능해졌다고 판단한 것으로 보이는데ERRO[5908] copy scripts error (server=13.113.190.119:22
가 발생했습니다.이로 인해 테스트 스크립트가 에러와 함께 종료되었습니다.
What you expected to happen :
How to reproduce it (as minimally and precisely as possible) :
❯ ./cluster-create.sh cb sjh1
Anything else we need to know? :
Environment
Proposed solution :
Any other context :