DC/OS 创建local-universe
2019-06-13 本文已影响0人
Stay_57c4
DC/OS安装本地资源库
在本机下载相关文件
curl -v https://downloads.mesosphere.com/universe/public/local-universe.tar.gz -o local-universe.tar.gz
curl -v https://raw.githubusercontent.com/mesosphere/universe/version-3.x/docker/local-universe/dcos-local-universe-http.service -o dcos-local-universe-http.service
curl -v https://raw.githubusercontent.com/mesosphere/universe/version-3.x/docker/local-universe/dcos-local-universe-registry.service -o dcos-local-universe-registry.service
上传到Master服务器上,以下步骤每个都需要执行
scp local-universe.tar.gz root@192.168.42.120:~
scp dcos-local-universe-http.service root@192.168.42.120:~
scp dcos-local-universe-registry.service root@192.168.42.120:~
登录到Master上查看是否上传成功
ssh -A core@<master-IP>
ls
移动service到system下
sudo cp dcos-local-universe-registry.service /etc/systemd/system/
sudo cp dcos-local-universe-http.service /etc/systemd/system/
确认已经正确的移动到system下了
ls -la /etc/systemd/system/dcos-local-universe-*
load Universe到docker中,要求至少40G剩余空间
docker load < local-universe.tar.gz
重启systemd
sudo systemctl daemon-reload
打开相关服务
sudo systemctl enable dcos-local-universe-http
sudo systemctl enable dcos-local-universe-registry
sudo systemctl start dcos-local-universe-http
sudo systemctl start dcos-local-universe-registry
确认服务已经运行成功
sudo systemctl status dcos-local-universe-http
sudo systemctl status dcos-local-universe-registry
在各个Master节点上运行
在Slave节点上运行
在DCOS CLI中运行来查看mesos id,并记录
dcos node list
然后:
sudo mkdir -p /etc/docker/certs.d/master.mesos:5000
sudo curl -o /etc/docker/certs.d/master.mesos:5000/ca.crt http://master.mesos:8082/certs/domain.crt
sudo systemctl restart docker
拷贝docker的认证
sudo mkdir -p /var/lib/dcos/pki/tls/certs
sudo cp /etc/docker/certs.d/master.mesos:5000/ca.crt /var/lib/dcos/pki/tls/certs/docker-registry-ca.crt
生成hash
cd /var/lib/dcos/pki/tls/certs/
openssl x509 -hash -noout -in docker-registry-ca.crt
在public slave上创建认证的软连接
sudo ln -s /var/lib/dcos/pki/tls/certs/docker-registry-ca.crt /var/lib/dcos/pki/tls/certs/<hash_number>.0