dns----/etc/resolv.confproxy----- ~/.bashrcexport http_proxy='http://proxyxa.xxx.com.cn:80'export https_proxy='http://proxyxa.xxx.com.cn:80/'export no_proxy="10.0.0.0/8,127.0.0.1,.xxx.com.cn"
apt source-----------sources.listapt proxy-----------Acquire::http::proxy "http://proxyxa.xxx.com.cn:80/";Acquire::https::proxy "https://proxyxa.xxx.com.cn:80/";apt install openssh-serverdocker-------sudo apt-get updatesudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-commoncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -sudo apt-key fingerprint 0EBFCD88sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"sudo apt-get updateapt-cache madison docker-cesudo apt-get install docker-ce=17.03.3~ce-0~ubuntu-xenialdocker-compose install--------------https://github.com/docker/compose/releases
docker proxy-------------wang@peer2:~$ sudo mkdir -p /etc/systemd/system/docker.service.dwang@peer2:~$ sudo touch /etc/systemd/system/docker.service.d/http-proxy.confwang@peer2:~$ sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf[Service]Environment="HTTP_PROXY=http://proxyxa.xxx.com.cn:80/" "HTTPS_PROXY=https://proxyxa.xxx.com.cn:80/"Environment="NO_PROXY=localhost,127.0.0.0/8,*.zte.com.cn,10.0.0.0/8"docker registrysudo vi /etc/docker/daemon.json{ "registry-mirrors": ["https://registry.docker-cn.com"]}
docker启动参数
/etc/default/docker
sudo systemctl daemon-reloadsudo systemctl restart dockersystemctl show --property=Environment docker
iptables持久化
iptables -A INPUT -p tcp/udp --dport $port -j ACCEPTiptables -A OUTPUT -p tcp/udp --sport $port -j ACCEPTsudo apt-get install iptables-persistentsudo netfilter-persistent save
overlay network
docker-node1:192.168.122.120
docker-node2:192.168.122.155
on node1:
sudo nohup ./etcd-v3.0.12-linux-amd64/etcd \ --name docker-node1 --initial-advertise-peer-urls http://192.168.122.120:2380 \ --listen-peer-urls http://192.168.122.120:2380 \ --listen-client-urls http://192.168.122.120:2379,http://127.0.0.1:2379 \ --advertise-client-urls http://192.168.122.120:2379 \ --initial-cluster-token etcd-cluster \ --initial-cluster docker-node1=http://192.168.122.120:2380,docker-node2=http://192.168.122.155:2380 \ --initial-cluster-state new&
on node2:
sudo nohup ./etcd-v3.0.12-linux-amd64/etcd \ --name docker-node2 --initial-advertise-peer-urls http://192.168.122.155:2380 \ --listen-peer-urls http://192.168.122.155:2380 \ --listen-client-urls http://192.168.122.155:2379,http://127.0.0.1:2379 \ --advertise-client-urls http://192.168.122.155:2379 \ --initial-cluster-token etcd-cluster \ --initial-cluster docker-node1=http://192.168.122.120:2380,docker-node2=http://192.168.122.155:2380 \ --initial-cluster-state new&
sudo ./etcd-v3.0.12-linux-amd64/etcdctl cluster-health
按照这个测试未成功
https://blog.csdn.net/qq_37880968/article/details/86747883
转载于:https://www.cnblogs.com/dablyo/p/11023536.html