CentOS 5 system installation saltstack Installation
Recently, the company has some new requirements and needs to deploy some saltstack to manage some servers. So I recently studied the installation and deployment of saltstack.
To be honest, if you are using a CentOS 6 or later system, you don't need to read this article because the epel software source can be directly used on the 6 system, to install it using yum, you only need to install a salt-master on the server and a salt-minion on the managed node. The installation is no longer convenient.
However, if it is so simple to solve this problem, I will not need to write this article. After all, the ideal is always impractical. Therefore, I must have encountered some strange problems.
The company's server environment is all CentOS 5.11, which brings a little bit of nonsense to the deployment, because after installing the epel source, I searched the salt and found that the result was as follows:
[root@S17~]
#yumsearchsalt
Loadedplugins:downloadonly,fastestmirror,security
Loadingmirrorspeedsfromcachedhostfile
*base:mirrors.btte.net
*epel:mirrors.neusoft.edu.cn
*extras:mirrors.btte.net
*rpmforge:
ftp
.neowiz.com
*updates:mirrors.yun-idc.com
==============================Matched:salt==============================
apbs.i386:AdaptivePoissonBoltzmannSolver
apbs.x86_64:AdaptivePoissonBoltzmannSolver
eurephia-utils.x86_64:Misc.eurephiautilities
perl-Crypt-SaltedHash.noarch:Assists
in
workingwithsaltedhashes
python-halite.noarch:SaltStackWebUI
salt-api.noarch:Awebapi
for
toaccesssalttheparallelremote
:executionsystem
The search results show that there is no such thing as salt-master or salt-minion. This should be a problem with the yum source of CentOS 5. Since yum cannot be used, let's change the installation method, which is also recorded in this article.
Install saltstack using pip
Step 1: Upgrade python to python2.6
Python 2.4 is used on my server. Therefore, using yum to install python2.6 is also a huge slot. The python g2.6 package on CentOS 5 is named python26, this naming rule also appears in php53 and so on, it makes people very painful AH (when the installation of gangglia-web due to the default php-5.1 version of a function does not support, let me have a good time to toss, finally, compiled ganglia into an rpm package, and then ignored the dependency installation.) Haha, if you don't mention the problem, continue to install python2.6.
Step 2: Install the pip command
The pip Command requires python to run the installation script. First, download the installation script:
wgethttps:
//bootstrap
.pypa.io
/get-pip
.py
After the download is complete, run the following command to install pip:
Python2.6 get-pip.py
Use pip to install salt after installation.
pip
install
salt
After the installation is complete, do you think this is the end of the installation? The figure is broken! This is not what you think!
First, we need to find a configuration file and put the configuration file in the mkdir/etc/salt directory, and the master will put the configuration file of the master, minion is stored in the minion configuration file, which can be copied from the salt installed in yum on CentOS 6 (I did that ).
By the way, do not forget to put the startup script together in/etc/init. d /. After all this is done, you still need to install some dependent packages on the two machines separately. Otherwise, the minion will die in seconds when it is started. Directly mount the following software packages with yum: python26-crypto, python26-m2crypto, python26-zmq
After installation, you can start it normally. Modify the minion configuration file, master: [master IP], and then you can see the minion key on the master machine.