Architecture environment
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.1.5 lb01
172.16.1.6 lb02
172.16.1.7 web01
172.16.1.8 web02
172.16.1.31 nfs01
172.16.1.41 backup
172.16.1.51 db01 db01.etiantian.org
172.16.1.61 m01
Stored in the backup / etc / hosts
cluster architecture based system environment Preparation
1. Install new system configuration centos 7 2 NIC eth0 eth1 named
2. NAL second card is Mode (public environment), configured to segment the network 10.0.0.0 section, configure the network segment 172.16.1.0 network segment
3. optimize installed centos 7 virtual machine, install common software · turn off the firewall
optimization steps
1. matching yum warehouse
Back up
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
1, download URL: https://opsx.alibaba.com/mirror
2, Ctrl + f web search epel, you click the Actions column of the "Help"
3, the backup (if configured epel other sources)
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
4, to download the new repo /etc/yum.repos.d/
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
NOTE: Configure epel source, need to install wget, yum install -y wget
2. Install the base packages
yum install -y net-tools vim tree htop iftop iotop lrzsz sl wget unzip telnet nmap nc psmisc dos2unix bash-completion bash-completion-extra sysstat rsync nfs-utils httpd-tools -y
3. Turn off the firewall firewalld
1> temporarily turn off the firewall (to restart the server fails)
systemctl stop firewalld(start开启)
2> permanently turn off the firewall (restart server failure)
systemctl disable firewalld(enable永久开启)
3> Check the firewall
systemctl status firewalld(检查防火墙的状态)
Note: If you work, the server can not be restarted when the temporary and permanent modifications have
4. Close selinux
1> Before backup operation after checking
cp /etc/selinux/config /etc/selinux/config.bak
2> temporary closure of SELinux (re-sign-on system failure)
getenforce view the SELinux state
setenforce modify SELinux state
setenforce 0 modify SELinux state
3> permanently closed SELinux (will take effect after server restart)
modify the configuration file
/etc/selinux/config中SELINUX=disabled
enforcing
SELinux open
permissive
SELinux closed there will be a warning message
Disabled
SELinux completely shut down
4> Check status SELinux
grep '=disabled' /etc/selinux/config
SELINUX=disabled
Note: If you work, the server can not be restarted when the temporary and permanent modifications have
5. Adjust the biggest single process can open a file number
echo '* - nofile 65535' >>/etc/security/limits.conf
6. Modify the character set
Permanent modifications:
localectl set-locale LANG=en_US.utf-8
Check: echo $ LANG
show success, he said: en_US.UTF-8
sed -i 's/#UseDNS yes/UseDNS no/g' /etc/ssh/sshd_config
7. modify environment variables - the font color
Modify the PS1 variable
temporarily modify: export
PS1="[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\H\[\e[0m\] \[\e[31;1m\]\w\[\e[0m\]]\\$ "
永久修改 echo export
PS1="[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\H\[\e[0m\] \[\e[31;1m\]\w\[\e[0m\]]\\$ " >>/etc/profile
检查 echo $PS1
1. Optimization completed virtual machine clones
1. Select the connection cloning (cloning virtual machines appear to be problems clone a virtual machine can not be used)
. 2. The complete clone (completely copy space)
2. Cloning of the virtual machine following
1. Modify the host name
2. Modify the ip address
3. Restart the server
3. Create xshell label - whether the test can be connected successfully.
Reproduced in: https: //www.jianshu.com/p/4e96763c6439