首页 > 代码库 > docker rancher 体验 (未完待续.....)

docker rancher 体验 (未完待续.....)

docker rancher 体验

官方 github
https://github.com/rancher/rancher


环境说明:

10.6.0.140
10.6.0.187
10.6.0.188


修改主机名:
10.6.0.140 = hostnamectl --static set-hostname reancher-manager
10.6.0.187 = hostnamectl --static set-hostname reancher-node-1
10.6.0.188 = hostnamectl --static set-hostname reancher-node-2

 

 

[root@reancher-manager ~]#mkdir -p /opt/rencher/mysql[root@reancher-manager ~]#docker run -d --name rencher --restart=always -v /opt/rencher/mysql:/var/lib/mysql -p 8080:8080 rancher/server[root@reancher-manager ~]#docker ps -aCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                              NAMESc8209da7add0        rancher/server      "/usr/bin/s6-svscan /"   12 minutes ago      Up 12 minutes       3306/tcp, 0.0.0.0:8080->8080/tcp   rencher

 

浏览器访问:

http://10.6.0.140:8080

显示如下:

1.

技术分享

 

2. 填写访问地址,如果为私网IP ,会提示。

技术分享

 

技术分享


3. node 节点 复制: docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.0.2 http://10.6.0.140:8080/v1/scripts/8944D0EC8BCFEB4F127C:1472544000000:BIX8IC8bWsRbx60NMhka4AmxmpQ

进行安装rancher-agent

 

[root@reancher-node-1 ~]# docker ps -aCONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS                     PORTS               NAMES6c7f533527ec        rancher/agent:v1.0.2   "/run.sh run"            4 minutes ago       Up 4 minutes                                   rancher-agent7566aa61cdbe        rancher/agent:v1.0.2   "/run.sh state"          4 minutes ago       Exited (0) 4 minutes ago                       rancher-agent-state032d85c88779        rancher/agent:v1.0.2   "/run.sh http://10.6."   5 minutes ago       Exited (0) 4 minutes ago                       fervent_morse

 

 

4. 安装完毕,等待5分钟左右,在 WEB UI 界面,可以看到如下:

技术分享

 

技术分享


5. 点击如下: 添加 容器

 技术分享

 

docker rancher 体验 (未完待续.....)