注意:
系统自带的autoconf版本为2.63,在编译ZeroMQ时,由于版本较低,会报错不通过,故需安装大于2.63的版本。
# tar xvzf autoconf-2.69.tar.gz
# cd autoconf-2.69
# ./configure
# make
# make install
# tar xvzf libsodium-1.0.1.tar.gz
# cd libsodium-1.0.1
# ./autogen.sh
# ./configure --prefix=/usr/local
# make --jobs=`grep processor /proc/cpuinfo | wc -l`
# make install
./autogen.sh 报错:
Can't exec "aclocal": 没有那个文件或目录 at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: 没有那个文件或目录
解决方法:
1
yum install automake
1
2
3
4
5
6
7
报错:
configure.ac:418: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
[size=1em]解决方法:
[size=1em]
# tar xvzf openssl-1.0.1g.tar.gz
# cd openssl-1.0.1g
# ./config shared --prefix=/usr/local
# make && make install
cp -a /usr/local/include/openssl /usr/include/vim Python-2.7.8/Modules/Setup
# Socket module helper for socket(2)
_socket socketmodule.c timemodule.c
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
#SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
取消那四行的注释
# tar xvzf M2Crypto-0.22.3.tar.gz
# cd M2Crypto-0.22.3
# python setup.py install saltstack安装
https://github.com/saltstack/salt/releases/download/v2014.7.0/salt-2014.7.0.tar.gz
# tar xvzf salt-2014.7.0.tar.gz
# cd salt-2014.7.0
# python setup.py install
# salt --versions-report
如果报错:
[root@jwh ~]# salt --versions-report
Traceback (most recent call last):
File "/usr/local/binlt", line 10, in <module>
salt_main()
File "/usr/localb/python2.7/site-packageslt/scripts.py", line 466, in salt_main
import salt.cli.salt
File "/usr/localb/python2.7/site-packageslt/clilt.py", line 9, in <module>
import salt.utils.job
File "/usr/localb/python2.7/site-packageslt/utils/job.py", line 8, in <module>
import salt.minion
File "/usr/localb/python2.7/site-packageslt/minion.py", line 20, in <module>
from salt.config import DEFAULT_MINION_OPTS
File "/usr/localb/python2.7/site-packageslt/config.py", line 36, in <module>
import salt.syspaths
File "/usr/localb/python2.7/site-packageslt/syspaths.py", line 108, in <module>
SPM_FORMULA_PATH = __generated_syspaths.SPM_FORMULA_PATH
AttributeError: 'module' object has no attribute 'SPM_FORMULA_PATH'
[root@jwh ~]#解决方法:
pip install --upgrade salt
[root@jwh ~]# salt --versions-report
Salt Version:
Salt: 2015.8.0
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: 1.5.5
Jinja2: 2.8
libgit2: Not Installed
libnacl: 1.4.5
M2Crypto: 0.22
Mako: 1.0.4
msgpack-pure: 0.1.3
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.8 (default, Sep 1 2016, 22:45:32)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 15.4.0
RAET: 0.6.5
smmap: Not Installed
timelib: Not Installed
Tornado: 4.4.1
ZMQ: 4.1.5
System Versions:
dist: centos 6.5 Final
machine: x86_64
release: 2.6.32-431.el6.x86_64
system: Linux
version: CentOS 6.5 Final
[root@jwh ~]#
SaltStack配置
(1)、master端
# mkdir /etc/salt
# cp -a conf/master /etc/salt/
# cp -a pkg/suse/salt-master /etc/init.d/
# chmod +x /etc/init.d/salt-master
# chkconfig --level 235 salt-master on
# mkdir -p /var/log/salt /srv/salt
# vim /etc/salt/master
interface: 192.168.3.110
auto_accept: True
## 删除指定的被控主机、root用户的crontab信息
# salt '*' cron.rm_job root 'date >/dev/null 2>&1'
# salt '*' cron.raw_cron root
(4)、dnsutil模块(实现被控主机通用DNS操作)
## 为被控主机添加指定的hosts主机配置项
# salt '*' dnsutil.hosts_append /etc/hosts 127.0.0.1 rocketzhang.qq.com
(5)、file模块(被控主机文件常见操作,包括文件读写、权限、查找、校验等)
# salt '*' file.get_sum /etc/resolv.conf md5
# salt '*' file.stats /etc/resolv.conf
更多功能可以看文档哈 ^_^
(6)、network模块(返回被控主机网络信息)
# salt '*' network.ip_addrs
# salt '*' network.interfaces
更多功能可以看文档哈 ^_^
(7)、pkg包管理模块(被控主机程序包管理,如yum、apt-get等)
# salt '*' pkg.install nmap
# salt '*' pkg.file_list nmap
(8)、service 服务模块(被控主机程序包服务管理)
# salt '*' service.enable crond
# salt '*' service.disable crond
# salt '*' service.status crond
# salt '*' service.stop crond
# salt '*' service.start crond
# salt '*' service.restart crond
# salt '*' service.reload crond
Salt Master报错:Minion did not return. [No response] | Polar Snow
https://docs.20150509.cn/2015/11/23/Salt-Master%e6%8a%a5%e9%94%99-Minion-did-not-return-No-response/