In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1 the preparation environment ensures that etcd is installed in the cluster environment and docker is installed in each node
2 install flannel2.1 flannel node IP address field assignment
Flannel relies on etcd to assign non-conflicting cluster IP. First, set the IP address field used by flannel node on etcd. The ip of etcd node in this paper is 192.168.100.20.
Etcdctl-- endpoints "http://192.168.100.20:2379" set / coreos.com/network/config'{" NetWork ":" 172.17.0.0 SubnetMin "," SubnetMax ":" 172.17.20.0 "," Backend ": {" Type ":" vxlan "}'
2.2 minion node installs flannel downloads flannel package
Wget https://github.com/coreos/flannel/releases/download/v0.9.0/flannel-v0.9.0-linux-amd64.tar.gz
Extract and copy the extracted flanneld,mk-docker-opts.sh to / usr/local/bin
Cp flanneld,mk-docker-opts.sh / usr/local/bin
2.3Create systemd service cat / lib/systemd/system/flanneld.service of flannel
[Unit]
Description=Flanneld
Documentation= https://github.com/coreos/flannel
After=network.target
Before=docker.service
[Service]
ExecStart=/usr/local/bin/flanneld-etcd-endpoints= http://192.168.100.20:2379-iface=enp0s3-ip-masq=true
Restart=on-failure
Type=notify
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
Start the flannel service
Systemctl start flanneld.service
The following steps are mainly done when the flannel service is started:
-get the configuration information of network from etcd.
-divide the subnet and register it in etcd.
-record subnet information to / run/flannel/subnet.env
Cat / run/flannel/subnet.env
FLANNEL_NETWORK=172.17.0.0/16
FLANNEL_SUBNET=172.17.2.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true
3 configure docker startup parameters use the script provided by flannel to convert subnet.env into Docker startup parameters, and the created startup parameters are located in the / run/docker_opts.env file
Root@wangpei-VM:~# sh / usr/local/bin/mk-docker-opts.sh-d / run/docker_opts.env-c
Root@wangpei-VM:~# cat / run/docker_opts.env
DOCKER_OPTS= "- bip=172.17.2.1/24-ip-masq=false-mtu=1450"
Write this statement to / etc/default/docker as the environment variable started by docker
Cat / etc/default/docker | grep DOCKER_OPTS
DOCKER_OPTS= "- bip=172.17.2.1/24-ip-masq=false-mtu=1450"
Startup parameters in docker
Root@192:~# awk'! / # / {if ($0,000= ") print}'/ lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation= https://docs.docker.com
After=network.target docker.socket firewalld.service flanneld.service
Requires=docker.socket
[Service]
Type=notify
EnvironmentFile=-/etc/default/docker
ExecStartPre=/usr/local/bin/mk-docker-opts.sh-d / run/docker_opts.env-c
EnvironmentFile=-/run/docker_opts.env
ExecStart=/usr/bin/dockerd-H fd:// $DOCKER_OPTS
ExecReload=/bin/kill-s HUP $MAINPID
LimitNOFILE=1048576
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
[Install]
WantedBy=multi-user.target
Load the configuration and start docker
Root@wangpei-VM:~# systemctl daemon-reload
Root@wangpei-VM:~# systemctl restart docker
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.