In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Introduction to saltstack 1. Is a basic platform management tool 2. Is a configuration management system that can maintain a predefined state of remote node 3. Is a distributed remote execution system, which is used to execute commands and query data on remote nodes to remotely perform configuration management (state) cloud management
Experimental environment master 192.168.13.131web01 192.168.13.132web02 192.168.13.1331, configure three servers, install Epel source # # add hostname, add all three machines And to change the name of the host to [root@master ~] # vim / etc/hosts192.168.13.131 master.saltstack.com192.168.13.132 web01.saltstack.com192.168.13.133 web02.saltstack.com#, each needs to turn off the firewall [root@master ~] # systemctl stop firewalld.service [root@master ~] # setenforce 0 [root@master ~] # vim / etc/hostname master.saltstack.com [root@web01 ~] # vim / etc/hostname web01. Saltstack.com [root@web02 ~] # vim / etc/hostname web02.saltstack.com# install epel source (all three should be installed) [root@master ~] # yum install-y epel-release2 Configure the master service salt-master [root@master ~] # yum-y install salt-master [root@master ~] # vim / etc/salt/master # # modify the configuration file 15 lines interface: 192.168.13.131 / / listening address line 215 auto_accept: True / / avoid running salt-key to confirm the root location of the file_roots:base:- / srv/salt / / saltstack file on line 416 of certificate authentication The directory needs to create a 710 line group classification: nodegroups:group1: 'web01.saltstack.com' # # backend server domain name group2:' web02.saltstack.com'552 line pillar_opts: True / / enable pillar function, and synchronize the file function 529th line pillar_roots:base:- / srv/pillar / / pillar home directory Need to create [root@master ~] # mkdir / srv/salt # # create saltstack file root directory [root@master ~] # mkdir / srv/pillar # # create the home directory of pillar [root@master ~] # systemctl start salt-master.service # # enable the service [root@master ~] # netstat-ntap | egrep '4505 | 4506' # # View port tcp 0 192.168.13.131pur4505 0.0.0.0: * LISTEN 45899/python tcp 0 192.168.13.131 LISTEN 45915/python 4506 0.0.0.0 Configure web01,web02 salt-minion [root@web01 ~] # yum-y install salt-minion # # install salt-minion [root@web01 ~] # vim / etc/salt/minion # # modify the configuration file 16 lines master: 192.168.13.131 / / specify the IP78 line id: web01.saltstack.com / / specify the host name of the controlled side (web2 write web02.saltstack.com) [root@web01 ~] # systemctl start salt-minion.service # # start service 4 Test the communication status on master [root@master ~] # salt'* 'test.ping web02.saltstack.com: Trueweb01.saltstack.com: True5 Use master to manage [root@master ~] # salt'* 'cmd.run' df-h' # # check the mount of the background web to see all the values of grains on the controlled host: (every time minion gets client information when starting) [root@master ~] # salt 'web01.saltstack.com' grains.items (static data information) [root@master ~] # salt' web01.saltstack.com' pillar.items (dynamic data letter) Message) [root@master ~] # salt-key # # View the authenticated host information Accepted Keys:web01.saltstack.comweb02.saltstack.comDenied Keys:Unaccepted Keys:Rejected Keys:6 Configuration management install apache## modify configuration file vim / etc/salt/master / / Open the following options, previously opened and created the directory file_roots:base:- / srv/salt/mkdir / srv/salt Note: environment: base, dev (development environment), test (test environment), prod (production environment). [root@master ~] # vim / srv/salt/top.sls # # write administrative file base:'*': # # all hosts-apache # # specify apache file [root@master ~] # vim / srv/salt/apache.slsapache-service: pkg.installed:-names: # # installed service-httpd- httpd-devel Service.running:-name: httpd # # Service enabled-enable: True [root@master ~] # systemctl restart salt-master.service # # restart the service [root@master ~] # salt'* 'state.highstate # # perform operation 7 Check whether to install the httpd service [root@web01 ~] # rpm-Q httpdhttpd-2.4.6-90.el7.centos.x86_64 [root@web01 ~] # netstat-ntap on the web side | grep 80tcp6 00: 80: * LISTEN 6786/httpd [root@web02 ~] # rpm-Q httpdhttpd-2.4.6-90.el7.centos.x86_64 [root @ web02 ~] # netstat-ntap | grep 80tcp6 0 0:: 80: * LISTEN 6759/httpd Thank you for reading!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.