首页 > 技术文章 > Rancher安装使用

zeppelin 2016-09-02 09:45 原文

官网

http://docs.rancher.com/rancher/latest/en/quick-start-guide/#add-hosts

 

安装步骤:

  • 1 Start up a Linux machine somewhere and install the latest version of Docker on it.
  • 2 Make sure any security groups or firewalls allow traffic:
    • From and To all other hosts on UDP ports 500 and 4500(for IPsec networking)
  • 3 Optional: Add labels to be applied to the host.
  • 4 Optional: Specify the public IP that should be used for this host. This is required if you're trying to add the host the rancher/server container is on.
  • 5 Copy, paste, and run the command below to register the host with Rancher:
    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://ip/v1/scripts/EE1C5A4CB074E2EE36C8:1471971600000:oC9mLcKlu13XSoIODHdzmbk2Kg
  • 6 Click close below. The new host should pop up on the Hosts screen within a minute.

 

centos7

1 yum -y install docker
2 systemctl start docker.service

START RANCHER SERVER

 Rancher server运行命令

sudo docker run -d --restart=always -p 8080:8080 rancher/server
# Tail the logs to show Rancher
sudo docker logs -f containerid

docker ps -a

 

sudo docker logs -f 0ea892efa79d

需要几分钟 Rancher server启动,当日志显示

.... Startup Succeeded, Listening on port...

Rancher UI启动和运行了。

 我们UI设的端口8080,因此,可以访问http://server_ip:8080

 

 

 

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://ip/v1/scripts/EE1C5A4CB074E2EE36C8:1471971600000:oC9mLcKlu13XSoIODHdzmbk2Kg

运行Rancher server的主机上运行这个命令。

在 Rancher UI上点击Close 

docker ps -a

 

英文不好的朋友有福利了,可以点右下角简体中文。

推荐阅读