openstack queens etcd 설치 에러 해결 과정

| 2018년 7월 27일 | 0 Comments

오픈 스택 queens 버전 etcd 설치시 메뉴얼 대로 설치했음에도 불구하고 conf 파일이 적용되지 않는 문제가 발생 합니다.

메뉴얼대로 설치시 발생하는 문제점 확인과 해결 과정에 대해 하단에 기술 하겠습니다.

  • 오픈 스택에서 메뉴얼 페이지의  etcd 설치 메뉴얼(출처 : https://docs.openstack.org/install-guide/environment-etcd-ubuntu.html)

root@controller:~# apt install etcd -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  pipexec
The following NEW packages will be installed:
  etcd pipexec
0 upgraded, 2 newly installed, 0 to remove and 126 not upgraded.

root@controller:~# mkdir /etc/etcd

root@controller:~# cat /etc/etcd/etcd.conf.yml
name: controller
data-dir: /var/lib/etcd
initial-cluster-state: 'new'
initial-cluster-token: 'etcd-cluster-01'
initial-cluster: controller=http://10.0.0.8:2380
initial-advertise-peer-urls: http://10.0.0.8:2380
advertise-client-urls: http://10.0.0.8:2379
listen-peer-urls: http://0.0.0.0:2380
listen-client-urls: http://10.0.0.8:2379

root@controller:~# cp /lib/systemd/system/etcd.service /lib/systemd/system/etcd.service_ori

root@controller:~# cat /lib/systemd/system/etcd.service
[Unit]
After=network.target
Description=etcd - highly-available key value store

[Service]
LimitNOFILE=65536
Restart=on-failure
Type=notify
ExecStart=/usr/bin/etcd --config-file /etc/etcd/etcd.conf.yml
User=etcd

[Install]
WantedBy=multi-user.target

root@controller:~# systemctl start etcd

root@controller:~# systemctl status etcd
  •  문제 발생 사항

root@controller:~# systemctl status etcd
● etcd.service - etcd - highly-available key value store
   Loaded: loaded (/lib/systemd/system/etcd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-07-27 15:24:04 KST; 3min 32s ago
 Main PID: 10330 (etcd)
   CGroup: /system.slice/etcd.service
           └─10330 /usr/bin/etcd

Jul 27 15:24:04 controller etcd[10330]: added local member ce2a822cea30bfca [http://localhost:2380 http://localhost:7001] to cluster 7e27652122e8b2ae
Jul 27 15:24:05 controller etcd[10330]: ce2a822cea30bfca is starting a new election at term 1
Jul 27 15:24:05 controller etcd[10330]: ce2a822cea30bfca became candidate at term 2
Jul 27 15:24:05 controller etcd[10330]: ce2a822cea30bfca received vote from ce2a822cea30bfca at term 2
Jul 27 15:24:05 controller etcd[10330]: ce2a822cea30bfca became leader at term 2
Jul 27 15:24:05 controller etcd[10330]: raft.node: ce2a822cea30bfca elected leader ce2a822cea30bfca at term 2
Jul 27 15:24:05 controller etcd[10330]: setting up the initial cluster version to 2.2
Jul 27 15:24:05 controller etcd[10330]: set the initial cluster version to 2.2
Jul 27 15:24:05 controller etcd[10330]: published {Name:controller ClientURLs:[http://localhost:2379 http://localhost:4001]} to cluster 7e27652122e8b2ae
Jul 27 15:27:09 controller systemd[1]: Started etcd - highly-available key value store.
# 서비스가 /etc/etcd/etcd.conf.yml 설정 파일을 적용하지 않고 실행 된다.
  • 해결 방법

root@controller:~# cat /lib/systemd/system/etcd.service
"[Unit]
Description=etcd - highly-available key value store
Documentation=https://github.com/coreos/etcd
Documentation=man:etcd
After=network.target
Wants=network-online.target

[Service]
Environment=DAEMON_ARGS=
Environment=ETCD_NAME=%H
Environment=ETCD_DATA_DIR=/var/lib/etcd/default
EnvironmentFile=-/etc/default/%p
Type=notify
User=etcd
PermissionsStartOnly=true
ExecStart=/usr/bin/etcd --name 'controller' --data-dir '/var/lib/etcd' --initial-cluster-state 'new' --initial-cluster-token 'etcd-cluster-01' --initial-cluster 'controller=http://10.10.10.8:2380' --initial-advertise-peer-urls 'http://10.10.10.8:2380' --advertise-client-urls 'http://10.10.10.8:2379' --listen-peer-urls 'http://0.0.0.0:2380'
Restart=on-abnormal
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target
Alias=etcd2.service
# 적용되지 않은 원인이 etcd 옵션중 --config-file 없기 때문이여서 모든 옵션을 정의 해줘야 한다.
root@controller:~# systemctl daemon-reload 

root@controller:~# systemctl restart etcd
  • 확인

root@controller:~# systemctl status etcd
● etcd.service
   Loaded: loaded (/lib/systemd/system/etcd.service; bad; vendor preset: enabled)
   Active: active (running) since Fri 2018-07-27 15:41:18 KST; 6s ago
 Main PID: 10730 (etcd)
    Tasks: 8
   Memory: 6.0M
      CPU: 41ms
   CGroup: /system.slice/etcd.service
           └─10730 /usr/bin/etcd --name controller --data-dir /var/lib/etcd --initial-cluster-state new --initial-cluster-token etcd-cluster-01 --initial-cluster controller=http://10.10.10.8:2380 --initial-adver

Jul 27 15:41:18 controller systemd[1]: Started etcd.service.
Jul 27 15:41:18 controller etcd[10730]: added local member 3a4b49ea22b919d5 [http://10.10.10.8:2380] to cluster 3bcf981b4b875517
Jul 27 15:41:19 controller etcd[10730]: 3a4b49ea22b919d5 is starting a new election at term 1
Jul 27 15:41:19 controller etcd[10730]: 3a4b49ea22b919d5 became candidate at term 2
Jul 27 15:41:19 controller etcd[10730]: 3a4b49ea22b919d5 received vote from 3a4b49ea22b919d5 at term 2
Jul 27 15:41:19 controller etcd[10730]: 3a4b49ea22b919d5 became leader at term 2
Jul 27 15:41:19 controller etcd[10730]: raft.node: 3a4b49ea22b919d5 elected leader 3a4b49ea22b919d5 at term 2
Jul 27 15:41:19 controller etcd[10730]: setting up the initial cluster version to 2.2
Jul 27 15:41:19 controller etcd[10730]: published {Name:controller ClientURLs:[http://10.10.10.8:2379]} to cluster 3bcf981b4b875517
Jul 27 15:41:19 controller etcd[10730]: set the initial cluster version to 2.2
# 서비스 status로 보면 옵션이 적용된게 확인된다.

Category: 가상화/클라우드

장영호

About the Author ()