关于后端:AnsibleFATE部署过程

7次阅读

共计 1494 个字符,预计需要花费 4 分钟才能阅读完成。

前言

基本上依照官网文档就行了,先做 before deploy,再做 three side guide.md。

以下是可能呈现的问题

这个 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! 装置后依然报错,然而如同曾经装置胜利了

再次 deploy 曾经不再呈现 pkg resources 的报错了。

结尾

其余根本没什么了,查看 ansible 日志之后,发现没有 warning、没有 fail,就部署胜利了。

正文完
 0