forked from yueyongyue/saltshaker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.txt
96 lines (77 loc) · 3.62 KB
/
install.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
saltshaker 环境搭建 Ubuntu 14.04.3 LTS
1、安装pip 详细文档及使用http://www.ttlsa.com/python/how-to-install-and-use-pip-ttlsa/
下载pip
wget "https://pypi.python.org/packages/source/p/pip/pip-7.1.2.tar.gz#md5=3823d2343d9f3aaab21cf9c917710196" --no-check-certificate
安装pip
tar -xzvf pip-7.1.2.tar.gz
cd pip-7.1.2
python setup.py install
2、安装saltstack 版本 salt 2015.5.3 (Lithium)
官方文档http://docs.saltstack.cn/zh_CN/latest/topics/installation/ubuntu.ht
一键添加软件源仓库并导入PPA的key
add-apt-repository ppa:saltstack/salt
手动添加软件源仓库和导入PPA key
echo deb http://ppa.launchpad.net/saltstack/salt/ubuntu `lsb_release -sc` main | sudo tee /etc/apt/sources.list.d/saltstack.list
wget -q -O- "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x4759FA960E27C0A6" | sudo apt-key add -
更新软件仓库
apt-get update
安装saltstack
一键添加软件源仓库并导入PPA的key
add-apt-repository ppa:saltstack/salt
手动添加软件源仓库和导入PPA key
echo deb http://ppa.launchpad.net/saltstack/salt/ubuntu `lsb_release -sc` main | sudo tee /etc/apt/sources.list.d/saltstack.list
wget -q -O- "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x4759FA960E27C0A6" | sudo apt-key add -
更新软件仓库
apt-get update
安装saltstack
apt-get install salt-master
apt-get install salt-minion
apt-get install salt-syndic
apt-get install salt-api
3、安装cherrypy
pip install cherrypy==3.8.0
4、配置api
使用系统pam进行认证,useradd admin && passwd admin
用户名:admin
密码:admin
vim /etc/salt/master.d/saltapi.conf
rest_cherrypy:
port: 8000
host: 127.0.0.1
disable_ssl: true
external_auth:
pam:
admin:
- .*
- '@runner'
- '@wheel'
/etc/init.d/salt-master restart
/etc/init.d/salt-api restart
netstat -tnlp | grep 8000 看到8000端口监听在127.0.0.1上就可以了
5、安装及配置Django 和Django crontab
pip install Django==1.8.4
pip install django-crontab
vim settings.py 配置数据库
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'saltshaker', # Or path to database file if using sqlite3.
'USER': 'root', # Not used with sqlite3.
'PASSWORD': 'sina', # Not used with sqlite3.
'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '3306', # Set to empty string for default. Not used with sqlite3.
}
}
python manage.py migrate 同步数据
python manage.py runserver 0.0.0.0:9000 运行服务
python manage.py createsuperuser 设置后台管理密码
python manage.py crontab add 添加计划任务用于生成'/tmp/salt_dashboard.tmp' 文件
install on centos6.x
1、rpm --import https://repo.saltstack.com/yum/redhat/6/x86_64/latest/SALTSTACK-GPG-KEY.pub
2、yum clean all
3、yum install salt-master salt-minion salt-api
4、chkconfig salt-master salt-minion salt-api on
run saltshaker on nginx & uwsgi
1、pip install uwsgi django-uwsgi
2、https://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
3、install nginx by yourself #www.nginx.org