AnsibleFATE部署过程

前言

基本上按照官方文档就行了,先做before deploy,再做three side guide.md。
AnsibleFATE部署过程_第1张图片

以下是可能出现的问题

这个AnsibleUndefinedVariable: ‘ansible_ssh_host‘ is undefined.是肯定会遇到的,参考我这篇

安全性限制

ansible提示

warning: now open files is 1024, and need to turn up tp 64000,
warning: now max user process is 1024, and need to turn up tp 64000

根据官方手册,在(每一个机器的)配置文件/etc/security/limits.conf/etc/security/limits.d/20-nproc.conf写入``即可。我打开的时候文件里面排列的整整齐齐的,我建议也手动空格跟他们一样整齐。

修改完成后有可能虚拟机的内存不够大,仍然会出现这个warning,此时需要把虚拟机内存调大,18G左右就够用了。

sudo password

ansible日志出现 msg:missing sudo password
修改添加Ansible_project_path/environment/prod/hosts中的
ansible_become_pass=为sudo的密码(不是root密码,是转换为sudo的本账户密码)。
如果你是安装官方文档新建的app用户的话,那app应该是不在sudoer file里面的,这个都加进去sudoer就行了,可以参考这个

出现no erlang package matching

ansible日志出现 no package matching erlang found available

yum install epel-release,或者用其他方法安装epel即可。

python tools报错

报错信息no module named pkg_resources
日志信息failed to import the required python libarary(seuptools) on xx's python /usr/bin/python. please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the document on ansible_python_interpreter

乍一看我以为是用错了python解释器了,因为Linux默认的/usr/bin/python是2.7。修改掉/usr/bin/python的软连接到新下载的miniconda后(危险,不建议这样做),又会报错python2 is required的类似错误,遂改了回python2。

看来不是解释器的问题。看样子得自行下载python2的一个包。但是py2甚至都没有pip工具!

还好我参考了这个,下载了pip2工具。但是pip2 install pkg_resources发现没有version_matching!

搞了好久,才知道不是pip2 install pkg_resources,而是应该pip2 install distribution!安装后仍然报错,但是好像已经安装成功了AnsibleFATE部署过程_第2张图片

再次deploy已经不再出现pkg resources的报错了。

结尾

其他基本没什么了,查看ansible日志之后,发现没有warning、没有fail,就部署成功了。

你可能感兴趣的:(后端python)