Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation steps for SaltStack and SaltStack WebUI

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

This article is to share with you SaltStack and SaltStack WebUI installation steps, I believe that most people do not know how to install, in order to let you learn, to give you a summary of the following, do not say much, let's read on.

Install saltstack

Environment:

Master:192.168.117.145 (centos7, python2.7)

Minion1:192.168.117.215 (centos7)

Minion2:192.168.117.231 (2008R2)

Install master

Close selinux

Getenforce # # View the status of selinux setenforce 0 # # close selinux

Turn off the firewall

Systemctl stop firewalld # # turn off the firewall

Install the epel source

Epel is required to install both master and minion. Official address: https://fedoraproject.org/wiki/EPEL

Yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Install and start master

You can use the package manager (centos:yum,ubuntu:apt-get) or install it using pip. For more information, please refer to yum here for installation. For others, please refer to the official website for instructions on https://docs.saltstack.com/en/latest/topics/installation/index.html.

Yum install-y salt-mastersystemctl enable salt-master.service # # Boot systemctl start salt-master

Configuration / etc/hosts file

192.168.117.145 Master192.168.117.215 Node-1192.168.117.167 R2

Ping Node-1 to verify the configuration results.

Install minion

1. Installation

For other installation methods, refer to the official website, windows agent link installation package download address:

Https://repo.saltstack.com/#windows

Yum install-y salt-minion

two。 Specify master address

Modify the file / etc/salt/minion

Master: after 192.168.46.163Id:Node-1 # # is defined here, the master authentication certificate will take this name as the main name, and the comment status will be here by default.

Start minion

Systemctl enable salt-minion.servicesystemctl start salt-minion

Master node Salt-KEY authentication

After minion startup is complete, the master node can use salt-key to see

[root@localhost ~] # salt-keyAccepted Keys:Denied Keys:Unaccepted Keys: # # unqualified KEYNode-1Rejected Keys:

Configuration authentication

Operate on the server side

Salt-key-a Node-1

[root@localhost ~] # salt-keyAccepted Keys: # # accepted KEYNode-1Denied Keys:Unaccepted Keys:Rejected Keys:

Description:-a: accept,-A Roundup all. You can use the salt-key command to see which clients have been signed. At this point, we will have an extra minion_master.pub file under the / etc/salt/pki/minion directory on the client.

Test verification

Example 1: salt'* 'test.ping / / checks whether the communication is normal, or you can specify one of the' Node-1'

Example 2: salt'* 'cmd.run' df-h' / / remote execute command

Note: the * here must be a client that has been accepted on master, which can be found through salt-key, usually the id value that we have set.

For this part, it supports wildcards, lists, and regularities. For example, for two clients web10 and web11, we can write them in the form of salt 'web*' salt' web1 [02] 'salt-L' web10,web11' salt-E 'web (10 | 11)'. Use a list, that is, multiple machines are separated by commas, and you need to add-L, and you must have the-E option to use the rule.

Master installs web interface

Download halite address: https://github.com/saltstack/halite

[root@localhost ~] # cd / var/www

Generate the index.html file, extract it and enter it into the halite directory

[root@localhost www] # cd halite/halite/ [root@localhost www] #. / genindex.py-C

Install salt-api

Yum install salt-api

The user who created the user salt-api (not root)

Useradd-M-s / sbin/nologin slsapi echo 'slsapi' | passwd slsapi-- stdin

Configure master

Modify the file / etc/salt/master

Rest_cherrypy: host: 0.0.0.0 port: 8080 debug: true static: / root/halite/halite app: / root/halite/halite/index.htmlexternal_auth: pam: admin: -. * -'@ runner' -'@ wheel'

Restart master

Systemctl restart salt-master

Configure salt-api startup item and set api to boot automatically

Systemctl enable salt-api.service

Modify service file

Vi / usr/lib/systemd/system/salt-api.service

Modify ExecStart entry

ExecStart=/usr/bin/python / var/www/halite/halite/server_bottle.py-d-C-l debug-s cherrypy

Start salt-api

Systemctl daemon-reloadsystemctl start salt-api

Login test: http://127.0.0.1:8080/app/console

Log in via salt/salt

These are the installation steps for SaltStack and SaltStack WebUI, which are more comprehensive, and I believe there are quite a few tools that we may see or use in our daily work. Through this article, I hope you can gain more.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report