RockyLinux初始化
328 字
2 分钟
RockyLinux初始化
初始化环境
第一个创建的网卡的数是最小的
[root@localhost ~]# ls /etc/NetworkManager/system-connections/ens160.nmconnection ens192.nmconnection[root@localhost ~]# vi /etc/NetworkManager/system-connections/ens160.nmconnection[root@localhost ~]# systemctl restart NetworkManager # 重启生效改为手动manual,添加ip地址

结果

Rocky 系统软件源更换
# Rocky 系统软件源更换sed -e 's|^mirrorlist=|#mirrorlist=|g' \ -e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.aliyun.com/rockylinux|g' \ -i.bak \ /etc/yum.repos.d/[Rr]ocky*.repo# 更新软件缓存,让刚才的国内源立刻生效。dnf makecache关闭防火墙
# 防火墙修改 firewalld 为 iptablessystemctl stop firewalldsystemctl disable firewalld
yum -y install iptables-servicessystemctl start iptablesiptables -Fsystemctl enable iptablesservice iptables save禁用selinux
# 禁用 Selinuxsetenforce 0sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/configgrubby --update-kernel ALL --args selinux=0
# 查看是否禁用,grubby --info DEFAULT# 回滚内核层禁用操作,grubby --update-kernel ALL --remove-args selinux设置时区
# 设置时区timedatectl set-timezone Asia/Shanghai安装docker环境
# 加载 bridgeyum install -y epel-releaseyum install -y bridge-utils
modprobe br_netfilterecho 'br_netfilter' >> /etc/modules-load.d/bridge.confecho 'net.bridge.bridge-nf-call-iptables=1' >> /etc/sysctl.confecho 'net.bridge.bridge-nf-call-ip6tables=1' >> /etc/sysctl.confecho 'net.ipv4.ip_forward=1' >> /etc/sysctl.confsysctl -p# 添加 docker-ce yum 源# 中科大(ustc)sudo dnf config-manager --add-repo https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repocd /etc/yum.repos.d# 切换中科大源sed -e 's|download.docker.com|mirrors.ustc.edu.cn/docker-ce|g' docker-ce.repo
# 安装 docker-ceyum -y install docker-ce# 配置 daemon.cat > /etc/docker/daemon.json <<EOF{ "default-ipc-mode": "shareable", "data-root": "/data/docker", "exec-opts": ["native.cgroupdriver=systemd"], "log-driver": "json-file", "log-opts": { "max-size": "100m", "max-file": "100" }, "insecure-registries": ["harbor.xinxainghf.com"], "registry-mirrors": ["https://kfp63jaj.mirror.aliyuncs.com"]}EOF
mkdir -p /etc/systemd/system/docker.service.d
# 重启docker服务systemctl daemon-reload && systemctl restart docker && systemctl enable docker关闭swap分区
# 使用 sed 命令自动注释掉 swap 行swapoff -ased -i '/swap/s/^\(.*\)$/#\1/g' /etc/fstab支持与分享
如果这篇文章对你有帮助,欢迎分享给更多人或赞助支持!
RockyLinux初始化
https://ztl123z.github.io/posts/drafts/rockylinux初始化/ 相关文章 智能推荐
1
ansible-docker-deploy
linux ansible-docker-deploy学习
2
Jenkins持续集成从入门到精通
linux RockyLinux初始化
3
shell详解
linux shell详解
4
反向代理在系统结构中的应用场景
linux 反向代理在系统结构中的应用场景
5
Nginx的安装
linux Nginx的安装
随机文章 随机推荐