centos 7系统安装初始化参数
#更改网络格式
yum install vim net-tools -y
cd /etc/sysconfig/network-scripts/
mv ifcfg-em1 ifcfg-eth0
mv ifcfg-em * / tmp /
vim /etc/default/grub
GRUB_CMDLINE_LINUX =“crashkernel = auto rd.lvm.lv = centos/root rd.lvm.lv = centos/swap net.ifnames = 0 biosdevname = 0 rhgb quiet“
grub2-mkconfig -o /boot/grub2/grub.cfg
vim /etc/hostname
openstack-computer -h6.preview.com
#关闭 防火墙&&关闭selinux &&关闭NetworkManager systemctl禁用firewalld
systemctl stop firewalld.service
systemctl disable NetworkManager
systemctl stop NetworkManager
vim /etc/sysconfig/selinux
临时禁用selinux
setenforce 0
yum install net-tools vim lrzsz tree screen lsof tcpdump wget firewalld -y
#同步时间
rm -rf /etc/localtime
ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
yum install ntpdate -y
ntpdate time1.aliyun.com
hwclock -w
date
[root @ openstack-computer-h5 rules.d]# crontab -l
* / 30 * * * * ntpdate 172.16.207.202 && hwclock -w
#更改sysctl.conf参数
vim /etc/sysctl.conf
net.ipv4.ip_nonlocal_bind = 1
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call- iptables = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_tw_recycle = 0
sysctl -p
#更改limits.conf参数
ulimit -n
vim /etc/security/limits.conf
* soft core unlimited
* hard core unlimited
* soft nproc 1000000
* hard nproc 1000000
* soft nofile 1000000
* hard nofile 1000000
* soft memlock 32000
* hard memlock 32000
* soft msgqueue 8192000
* hard msgqueue 8192000
reboot
ulimit -n