docker安裝rancher2.7

1. hosts配置

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1? ? ? ? localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.10.130 rancherserver

2. 主機安全設置

# systemctl stop firewalld;systemctl disable firewalld

# firewall-cmd --state

not running

一、重啟后永久性生效:
開啟:chkconfig iptables on
關閉:chkconfig iptables off
二、即時生效,重啟后失效:
開啟:service iptables start
關閉:service iptables stop

# sed -ri 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

3. 時間設置

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# crontab -l
0 */1 * * * ntpdate time1.aliyun.com

4.? 關閉swap

# cat /etc/fstab

默認開啟,修改后關閉
#/dev/mapper/centos-swap swap swap defaults 0 0

5.? 配置內(nèi)核路由轉(zhuǎn)發(fā)

# vim /etc/sysctl.conf

# cat /etc/sysctl.conf

...

net.ipv4.ip_forward=1

6. docker-ce安裝

# wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

yum install -y docker-ce-23.0.1 docker-ce-cli-23.0.1

systemctl enable --now docker

7. 部署及訪問rancher

mkdir -p /opt/data/rancher_data

docker run -d --privileged -p 80:80 -p 443:443 -v /opt/data/rancher_data:/var/lib/rancher --restart=always --name rancher-2.7.5 rancher/rancher:v2.7.5

最后編輯于
?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容