Saltstack, saltstackweb Interface
Saltstack is developed in Python and can be managed by thousands of servers.
Repetitive O & M work: system installation, Environment deployment, addition of monitoring, code release (based on git or svn secondary development), project migration, and task scheduling.
Salt is a new basic platform management tool. It takes only several minutes to run. scalability is enough to support the management of tens of thousands of servers, and data transmission can be completed in several seconds.
Salt can be used for configuration management, remote commands, and package management.
Salt Configuration
Prepare 3 VMS and follow the specifications to Modify host names: test-c2c-console01, test-c2c-php01, test-c2c-php02.
Configure yum Source
Server
Yum install salt-master-y
/Etc/init. d/salt-master start
Chkconfig salt-master on
Client
Yum install salt-minion-y
Vim/etc/salt/minion
Master: 192.168.31.128 # master Address
Cachedir:/etc/salt/modules # Module Directory
Log_file:/var/log/salt/minion. log # log Path
Log_level: warning # Log Level
/Etc/init. d/salt-minion start
Chkconfig salt-minion on
Key Management
Common parameters:
-L: view the key status
-A: Allow all
-D: delete all
-A: Specifies the key for authentication.
-D: Delete the specified key.
-R: deregister the specified key (the key status is unauthenticated)
Management
Group
[Root @ test-c2c-console01 salt] # pwd
/Etc/salt
[Root @ test-c2c-console01 salt] # vim master
Nodegroups:
# Dev: 'l @ ops-dev01.bj, ops-dev02.bj '# list matching
Dev: 'e @ ops-dev0 [1-9]. bj '# regular match
Environment Configuration
File_roots:
Base: # test environment
-/Srv/salt
Dev: # Development Environment
-/Srv/salt/dev/services
-/Srv/salt/dev/states
Prod: # production environment
-/Srv/salt/prod/services
-/Srv/salt/prod/states
Real-Time Management
Salt-N 'dev' test. ping # match the group host and ping the host in real time.
Salt-n'dev' cmd. run 'uptime' # run the command
Salt-N 'Ops-dev (02 | 03) 'test. ping # RegEx matching host, instant ping
Salt '*' cmd. run "AB-n 10-c 2 http://www.google.com/" # match all machines for stress testing
Salt-n' dev 'sys.doc cmd # View module documentation
Salt-N 'dev' saltutil. sync_all # synchronize to dev Group
Salt-n' dev 'sys.doc mi # View module help
Salt-n' dev 'mi. sshkey # execute this module
Salt-N 'dev' state. sls yum-v test = true # synchronous configuration module
Salt-N 'dev' state. hightstate-v test = true # synchronize all modules