Salt installation and use 1. preparations for installing and installing centos system salt: many of our servers do not have internet permissions. it doesn't make much sense to set up each source server. Therefore, we use the nginx proxy function, reverse proxy of the yum source address on the Internet to the intranet. Example: the Jiangsu server ipxxx. xxx has nginx and other intranet machines.
Salt installation and use
1. install centos system salt
Preparations before installation:
Many of our servers do not have internet permissions. it doesn't make much sense to set up each source server. Therefore, we use the nginx proxy function to reverse proxy The yum source address on the internet back to the intranet.
Example:
The ip address xxx. xxx of the Jiangsu server is nginx on the server.
1. ps aux | grep nginx can be used to view the directory in which nginx is located
2. Add include vhosts/*. conf to/axon/nginx/conf/nginx. conf.
3. mkdir/axon/nginx/conf/vhosts
4. vi/axon/nginx/conf/vhosts/mirrors. conf
5. axon/nginx/sbin/nginx-t (check whether the Mirrors. conf file is normal after being configured)
6. if success is entered:/axon/nginx/sbin/nginx-s reload, restart the process.
7. If an error occurs in the pid, use pkill-9 nginx to kill all nginx processes. before killing the nginx process, check that ps aux | grep nginx has a keeplive script to automatically restart nginx.
So far, the reverse generation intranet yum server has been set up successfully.
1. Master-side installation
① EPEL installation:
Wget ftp.linux.ncsu.edu/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Rpm-ivh epel-release-6-8.noarch.rpm
② Yum source configuration file:/etc/yum. repos. d/Centos-Base.repo
③ Epel configuration file:/etc/yum. repos. d/epel. repo
④ Salt installation:
Yum install salt-master
Yum install salt-minion
⑤ Master, minion configuration file :(/etc/salt/master start/etc/salt/minion start)
⑥ Check whether salt-key-L is authorized and salt-key-A is authorized
Master installed
2. install Minion:
① Host installation:
Because the intranet does not have a dns server, you can simply use hosts to solve the problem.
Vi/etc/hosts
In this case, ping the test.
The following is the same as the master installation.
II. Salt usage
1. master configuration
2. minion configuration
3. group configuration
Salt-N group test. ping