Alan Hou的个人博客

DevOps-Ansible自动化运维


DevOps-Ansible自动化运维


MySQL, MongoDB, Redis 安装

/etc/mysql/my.cnf

日志配置

settings.py

调用

存活探测

ICMP(ping, traceroute),TCP

Python 代码实现

小技巧:

使用多个 settings.py,如本地和线上使用不同 配置文件可在运行时执行 python manage.py runserver  –settings=mydevops.settings的形式(修 settings为对应的文件)

pexpect, paramiko

 

常见问题

ubuntu warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused

Complete output from command python setup.py egg_info:
sh: 1: mysql_config: not found

No module named django.core.management

mysql.service: Control process exited, code=exited status=1
Failed to start MySQL Community Server.
mysql.service: Unit entered failed state.
mysql.service: Failed with result ‘exit-code’.
mysql.service: Service hold-off time over, scheduling restart
Stopped MySQL Community Server.
mysql.service: Start request repeated too quickly.
Failed to start MySQL Community Server.

 

退出移动版