本文已CentOS7为例子,其它系统查看对应linux系统命令即可。
centos可复制粘贴即可,密码自己设置。
#时间同步查看
略,有NTP服务器设置ntp服务
#CentOS7防火墙配置
firewall-cmd --zone=public --add-port=5236/tcp --permanent
firewall-cmd --reload
#查看 firewall-cmd --zone=public --query-port=5236/tcp
#删除 firewall-cmd --zone=public --remove-port=5236/tcp --permanent
#关闭系统防火墙
systemctl stop firewalld
systemctl disable firewalld
#CentOS6防火墙配置
#iptables -A INPUT -s 0.0.0.0/0.0.0.0 -p tcp --dport 5236 -j ACCEPT
#service iptables save
#service iptables restart
#service iptables stop
#chkconfig iptables off
#关闭Selinux
sed -i ‘/SELINUX=enforcing/c\SELINUX=disabled’ /etc/selinux/config
setenforce 0
#关闭swap
sed -ri ‘s/.swap./#&/’ /etc/fstab
swapoff -a
#磁盘调度算法用deadline CentOS7
#echo deadline > /sys/block/${disk}/queue/scheduler
grubby --update-kernel=ALL --args=“elevator=deadline”
#关闭numa CentOS7
grubby --update-kernel=ALL --args=“numa=off”
#禁用透明大页
echo never > /sys/kernel/mm/transparent_hugepage/enabled
sed -i ‘s/quiet/quiet transparent_hugepage=never numa=off/’ /etc/default/grub
grub2-mkconfig -o /etc/grub2.cfg
#修改sysctl.conf文件
echo 0 > /proc/sys/vm/overcommit_memory
echo ‘vm.overcommit_memory=0’ >>/etc/sysctl.conf
sysctl -p
#修改limits.conf文件
cat limitis.conf.txt>>/etc/security/limits.d/limits.conf
#修改system.conf文件
sed -i ‘s/.DefaultLimitNOFILE./DefaultLimitNOFILE=65536/’ /etc/systemd/system.conf
sed -i 's/.DefaultLimitNPROC./DefaultLimitNPROC=10240/’ /etc/systemd/system.conf
#修改nproc.conf文件
cd /etc/security/limits.d/
temp_v=ls *nproc.conf
echo
t
e
m
p
v
e
c
h
o
′
d
m
d
b
a
s
o
f
t
n
p
r
o
c
6553
6
′
>
>
/
e
t
c
/
s
e
c
u
r
i
t
y
/
l
i
m
i
t
s
.
d
/
temp_v echo 'dmdba soft nproc 65536'>>/etc/security/limits.d/
tempvecho′dmdbasoftnproc65536′>>/etc/security/limits.d/temp_v
echo ‘dmdba hard nproc 65536’>>/etc/security/limits.d/KaTeX parse error: Expected 'EOF', got '#' at position 11: temp_v cd #̲建立data目录 mkdir …LD_LIBRARY_PATH:/data/dmdbms/bin"'>> .bash_profile
echo ‘export PATH=
P
A
T
H
:
PATH:
PATH:DM_HOME/bin:$DM_HOME/tool’>> .bash_profile
#root修改removeIPC
sed -i ‘s/.RemoveIPC=.*/RemoveIPC=no/’ /etc/systemd/logind.conf
systemctl daemon-reload
systemctl restart systemd-logind
#修改login
vi /etc/pam.d/login
session required /lib64/security/pam_limits.so
session required pam_limits.so