随笔分类 -  运维

摘要:# 配置静态ip地址 # 配置iptables 使用配置静态ip方式1 可以使用 # 配置dns 阅读全文
posted @ 2019-05-06 10:57 _Goku 阅读(509) 评论(0) 推荐(0)
摘要:拉取镜像(使用docker-componse可以忽略) docker-componse.yml 启动fdfs 测试 阅读全文
posted @ 2019-04-02 13:46 _Goku 阅读(1112) 评论(0) 推荐(0)
摘要:1 # apt install -y xz-utils 2 # xz -d Python-3.6.8.tar.xz 3 # xz -d Python-3.6.8.tar.xz 阅读全文
posted @ 2019-01-11 15:24 _Goku 阅读(3045) 评论(0) 推荐(0)
摘要:第一种解决方式: 第二种解决方式: 1 # apt install -y ca-certificates 阅读全文
posted @ 2019-01-11 15:14 _Goku 阅读(2665) 评论(0) 推荐(0)
摘要:# apt update # apt install net-tools 阅读全文
posted @ 2019-01-11 15:00 _Goku 阅读(2802) 评论(0) 推荐(0)
摘要:# 运行用户 user nginx; # 工作进程数, 通常设置成和cpu的数量相等 worker_processes 4; # PID 文件, 记录当前启动的nginx 的进程ID pid /var/run/nginx.pid; # 全局错误日志 error_log /var/log/nginx/ 阅读全文
posted @ 2018-12-18 10:40 _Goku 阅读(250) 评论(0) 推荐(0)
摘要:#!/bin/bash function display_method(){ clearDisplayMetho=0 if [ $displayMethod -eq 0 ]; then echo -e "\033[${color};${backgroup_color}m ${message} \033[${clearDisplayMetho}m" else echo -e ... 阅读全文
posted @ 2018-12-17 17:27 _Goku 阅读(316) 评论(1) 推荐(0)
摘要:[root@localhost ~]# cat s2.sh #!/bin/bash color_name="red" red=31 color=`eval echo '$'"${color_name}"` echo ${color} [root@localhost ~]# sh s2.sh 31 [root@localhost ~]# 阅读全文
posted @ 2018-12-17 17:19 _Goku 阅读(4355) 评论(0) 推荐(2)
摘要:[root@localhost ~]# yum -y install pwgen [root@localhost ~]# pwgen -ncCyB1 8 1 kei%b3Xa [root@localhost ~]# pwgen -ncCyB1 8 2 Ahs3eib' Yo>u7eun [root@localhost ~]# [root@localhost ~]# echo $RANDO... 阅读全文
posted @ 2018-12-17 13:59 _Goku 阅读(572) 评论(0) 推荐(0)
摘要:# 设置开机启动 [root@localhost ~]# systemctl enable nginx # 停止开机自动启动 [root@localhost ~]# systemctl disable nginx # 启动nginx服务 [root@localhost ~]# systemctl s 阅读全文
posted @ 2018-10-25 15:34 _Goku 阅读(2911) 评论(0) 推荐(0)
摘要:# 使用tzselect 设置服务器时区 [root@localhost ~]# tzselect # 创建时区软连接 [root@localhost ~]# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime # 查看当前时区 [root@localhost ~]# ll /etc/localtime lrwxrwxrwx 1... 阅读全文
posted @ 2018-05-30 10:12 _Goku 阅读(637) 评论(0) 推荐(0)
摘要:# 在http头部显示命中方式 location ~* ^.*\.(js|ico|gif|jpg|jpeg|png)$ { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $pr... 阅读全文
posted @ 2018-03-20 15:55 _Goku 阅读(1017) 评论(0) 推荐(0)
摘要:复制集的特点 数据一致性 主是唯一的,但不是固定的 没有MySQL那样的双主结构 大多数原则,集群存活节点小于等于二分之一时集群不可写,只可读。 是否能选举出新的主节点,是由当前复制集成员存活量来决定的。 从库无法写入 MySQL从库的readonly对具有super权限的用户无效 自动容灾 数据一 阅读全文
posted @ 2018-03-19 16:08 _Goku 阅读(431) 评论(0) 推荐(0)
摘要:单点模式: 部署简单,节省资源 复制集 传统主从结构MASTER/SLAVE , 复制集 复制集是由一组拥有相同数据集的mongod实例做组成的集群。 Primary 主节点 oplog 记录写操作,不记录读操作。 secondary 从节点 (无法写入数据 ) 节点类型: 数据节点:存储数据(实体 阅读全文
posted @ 2018-03-19 15:58 _Goku 阅读(770) 评论(0) 推荐(0)
摘要:import sys, os import socket, struct, fcntl import six import psutil def get_ip(iface="enp0s3"): sock = socket.socket(socket.AF_INET, socket.SOCK_STRE 阅读全文
posted @ 2018-01-22 11:38 _Goku 阅读(840) 评论(0) 推荐(0)
摘要:playbooks 是一种简单的配置管理系统与多机器部署系统的基础。与现有的其他系统有不同之处,且非常适合于复杂应用部署 playbook 可以定制配置,可以按指定的步骤有序执行,支持同步以及异步方式。 官网例子:https://github.com/ansible/ansible-examples 阅读全文
posted @ 2018-01-20 19:45 _Goku 阅读(481) 评论(0) 推荐(0)
摘要:# 查看CPU信息 # dmidecode dmidecode命令可以让你在Linux系统下获取有关硬件方面的信息。dmidecode的作用是将DMI数据库中的信息解码,以可读的文本方式显示。由于DMI信息可以人为修改,因此里面的信息不一定是系统准确的信息。dmidecode遵循SMBIOS/DMI 阅读全文
posted @ 2018-01-12 15:37 _Goku 阅读(5197) 评论(0) 推荐(1)
摘要:官网文档:http://docs.ansible.com/ansible/latest/intro_installation.html#installation 安装: 安装是否成功: 阅读全文
posted @ 2017-12-22 17:14 _Goku 阅读(209) 评论(0) 推荐(0)
摘要:根据zs官方的分类,将模块按功能分类为:云模块、命令模块、数据库模块、文件模块、资产模块、消息模块、监控模块、网络模块、通知模块、包管理模块、源码控制模块、系统模块、单元模块、web设施模块、windows模块 ,具体可以参看官方页面。 一、ping 模块 测试主机是否在线,在线返回pong 二、s 阅读全文
posted @ 2017-12-21 10:44 _Goku 阅读(899) 评论(0) 推荐(0)