标签:rzsz cts 节点 file mod 自签名证书 max val cat
参考官网文档https://www.rancher.cn/docs/rancher/v2.x/cn/configuration/catalog/
rancher需要在Linux系统上安装,我这里使用的是CentOS,rancher2.x要求的CentOS版本为7.5以上,所以两台机器使用的都是7.5版本。
[root@vm-CentOS750210 ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core)
Host | CPU | Memory | Storage |
角色 |
192.168.0.210 |
8 |
16G |
84G |
|
192.168.0.211 |
8 |
16G |
84G |
|
192.168.0.220 |
8 |
16G |
84G |
|
192.168.0.221 |
8 |
16G |
84G |
|
192.168.0.250 |
8 |
16G |
84G |
|
192.168.0.128 |
8 |
16G |
200G |
|
声明:本次安装为在线安装,所以请确保服务器节点可以正常上网
基础配置:(所有节点都执行)
关闭防火墙及SELinux
# 关闭防火墙 systemctl stop firewalld systemctl disable firewalld # 关闭selinux sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/‘ /etc/sysconfig/selinux setenforce 0
配置本地yum源
# 配置本地yum mkdir /etc/yum.repos.d/bak && cd /etc/yum.repos.d/ mv *.repo bak cat <<EOF >> /etc/yum.repos.d/local.repo [Local] name=Local baseurl=file:///mnt enable=1 gpgcheck=0 EOF mount /dev/cdrom /mnt yum clean all
yum install -y vim lrzsz wget net-tools telnet
# 下载阿里云的yum源 cd /etc/yum.repos.d/ wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum clean all yum makecache # 安装扩展源 yum install -y epel-release
# 安装docker yum install -y docker # 启动docker systemctl start docker # 设置docker服务开机自启动 systemctl enable docker # 查看docker服务状态,running状态为正常 systemctl status docker
在线拉取镜像(配置阿里或者docker-cn都可以)
[root@vm-CentOS750211 yum.repos.d]# mkdir -p /etc/docker [root@vm-CentOS750211 yum.repos.d]# tee /etc/docker/daemon.json <<-‘EOF‘ { "registry-mirrors": ["https://br5538ya.mirror.aliyuncs.com"] } EOF [root@vm-CentOS750211 yum.repos.d]# systemctl daemon-reload [root@vm-CentOS750211 yum.repos.d]# systemctl restart docker
# Docker中国官方镜像加速 --registry-mirror=https://registry.docker-cn.com # 网易163镜像加速 --registry-mirror=http://hub-mirror.c.163.com # 中科大镜像加速 --registry-mirror=https://docker.mirrors.ustc.edu.cn # 创建文件夹 [root@cosmo-0-61 ~]# mkdir -p /etc/docker # 创建daemon.json文件 [root@cosmo-0-61 ~]# vi /etc/docker/daemon.json { "oom-score-adjust": -1000, "log-driver": "json-file", "log-opts": { "max-size": "100m", "max-file": "3" }, "max-concurrent-downloads": 10, "max-concurrent-uploads": 10, "bip": "169.254.123.1/24", "registry-mirrors": ["https://registry.docker-cn.com","https://7bezldxe.mirror.aliyuncs.com"], "insecure-registries": ["192.168.0.68:8000","192.168.0.68:9000","192.168.0.68:6666","192.168.0.68:9999"], "storage-driver": "overlay2", "storage-opts": [ "overlay2.override_kernel_check=true" ] } # 重载daemon.json文件 [root@cosmo-0-61 ~]# systemctl daemon-reload # 开机启动 [root@cosmo-0-61 ~]# systemctl enable docker # 重启Docker服务 [root@cosmo-0-61 ~]# systemctl restart docker
在对应节点安装并启动rancher
docker run -d --restart=unless-stopped -v 192.168.0.210:/var/lib/rancher/ -p 80:80 -p 443:443 rancher/rancher:stable
安装完成后即可在浏览器登录Rancher
登录并开始使用Rancher。登录后,您将进行一些一次性配置。
https://<server_ip>
,server_ip
替换为运行Rancher容器主机的ip;
第一次登录会要求设置管理员密码,默认管理员账号为: admin
如果没有设置密码而要求输入当前密码,可以输入密码: admin
Rancher Server URL是agent节点注册到Rancher Serverd的地址,需要保证这个地址能够被agent主机访问,不要设置为127.0.0.1
或者localhost
然后即可登录
创建集群
角色分配完毕后点击完成
回到全局视图,可以查看集群的部署状态
Rancher安装完毕
标签:rzsz cts 节点 file mod 自签名证书 max val cat
原文地址:https://www.cnblogs.com/fusheng11711/p/12217573.html