当前位置: 首页 > news >正文

anolis8.9-k8s1.32-系统基本配置

一、系统信息

# cat /etc/anolis-release 
Anolis OS release 8.9

二、 firewalld设置

firewall-cmd --zone=public --add-port=6443/tcp --permanent

firewall-cmd --zone=public --add-port=10250-10259/tcp --permanent

firewall-cmd --zone=public --add-port=30000-32767/tcp --permanent

firewall-cmd --zone=public --add-port=179/tcp --permanent

firewall-cmd --zone=public --add-port=8472/udp --permanent

firewall-cmd --reload

三、 selinux关闭

默认关闭

四、 关闭swap

# swapoff -a
# sed -ri 's/.*swap.*/#&/' /etc/fstab
# echo "vm.swappiness=0" >> /etc/sysctl.conf
# sysctl -p

五、 主机时间同步--<这里作为时间服务器使用>

chrony默认安装。

# egrep -v "^$|^#|^ *#" /etc/chrony.conf 
pool ntp.aliyun.com iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
allow 192.168.0.0/16
local stratum 10
keyfile /etc/chrony.keys
leapsectz right/UTC
logdir /var/log/chrony


# sudo systemctl enable --now chronyd
# sudo firewall-cmd --permanent --add-service=ntp
# firewall-cmd --reload


# chronyc tracking
# chronyc sources -v

六、 主机优化

# cat <<EOF >> /etc/security/limits.conf
* soft nofile 655360
* hard nofile 131072
* soft nproc 655350
* hard nproc 655350
* soft memlock unlimited
* hard memlock unlimited
EOF

七、 ipvs安装

# dnf -y install ipvsadm ipset sysstat conntrack libseccomp

# cat > /etc/sysconfig/modules/ipvs.modules <<EOF
#!/bin/bash
modprobe -- ip_vs
modprobe -- ip_vs_lc
modprobe -- ip_vs_wlc
modprobe -- ip_vs_rr
modprobe -- ip_vs_wrr
modprobe -- ip_vs_lblc
modprobe -- ip_vs_lblcr
modprobe -- ip_vs_dh
modprobe -- ip_vs_sh
modprobe -- ip_vs_fo
modprobe -- ip_vs_nq
modprobe -- ip_vs_sed
modprobe -- ip_vs_ftp
modprobe -- ip_vs_sh
modprobe -- nf_conntrack 
modprobe -- ip_tables
modprobe -- ip_set
modprobe -- xt_set
modprobe -- ipt_set
modprobe -- ipt_rpfilter
modprobe -- ipt_REJECT
modprobe -- ipip
EOF


# cat > /etc/modules-load.d/containerd.conf <<EOF
overlay
br_netfilter
ip_vs
ip_vs_rr
ip_vs_wrr
ip_vs_sh
nf_conntrack
EOF


# chmod 755 /etc/sysconfig/modules/ipvs.modules && bash /etc/sysconfig/modules/ipvs.modules && lsmod | grep ip_vs

八、 内核优化

# cat <<EOF > /etc/sysctl.d/k8s.conf
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
fs.may_detach_mounts = 1
vm.overcommit_memory = 1
vm.panic_on_oom = 0
fs.inotify.max_user_watches = 89100
fs.file-max=52706963
fs.nr_opne=52706963
net.netfilter.nf_conntrack_max=2310720

net.ipv4.tcp_keepalive_time=600
net.ipv4.tcp_keepalive_probes=3
net.ipv4.tcp_keepalive_intvl=15
net.ipv4.tcp_max_tw_buckets=36000
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_max_orphans=327680
net.ipv4.tcp_orphan_retries=3
net.ipv4.tcp_syncookies=1
net.ipv4.tcp_max_syn_backlog=16384
net.ipv4.ip_conntrack_max=131072
net.ipv4.tcp_max_syn_backlog=16384
net.ipv4.tcp_timestamps=0
net.core.somaxconn=16384
EOF


# sysctl --system

文章转载自:

http://luF1v78t.sqnxk.cn
http://xmVM87Dl.sqnxk.cn
http://t7mlcr3v.sqnxk.cn
http://Me9oE1in.sqnxk.cn
http://QF2TGGkG.sqnxk.cn
http://z8sh7Dw1.sqnxk.cn
http://GLLeNxzG.sqnxk.cn
http://bN8EWJwM.sqnxk.cn
http://0jD0ahDB.sqnxk.cn
http://Xyg8Fo57.sqnxk.cn
http://AQnbVuo4.sqnxk.cn
http://K4uXE4iM.sqnxk.cn
http://sWD2pYom.sqnxk.cn
http://5KB96gNF.sqnxk.cn
http://ydBIoLVw.sqnxk.cn
http://nugL0JeL.sqnxk.cn
http://FgTPJTCu.sqnxk.cn
http://8VlirWbp.sqnxk.cn
http://yRWjGMTT.sqnxk.cn
http://83PPxvOt.sqnxk.cn
http://D39AYaKv.sqnxk.cn
http://7lrH26CD.sqnxk.cn
http://Cnigq28i.sqnxk.cn
http://X7Vspl0G.sqnxk.cn
http://Se2XRumF.sqnxk.cn
http://4PE9pQqa.sqnxk.cn
http://oNNZaV7n.sqnxk.cn
http://xO1pnzUB.sqnxk.cn
http://hZueTtSi.sqnxk.cn
http://CV6qW6Wy.sqnxk.cn
http://www.dtcms.com/a/45841.html

相关文章:

  • Linux--基本指令2
  • 使用Python简单自动地生成图文并茂的网页文件(WEB数据可视化)
  • C# 类库打包dll文件
  • 操作系统之文件系统
  • 一次有趣的前后端跨越排查
  • MobileViTv3模型详解及代码复现
  • vscode接入ai插件(免费版)
  • 2025.3.1学习内容----网络编程
  • 蓝桥杯 门牌制作
  • 儿童英语启蒙规划
  • 分布式拒绝服务(DDoS)攻击检测系统的设计与实现
  • LeetCode:132. 分割回文串 II(DP Java)
  • 《论数据分片技术及其应用》审题技巧 - 系统架构设计师
  • 入门大模型的学习路线是什么?
  • Rt-thread源码剖析(2)——时钟与定时器
  • CAN总线通信协议学习4——数据链路层之仲裁规则
  • DHCP配置实验
  • 企业建设——控制措施类型
  • 静态时序分中的case analysis传播分析
  • 迷你世界脚本世界UI接口:UI
  • react 编写一个待办事项,函数优化,组件传值
  • openssl下aes128算法gcm模式加解密运算实例
  • MyBatis-Plus 元对象处理器 @TableField注解 反射动态赋值 实现字段自动填充
  • logback日志输出配置范例
  • 基于第三方SDK的Windows平台全功能RTMP|RTSP直播播放器深度解析
  • C++20 中的 `consteval` 和 `constinit` 特性
  • Bash Shell 比较注入漏洞:分析与利用
  • 深入解析:域名转换成 IP 地址的多种方式
  • Element Plus使用(五)
  • Java 设计模式:软件开发的精髓与艺