在我们日常运维中,写脚本监控一个进程是比较常见的操作,比如我要监控mysql进程是否消失,如果消失就重启mysql。 用下面这段代码就可以实现: #!/bin/sh Date=` date ‘+%c’` while : do if ! ps aux | grep -w mysqld | grep - ...
分类:
系统相关 时间:
2021-05-24 14:22:35
阅读次数:
0
##1.使用ansible的playbook实现自动化安装httpd 配置ansible主机文件 [root@localhost ~]# vim /etc/ansible/hosts [websrvs] 10.50.100.8 配置ansible与管理端的ssh连接 [root@localhost ...
分类:
Web程序 时间:
2021-05-24 07:09:02
阅读次数:
0
1、Ansible简介 定义:Ansible是一个开源部署工具 Ansible与Chef,Saltstack的不同: Chef Ruby语言编写,C/S架构,配置需要Git依赖,Recipe脚本编写规范,需要编程经验 Saltstack Python语言编写,C/S架构,模块化配置管理,YAML脚本 ...
分类:
其他好文 时间:
2021-05-24 02:10:44
阅读次数:
0
Ansible快速入门# 介绍# Ansible是一款简单的运维自动化工具,只需要使用ssh协议连接就可以来进行系统管理,自动化执行命令,部署等任务。 Ansible的特点 1、ansible不需要单独安装客户端,也不需要启动任何服务2、ansible是python中的一套完整的自动化执行任务模块3 ...
分类:
其他好文 时间:
2021-05-04 16:06:24
阅读次数:
0
ansible批量部署node_exporter; 基于consul服务发现; 将node_exporter所在机器的ip和端口注册到consul; 普罗米修斯从consul获取到ip和端口自动加入监控 100台:web、db、负载均衡、消息队列 "id": "web-1","name": "web ...
分类:
其他好文 时间:
2021-05-04 15:32:29
阅读次数:
0
开机会启动许多程序。它们在Windows叫做"服务"(service),在Linux就叫做"守护进程"(daemon)。 最高权限账户为 root,可以操作一切! 关机指令为:shutdown ; sync 将数据由内存同步到硬盘中。shutdown 关机指令,你可以man shutdown 来看一 ...
分类:
系统相关 时间:
2021-04-22 15:15:12
阅读次数:
0
Configuration: 默认有两个配置文件 /etc/ansible/ansible.cfg 为配置文件 /etc/ansible/hosts为inventory host_key_checking = True 时,不能使用密码链接target ...
分类:
其他好文 时间:
2021-04-21 12:59:45
阅读次数:
0
systemd systemd 是 Linux 系统工具,用来启动守护进程,已成为大多数发行版的标准配置 1. 由来 历史上,Linux 的启动一直采用 init 进程,下面的命令用来启动服务 $ /etc/init.d/httpd start # 或者 $ service httpd start ...
分类:
其他好文 时间:
2021-04-14 12:06:39
阅读次数:
0
作者:weixin_34092455 https://blog.csdn.net/weixin_34092455/article/details/89733396 本文基于 ansible 2.3.0.0 编写 我们目前有 8 个大区共 24 台 nginx 服务器,每个区除了 upstream 地 ...
分类:
其他好文 时间:
2021-04-08 13:18:16
阅读次数:
0
在日常使用ansible playbook的过程中,我们有时候希望做一下补救性的操作,做一些判断, 例如: Default 1 2 3 4 5 6 7 8 9 10 11 tasks: - block: - debug: msg='i execute normally' - command: /bi ...
分类:
其他好文 时间:
2021-04-08 13:17:01
阅读次数:
0