lxc-create가 중단되고 결국 실패함

lxc-create가 중단되고 결국 실패함

Linux 컨테이너에 juju charm을 배치하려고 시도했는데 컨테이너가 시작되지 않았습니다. 문제를 디버깅하기 위해 이 문제가 발생한 노드로 SSH를 실행하고 다음과 같이 수동으로 LXC 컨테이너를 생성해 보았습니다.

ubuntu@slot13:~$ sudo lxc-create -t ubuntu -n pavan
Checking cache download in /var/cache/lxc/trusty/rootfs-amd64 ...
Installing packages in template: ssh,vim,language-pack-en
Downloading ubuntu trusty minimal ...
I: Retrieving Release

전혀 진전이 없습니다. 오랫동안 여기에 붙어 있었습니다. 정말 오랜 시간이 흐른 후 이렇게 말합니다.

ERROR: Unable to fetch GPG key from keyserver

그리고 계속 매달립니다. 결국 20~30분 지나면 포기

E: Failed getting release file http://archive.ubuntu.com/ubuntu/dists/trusty/Release

명령 에 해당하는 로그 파일은 어디에 있습니까 lxc-create? 이 문제를 어떻게 디버깅할 수 있나요?

편집하다: 디버그 로그를 보는 방법을 알아냈고, 따라서 아래 명령을 몇 번 실행했습니다.

sudo lxc-create -t ubuntu -n pavan --logfile=test.txt --logpriority=DEBUG

test.txt이것만 들어있습니다

lxc-create 1414897265.204 ERROR    lxc_container - Error: pavan creation was not completed
lxc-create 1414897407.757 ERROR    lxc_container - Error: pavan creation was not completed
lxc-create 1414897407.759 WARN     lxc_log - lxc_log_init called with log already initialized

그러나 여전히 중단되고 디버그 로그가 많은 도움을 제공하지 않습니다.

답변1

--no-validateGPG 유효성 검사를 건너뛰려면 플래그를 추가하세요 .

lxc-create -t ubuntu -n pavan -- --no-validate

나타내다https://github.com/lxc/lxc/blob/master/templates/lxc-download.in#L240

답변2

당신은 프록시 뒤에 있습니까? 그렇다면 bash에서 프록시를 설정할 수 있습니다. 다음 문제,

export http_proxy="http://<proxy_host>:<port>"

답변3

실제로 juju는 'ubuntu-cloud' 템플릿을 사용하여 이미지를 가져오고, trusty를 실행하는 내 시스템에서 템플릿을 생성하기 위해 실행되는 명령은 다음과 같습니다.

lxc-create -n juju-trusty-lxc-template \
  -t ubuntu-cloud \
  -f /var/lib/juju/containers/juju-trusty-lxc-template/lxc.conf \
  -- --debug \
  --userdata /var/lib/juju/containers/juju-trusty-lxc-template/cloud-init \
  --hostid juju-trusty-lxc-template
  -r trusty

그런 것을 실행하고 어떤 오류가 발생하는지 확인하는 것이 좋습니다.

답변4

문제

인터넷 액세스를 제한하는 방화벽 뒤에 있는 경우 다음 오류가 발생할 수 있습니다.

$ lxc-create -t download -n my-container
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver.
lxc-create: lxccontainer.c: create_run_template: 1297 container
  creation template for my-container failed
lxc-create: tools/lxc_create.c: main: 318 Error creating
  container my-container

고치다

포트 80을 통해 키 서버에 연결합니다.

$ lxc-create -t download -n my-container \
  -- --keyserver hkp://p80.pool.sks-keyservers.net:80

세부

키 서버는 소스 코드 hkp://p80.pool.sks-keyservers.net:80에서 가져온 것입니다 lxc.

apt source lxc
grep -ri hkp: .

참고자료

관련 정보