linux系統(tǒng)加入集群的例行優(yōu)化

1.關(guān)閉firewalld防火墻和selinux

...
systemctl stop firewalld.service
systemctl disable firewalld.service
sed -i "s#SELINUX=enforcing#SELINUX=disabled#g" /etc/sysconfig/selinux
setenforce 0
...

2.配置iptables共享上網(wǎng)

3.優(yōu)化字符編碼

...

echo export LANG=en_US.UTF-8 >> /etc/profile
source /etc/profile
...

4.配置yum源,安裝需要的軟件

...
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install lrzsz systat tree vim nmap unzip dos2unix nc lsof iptables -y
...

5.時(shí)鐘優(yōu)化

...
yum -y install ntpdate.x86_64 && ntpdate time1.aliyun.com
...

6.修改文件資源的限制

...
tail -4 /etc/security/limits.conf

  •           soft    nofile           65535
    
  •           hard   nofile           65535
    
  •           soft    noproc         65535
    
  •           hard   noproc         65535
    

...

7.優(yōu)化ssh連接,(也可以修改端口,不過(guò)要注意防火墻配置了)

...
vi /etc/ssh/sshd_config

關(guān)閉root用戶(hù)登錄的功能

79行 GSSAPIAuthentication no

屏蔽DNS查詢(xún)功能

115行 UseDNS no
...

8.設(shè)置自己的主機(jī)名,關(guān)增加到hosts文件中

...
hostnamectl set-hostname 主機(jī)名
echo 主機(jī)名 IP地址 >> /etc/hosts
...

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

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