标签:
修改Docker配置文件 vi /etc/default/docker 增加以下一行 DOCKER_OPTS="$DOCKER_OPTS --insecure-registry=docker.oneapm.me" 重启Docker systemctl daemon-reload sudo service docker restart
修改Docker配置文件 vi /lib/systemd/system/docker.service 修改 ExecStart=/usr/bin/docker daemon -H fd:// 改成 ExecStart=/usr/bin/docker daemon -H fd:// --insecure-registry=docker.oneapm.me 重启Docker systemctl daemon-reload sudo service docker restart
1)查看docker.service的文件路径
2)上图中Loaded节描述的文件位置即为docker.service文件的路径,然后查看文件,
3)上图中,可以看到,依赖的参数配置,是从/etc/sysconfig/docker中加载进来的。用编辑器打开/etc/sysconfig/docker,然后在OPTIONS中添加下面的内容,然后重新加载配置systemctl daemon-reload,再重启docker
如果没有上图中的EnvironmentFile参数配置 可以直接在添加 ExecStart=/usr/bin/docker daemon -H fd:// --insecure-registry=docker.oneapm.me
OPTIONS=‘--selinux-enabled --insecure-registry docker.oneapm.me‘ systemctl daemon-reload systemctl restart docker.service
boot2docker ssh sudo vi /var/lib/boot2docker/profile 增加一行 EXTRA_ARGS="--insecure-registry docker.oneapm.me" 保存,然后重启docker服务: sudo /etc/init.d/docker restart
若使用命令行方式启动docker:
nohup docker -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --insecure-registry docker.oneapm.me -d > /dev/null 2>&1 &
创建一个脚本 vi pullimages_cassandra.sh ,内容如下block里面所示,然后执行脚本sh pullimages_cassandra.sh
#!/bin/bash docker pull docker.oneapm.me/acmeair/webapp docker pull docker.oneapm.me/acmeair/auth-service docker pull docker.oneapm.me/acmeair/eureka docker pull docker.oneapm.me/acmeair/zuul docker pull docker.oneapm.me/acmeair/loader docker pull docker.oneapm.me/acmeair/cassandra docker pull docker.oneapm.me/ubuntu docker pull docker.oneapm.me/crosbymichael/skydock docker pull docker.oneapm.me/crosbymichael/skydns
创建一个脚本 vi pullimages_mysql.sh ,内容如下block里面所示,然后执行脚本sh pullimages_mysql.sh
#!/bin/bash docker pull docker.oneapm.me/acmeair/webapp-mysql docker pull docker.oneapm.me/acmeair/auth-service-mysql docker pull docker.oneapm.me/acmeair/eureka docker pull docker.oneapm.me/acmeair/zuul docker pull docker.oneapm.me/acmeair/loader-mysql docker pull docker.oneapm.me/acmeair/mysql docker pull docker.oneapm.me/ubuntu docker pull docker.oneapm.me/crosbymichael/skydock docker pull docker.oneapm.me/crosbymichael/skydns
#!/bin/bash images=`docker images | grep "oneapm" | awk ‘{print $1}‘` for i in $images do newname=`echo "$i" | cut -d / -f 2-3` docker tag $i $newname docker rmi -f $i done
cd acmeair-netflixoss.git/bin
./startallexceptscaler.sh
cd acmeair-netflixoss.git/bin
./startallwithmysql.sh
注:这只针对mysql版的
把ejb-server-0.4.0.jar包 复制到wlsadmin1容器里 运行指令如下:
docker cp ejb-server-0.4.0.jar wlsadmin1:/u01/
或者使用 acmeair-netflixoss/bin/testzuul.sh,确认收到 200 返回值 (如果提示curl not found ,应该是机器没有curl命令,请使用命令安装 apt-get install curl )
root@acmeair-haishan-test:~/acmeair/acmeair-netflixoss/bin# ./testzuul.sh 200 HTTP://172.17.0.4/rest/api/login 200 HTTP://172.17.0.4/rest/api/customer/byid/uid0@email.com 200 HTTP://172.17.0.4/rest/api/flights/queryflights 200 HTTP://172.17.0.4/rest/api/login/logout?login=uid0@email.com 200 HTTP://172.17.0.4/rest/api/login 200 HTTP://172.17.0.4/rest/api/customer/byid/uid0@email.com 200 HTTP://172.17.0.4/rest/api/flights/queryflights 200 HTTP://172.17.0.4/rest/api/login/logout?login=uid0@email.com 200 HTTP://172.17.0.4/rest/api/login 200 HTTP://172.17.0.4/rest/api/customer/byid/uid0@email.com 200 HTTP://172.17.0.4/rest/api/flights/queryflights 200 HTTP://172.17.0.4/rest/api/login/logout?login=uid0@email.com 200 HTTP://172.17.0.4/rest/api/login 200 HTTP://172.17.0.4/rest/api/customer/byid/uid0@email.com 200 HTTP://172.17.0.4/rest/api/flights/queryflights 200 HTTP://172.17.0.4/rest/api/login/logout?login=uid0@email.com 200 HTTP://172.17.0.4/rest/api/login 200 HTTP://172.17.0.4/rest/api/customer/byid/uid0@email.com 200 HTTP://172.17.0.4/rest/api/flights/queryflights 200 HTTP://172.17.0.4/rest/api/login/logout?login=uid0@email.com 200 HTTP://172.17.0.4/rest/api/login 200 HTTP://172.17.0.4/rest/api/customer/byid/uid0@email.com 200 HTTP://172.17.0.4/rest/api/flights/queryflights 200 HTTP://172.17.0.4/rest/api/login/logout?login=uid0@email.com
标签:
原文地址:http://www.cnblogs.com/beautiful-code/p/5980043.html