Etcd v3.3.10 버전 배포(클러스터 3대)
4345 단어 etcdv3.3.10k8skubernetes
Etcd v3.3.10 버전 배포(클러스터 3대)
계획
etcd01
etcd02
etc03
192.168.100.100
192.168.100.101
192.168.100.102
소프트웨어 패키지
cfssl:
mkdir /data/ssl -p
cd /data/
wget https://pkg.cfssl.org/R1.2/cfssl_linux-amd64
wget https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64
wget https://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64
chmod +x cfssl_linux-amd64 cfssljson_linux-amd64 cfssl-certinfo_linux-amd64
mv cfssl_linux-amd64 /usr/local/bin/cfssl
mv cfssljson_linux-amd64 /usr/local/bin/cfssljson
mv cfssl-certinfo_linux-amd64 /usr/bin/cfssl-certinfo
cd /data/ssl/
:https://github.com/etcd-io/etcd/releases/tag/v3.3.10
etcd-v3.3.10-linux-amd64.tar.gz
키 생성
mkdir /data/ssl/etcd
cd /data/ssl/etcd
vim etcd.sh
# etcd
# cat ca-config.json
cat > ca-config.json < ca-csr.json < server-csr.json <
배치하다
3개 노드 모두 작동mkdir /data/src/
cd /data/src/
mkdir /opt/etcd/{bin,cfg,ssl} -p
tar xf etcd-v3.3.10-linux-amd64.tar.gz
mv etcd-v3.3.10-linux-amd64/{etcd,etcdctl} /opt/etcd/bin/
vim /opt/etcd/cfg/etcd
# 3 ETCD_NAME IP
#[Member]
ETCD_NAME="etcd01"
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="https://192.168.100.100:2380"
ETCD_LISTEN_CLIENT_URLS="https://192.168.100.100:2379"
#[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="https://192.168.100.100:2380"
ETCD_ADVERTISE_CLIENT_URLS="https://192.168.100.100:2379"
ETCD_INITIAL_CLUSTER="etcd01=https://192.168.100.100:2380,etcd02=https://192.168.100.101:2380,etcd03=https://192.168.100.102:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
ETCD_INITIAL_CLUSTER_STATE="new"
* ETCD_NAME
* ETCD_DATA_DIR
* ETCD_LISTEN_PEER_URLS
* ETCD_LISTEN_CLIENT_URLS
* ETCD_INITIAL_ADVERTISE_PEER_URLS
* ETCD_ADVERTISE_CLIENT_URLS
* ETCD_INITIAL_CLUSTER
* ETCD_INITIAL_CLUSTER_TOKEN Token
* ETCD_INITIAL_CLUSTER_STATE ,new ,existing
vim /usr/lib/systemd/system/etcd.service
[Unit]
Description=Etcd Server
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
Type=notify
EnvironmentFile=/opt/etcd/cfg/etcd
ExecStart=/opt/etcd/bin/etcd \
--name=${ETCD_NAME} \
--data-dir=${ETCD_DATA_DIR} \
--listen-peer-urls=${ETCD_LISTEN_PEER_URLS} \
--listen-client-urls=${ETCD_LISTEN_CLIENT_URLS},http://127.0.0.1:2379 \
--advertise-client-urls=${ETCD_ADVERTISE_CLIENT_URLS} \
--initial-advertise-peer-urls=${ETCD_INITIAL_ADVERTISE_PEER_URLS} \
--initial-cluster=${ETCD_INITIAL_CLUSTER} \
--initial-cluster-token=${ETCD_INITIAL_CLUSTER_TOKEN} \
--initial-cluster-state=new \
--cert-file=/opt/etcd/ssl/server.pem \
--key-file=/opt/etcd/ssl/server-key.pem \
--peer-cert-file=/opt/etcd/ssl/server.pem \
--peer-key-file=/opt/etcd/ssl/server-key.pem \
--trusted-ca-file=/opt/etcd/ssl/ca.pem \
--peer-trusted-ca-file=/opt/etcd/ssl/ca.pem
Restart=on-failure
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
cp /data/ssl/etcd/ca*pem /opt/etcd/ssl/
cp /data/ssl/etcd/server*pem /opt/etcd/ssl/
scp /data/ssl/etcd/ca*pem root@node01:/opt/etcd/ssl/
scp /data/ssl/etcd/ca*pem root@node02:/opt/etcd/ssl/
scp /data/ssl/etcd/server*pem root@node01:/opt/etcd/ssl/
scp /data/ssl/etcd/server*pem root@node02:/opt/etcd/ssl/
##
systemctl enable etcd
systemctl start etcd
검열
:
cd /data/ssl/etcd/
/opt/etcd/bin/etcdctl --ca-file=ca.pem --cert-file=server.pem --key-file=server-key.pem --endpoints="https://192.168.100.100:2379,https://192.168.100.101:2379,https://192.168.100.102:2379" cluster-health
member 65f49728d3d54972 is healthy: got healthy result from https://192.168.100.100:2379
member d94ba21c17c75ffb is healthy: got healthy result from https://192.168.100.101:2379
member dc51f874259f7894 is healthy: got healthy result from https://192.168.100.102:2379
cluster is healthy
# :/var/log/message journalctl -u etcd
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
CRD를 통한 사용자 정의 컨트롤러의 예 소개
이 항목은 사용자 정의 리소스 정의(CRD)를 사용하여 사용자 정의 컨트롤러를 구현하는 예시를 설명합니다.실시 예로 당사 내에서 개발·이용하는 Etcd as a 서비스의 개요와 구조를 소개합니다.
이 항목은 Etcd...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.
cfssl:
mkdir /data/ssl -p
cd /data/
wget https://pkg.cfssl.org/R1.2/cfssl_linux-amd64
wget https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64
wget https://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64
chmod +x cfssl_linux-amd64 cfssljson_linux-amd64 cfssl-certinfo_linux-amd64
mv cfssl_linux-amd64 /usr/local/bin/cfssl
mv cfssljson_linux-amd64 /usr/local/bin/cfssljson
mv cfssl-certinfo_linux-amd64 /usr/bin/cfssl-certinfo
cd /data/ssl/
:https://github.com/etcd-io/etcd/releases/tag/v3.3.10
etcd-v3.3.10-linux-amd64.tar.gz
mkdir /data/ssl/etcd
cd /data/ssl/etcd
vim etcd.sh
# etcd
# cat ca-config.json
cat > ca-config.json < ca-csr.json < server-csr.json <
mkdir /data/src/
cd /data/src/
mkdir /opt/etcd/{bin,cfg,ssl} -p
tar xf etcd-v3.3.10-linux-amd64.tar.gz
mv etcd-v3.3.10-linux-amd64/{etcd,etcdctl} /opt/etcd/bin/
vim /opt/etcd/cfg/etcd
# 3 ETCD_NAME IP
#[Member]
ETCD_NAME="etcd01"
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="https://192.168.100.100:2380"
ETCD_LISTEN_CLIENT_URLS="https://192.168.100.100:2379"
#[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="https://192.168.100.100:2380"
ETCD_ADVERTISE_CLIENT_URLS="https://192.168.100.100:2379"
ETCD_INITIAL_CLUSTER="etcd01=https://192.168.100.100:2380,etcd02=https://192.168.100.101:2380,etcd03=https://192.168.100.102:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
ETCD_INITIAL_CLUSTER_STATE="new"
* ETCD_NAME
* ETCD_DATA_DIR
* ETCD_LISTEN_PEER_URLS
* ETCD_LISTEN_CLIENT_URLS
* ETCD_INITIAL_ADVERTISE_PEER_URLS
* ETCD_ADVERTISE_CLIENT_URLS
* ETCD_INITIAL_CLUSTER
* ETCD_INITIAL_CLUSTER_TOKEN Token
* ETCD_INITIAL_CLUSTER_STATE ,new ,existing
vim /usr/lib/systemd/system/etcd.service
[Unit]
Description=Etcd Server
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
Type=notify
EnvironmentFile=/opt/etcd/cfg/etcd
ExecStart=/opt/etcd/bin/etcd \
--name=${ETCD_NAME} \
--data-dir=${ETCD_DATA_DIR} \
--listen-peer-urls=${ETCD_LISTEN_PEER_URLS} \
--listen-client-urls=${ETCD_LISTEN_CLIENT_URLS},http://127.0.0.1:2379 \
--advertise-client-urls=${ETCD_ADVERTISE_CLIENT_URLS} \
--initial-advertise-peer-urls=${ETCD_INITIAL_ADVERTISE_PEER_URLS} \
--initial-cluster=${ETCD_INITIAL_CLUSTER} \
--initial-cluster-token=${ETCD_INITIAL_CLUSTER_TOKEN} \
--initial-cluster-state=new \
--cert-file=/opt/etcd/ssl/server.pem \
--key-file=/opt/etcd/ssl/server-key.pem \
--peer-cert-file=/opt/etcd/ssl/server.pem \
--peer-key-file=/opt/etcd/ssl/server-key.pem \
--trusted-ca-file=/opt/etcd/ssl/ca.pem \
--peer-trusted-ca-file=/opt/etcd/ssl/ca.pem
Restart=on-failure
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
cp /data/ssl/etcd/ca*pem /opt/etcd/ssl/
cp /data/ssl/etcd/server*pem /opt/etcd/ssl/
scp /data/ssl/etcd/ca*pem root@node01:/opt/etcd/ssl/
scp /data/ssl/etcd/ca*pem root@node02:/opt/etcd/ssl/
scp /data/ssl/etcd/server*pem root@node01:/opt/etcd/ssl/
scp /data/ssl/etcd/server*pem root@node02:/opt/etcd/ssl/
##
systemctl enable etcd
systemctl start etcd
:
cd /data/ssl/etcd/
/opt/etcd/bin/etcdctl --ca-file=ca.pem --cert-file=server.pem --key-file=server-key.pem --endpoints="https://192.168.100.100:2379,https://192.168.100.101:2379,https://192.168.100.102:2379" cluster-health
member 65f49728d3d54972 is healthy: got healthy result from https://192.168.100.100:2379
member d94ba21c17c75ffb is healthy: got healthy result from https://192.168.100.101:2379
member dc51f874259f7894 is healthy: got healthy result from https://192.168.100.102:2379
cluster is healthy
# :/var/log/message journalctl -u etcd
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
CRD를 통한 사용자 정의 컨트롤러의 예 소개이 항목은 사용자 정의 리소스 정의(CRD)를 사용하여 사용자 정의 컨트롤러를 구현하는 예시를 설명합니다.실시 예로 당사 내에서 개발·이용하는 Etcd as a 서비스의 개요와 구조를 소개합니다. 이 항목은 Etcd...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.