kinght2008 发表于 2015-11-26 11:21:50

SaltStack Installation(一)

  author:skate
time:2014/11/11
  
  SaltStack Installation
  
  Installation from EREL
  1. If EPEL is not enabled on your system,you can use the following commands to enable it
For RHTL 6:
  rpm -Uvh http://ftp.linux.ncsu.edu/pub/epel/6/i386/epel-release-6-8.noarch.rpm
  2. Installing stable release
yum install salt-master
yum install salt-minion
  If you met the following error:
# yum install salt-minion
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
  Please fix the file "/etc/yum.repos.d/epel.repo"
  vi /etc/yum.repos.d/epel.repo
  Before:

name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
  After:

name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
  continue
  On the salt-master,run this:
yum install salt-master
  On each salt-minion,run this:
yum install salt-minion
  3.Configuration
  salt-master uses the general default configuration,salt-minion accord to the following configuration:
  # vi /etc/salt/minion
.....
master: 10.20.0.55
.....
  4.Start saltstack
  To start the master
service salt-master start
  To start the minion
service salt-minion start
  5.Key Management
  view all the minion_key on master
salt-key -L
  accepted specifie minion_key
salt-key -a key-name

accepted all minion_key
salt-key -A

6.Now let's testing
  View online minion
# salt '*' test.ping
skatedb65:
    True
skatedb56:
    True
  Concurrently execute command on all minions
# salt '*' cmd.run 'uptime'
skatedb65:
   15:04:19 up 7 days,5:49,2 users,load average: 0.00, 0.00, 0.00
skatedb56:
   15:04:19 up 55 days,6:17,1 user,load average: 0.00, 0.00, 0.00
#   
  # salt-run manage.status
down:
    - skatedb56
up:
    - skatedb65
# salt-run manage.down
skatedb56
# salt-run manage.up
skatedb65
#

  7.Online Help
salt '*' sys.doc   //view all modules instruction
salt '*' sys.doc test //view test module instruction
salt '*' sys.doc test.ping   //view test.ping function instruction
  
  
  --------end--------
页: [1]
查看完整版本: SaltStack Installation(一)