CentOS Stream10的系统初始化

这是安装部分,可以参考,我的另一篇博文
VMware Workstation Pro 17.6.3安装 CentOS Stream10的20250324
https://blog.youkuaiyun.com/u013901725/article/details/146552671?spm=1011.2415.3001.10575&sharefrom=mp_manage_link

刚安装完的系统会有一堆问题。我记录一些我的一些初始化问题。

安装软件
dnf install -y lrzsz
yum -y install wget tree curl bash-completion jq vim net-tools telnet lrzsz

#关闭防火墙
sudo firewall-cmd --state
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service

# 关闭文件控制 关闭seliux
getenforce
setenforce 0 && sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/’ /etc/selinux/config

#设置hostname
hostnamectl set-hostname centos10test001

#关闭swap
彻底关闭 #/dev/mapper/cl-swap swap swap defaults 0 0
swapoff -a
sed -i ‘/swap/s/^(.*)$/#\1/g’ /etc/fstab

#修改dns解析 线上的配置
cat > /etc/resolv.conf << EO
nameserver 8.8.8.8
nameserver 223.5.5.5
nameserver 114.114.114.114
options timeout:3 attempts:2 rotate
EOF

#默认文件打开数目 ulimit -n 默认是1024 需要修改
ulimit -n
#修改
cat >> /etc/security/limits.conf << EOF

  • hard nofile 1024000
  • soft nofile 1024000
  • hard nproc 1024000
  • soft nproc 1024000
    EOF

#设置时区
timedatectl
timedatectl set-timezone Asia/Shanghai

#安装chrony命令
#Centos9里是预安装的,没有安装的话执行以下命令:
yum install -y chrony
#说明:Centos9 时间同步要使用chrony命令,ntp命令不能使用了
#2、查看chrony状态
##启用chronyd服务
systemctl enable chronyd
##重启chronyd服务
systemctl restart chronyd
##查看chronyd服务状态
systemctl status chronyd

vim /etc/chrony.conf
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
pool ntp1.aliyun.com iburst
pool ntp2.aliyun.com iburst
pool ntp3.aliyun.com iburst
pool ntp4.aliyun.com iburst
pool ntp5.aliyun.com iburst
pool ntp6.aliyun.com iburst
#内网ip
pool 10.70.130.88 iburst

#通过命令进行查看是否同步,出现^*即表示有可同步的源
chronyc sources

#System clock synchronized: yes 表示同步成功
timedatectl

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值