Centos7 Install rancher

如果你要使用rancher,你需要安装docker,如果官网打不开,你也可以访问本站链接参考安装
当然,官网安装rancher也是比较详细的,如果你能打开,不妨看看

sysinfo

[root@gitlab ~]# cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core) 
[root@gitlab ~]# uname -a
Linux gitlab 3.10.0-327.28.2.el7.x86_64 #1 SMP Wed Aug 3 11:11:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[root@gitlab ~]# docker -v
Docker version 1.12.1, build 23cf638

开始安装

[root@gitlab ~]# sudo docker run -d --restart=always -p 8080:8080 rancher/server
## 查看
[root@gitlab ~]# docker ps -a
7bd86b0ece62        rancher/agent:v1.0.2               "/run.sh run"            2 days ago          Up 2 days                                                                rancher-agent
5805e3bf5d79        rancher/agent-instance:v0.8.3      "/etc/init.d/agent-in"   2 days ago          Up 2 days                 0.0.0.0:500->500/udp, 0.0.0.0:4500->4500/udp   a2e6aef8-c0e6-4a6a-869d-547ba74fa310
4cd5e8cfe7dc        rancher/agent:v1.0.2               "/run.sh http://10.10"   3 days ago          Exited (0) 2 days ago                                                    pensive_carson
92d3891b0ed3        rancher/agent-instance:v0.8.3      "/etc/init.d/agent-in"   3 days ago          Exited (128) 3 days ago                                                  6a94d63e-fddb-4865-8ece-0fa3e1162165
71cf1975da89        rancher/agent:v1.0.2               "/run.sh state"          3 days ago          Exited (0) 2 days ago                                                    rancher-agent-state
03510683a525        rancher/agent:v1.0.2               "/run.sh http://10.10"   3 days ago          Exited (1) 2 days ago                                                    naughty_williams
7eccdf961671        rancher/server                     "/usr/bin/s6-svscan /"   3 days ago          Up 2 days                 3306/tcp, 0.0.0.0:8080->8080/tcp     

现在我们同8080端口访问,如,10.10.239.143:8080,你可以选择使用中文

配置用户

在系统管理页面中---》选择访问控制----》配置下账户和密码即可,非常简单

添加主机

我们在基础架构中---》选择添加主机,在弹出的对话框中,复制第5项运行在需要被添加的主机上

如下

[root@gitlab ~]# sudo 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.10.239.143:8080/v1/scripts/BBA39D3C6092C3B4B84B:1473681600000:706yqOTwCztS5FMSOsDTAAKOUtg
Unable to find image 'rancher/agent:v1.0.2' locally
v1.0.2: Pulling from rancher/agent
5a132a7e7af1: Pull complete 
fd2731e4c50c: Pull complete 
28a2f68d1120: Pull complete 
a3ed95caeb02: Pull complete 
7fa4fac65171: Pull complete 
33de63de5fdb: Pull complete 
d00b3b942272: Pull complete 
Digest: sha256:b0b532d1e891534779d0eb1a01a5717ebfff9ac024db4412ead87d834ba92544
Status: Downloaded newer image for rancher/agent:v1.0.2
e80d6270fd45db4ca4fdb441cd30716fd6fa7cd65a35cf1b9fd8dab0dfba4f7e

在回到web界面已经能够看到被添加到主机

0 分享

您可以选择一种方式赞助本站

支付宝扫码赞助

支付宝扫码赞助

日期: 2016-09-12分类: Docker

标签: docker

发表评论