Installing SaltStack Master On CentOS 7 (Simple Steps)
SaltStack a distributed remote execution system used to execute commands and query data on remote nodes, either individually or by arbitrary selection criteria, here is more about the saltstack. Below are the steps how to installing salt master on centos7 host.
1. SYSTEM REQUIREMENTS:
1.1) RAM and DISK information:
CPU: 2core
RAM: 2G
Disk: 50G ( We will place all the state files under the salt master home path: /srv).
We can use below commands to check RAM and Disk details(for testing purpose we are using minimal configuration in our VM),
For RAM: # free –m
For DISK usage: # df –h
1.2) Firewall port up for SaltStack:
Note: Make sure the ‘firewalld’ command installed on the system, otherwise use the command ‘yum -y install firewalld’ to install the firewalld.
Firewall status checking:
Opening port for salt:
# firewall-cmd –permanent –zone=public –add-port=4505-4506/tcp
# firewall-cmd –reload
Verify the port status:
# firewall-cmd –list-ports
Installing salt master on centos7
Run the following commands to install the SaltStack repository and key:
# yum install https://repo.saltstack.com/yum/redhat/salt-repo-latest-1.el7.noarch.rpm
To make sure the SaltStack repo installed use the below command,
# find /etc -name salt-latest.repo
clean up various things which accumulate in the yum cache directory over time,
# yum clean expire-cache
Install the salt-master,
# yum install salt-master
3. CONFIGURING SALT-MASTER:
3.1) In the file: /etc/salt/master
Edit the Interface value with your SALTMASTER’S main interface IP.
Edit the timeout settings (10 minutes),
We can start the salt-master service by below command,
# systemctl start salt-master
4. INSTALLING SALT-MINION
Run the following commands to install the SaltStack repository and key:
# yum install https://repo.saltstack.com/yum/redhat/salt-repo-latest-1.el7.noarch.rpm
To make sure the saltstack repo installed use the below command,
# find /etc -name salt-latest.repo
clean up various things which accumulate in the yum cache directory over time,
# yum clean expire-cache
Install the salt-minion:
# yum install salt-minion
Configuring salt-minion:
In the file: /etc/salt/minion
Edit the master value with your SALTMASTER’S IP
Edit the minion id vale to identify from master ( if we didn’t mention any value as id in this configuration file then the hostname will be displayed on the ‘Unaccepted Keys’ list in salt-master ):
Start the salt-minion service:
Accepting the salt-minion key and verify the minion status:
The salt-minion service will send the encrypted key to salt-master when the service started in ‘saltclient’ vm.
Accept the key in salt-master:
# salt-key -a saltclient
Verify the minion:
# salt ‘saltclient’ test.ping