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:
[root@skatedb65 ~]# 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:
[epel]
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:
[epel]
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
[root@skatedb55 ~]# salt '*' test.ping
skatedb65:
    True
skatedb56:
    True

Concurrently execute command on all minions
[root@skatedb55 ~]# 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
[root@skatedb55 ~]#   

[root@skatedb55 ~]# salt-run manage.status
down:
    - skatedb56
up:
    - skatedb65
[root@skatedb55 ~]# salt-run manage.down
skatedb56
[root@skatedb55 ~]# salt-run manage.up
skatedb65
[root@skatedb55 ~]#
 

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--------

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值