09 2019 档案

摘要:(1).服务器io占满,服务无响应, sar -q -f /var/log/sa/sa28 上图显示plist-sz 增加了一倍 plist-sz 说明:进程列表中的进程(processes)和线程数(threads)的数量 这个参数的算法:所有进程数+线程数 所有进程数:ps axu | wc - 阅读全文
posted @ 2019-09-29 17:19 wxhw7021234 阅读(1480) 评论(0) 推荐(0)
摘要:推导式comprehensions(又称解析式),是Python的一种独有特性。推导式是可以从一个数据序列构建另一个新的数据序列的结构体。 共有三种推导,在Python2和3中都有支持: 列表(list)推导式 字典(dict)推导式 集合(set)推导式 一、列表推导式 1、使用[]生成list 阅读全文
posted @ 2019-09-24 16:09 wxhw7021234 阅读(234) 评论(0) 推荐(0)
摘要:1.递归法 带有yield的函数都被看成生成器,生成器是可迭代对象,且具备__iter__ 和 __next__方法, 可以遍历获取元素python要求迭代器本身也是可迭代的,所以我们还要为迭代器实现__iter__方法,而__iter__方法要返回一个迭代器,迭代器自身正是一个迭代器,所以迭代器的 阅读全文
posted @ 2019-09-24 16:08 wxhw7021234 阅读(265) 评论(0) 推荐(0)
摘要:linux的cut命令 一、其语法格式为: cut [-bn] [file] 或 cut [-c] [file] 或 cut [-df] [file] 使用说明 cut 命令从文件的每一行剪切字节、字符和字段并将这些字节、字符和字段写至标准输出。如果不指定 File 参数,cut 命令将读取标准输入 阅读全文
posted @ 2019-09-20 17:52 wxhw7021234 阅读(283) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python3# coding=utf-8import requestsimport jsonimport boto3headers = {'Content-Type': 'application/json-rpc'}#url = 'http://%s/zabbix/a 阅读全文
posted @ 2019-09-18 15:54 wxhw7021234 阅读(248) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python3#coding=utf-8import jsonimport requests#from urllib import requests, parse,error# based url and required header#url = "http://sg-zabbix.upliveapp.com/zabbix/api_jsonrpc.php"class 阅读全文
posted @ 2019-09-18 14:43 wxhw7021234 阅读(962) 评论(0) 推荐(0)
摘要:1. 提取/etc/ansible/hosts 文件中包括star的行,且包含数字,不以[为开头的行 grep 'star' /etc/ansible/hosts | grep '[[:digit:]]' | grep -v '^\[' 2.grep 扩展 首先谈一下grep命令的常用格式为:gre 阅读全文
posted @ 2019-09-12 15:14 wxhw7021234 阅读(807) 评论(0) 推荐(0)
摘要:vim start_boot.sh #!/bin/bash usage(){ echo "$0 [start|stop|usage]" } status_springboot(){ ps axu | grep "${jar_file}" | grep -v 'grep' }start_springb 阅读全文
posted @ 2019-09-09 16:10 wxhw7021234 阅读(756) 评论(0) 推荐(0)
摘要:问题: 1. kafka的topic 是程序自己建立,默认只建立8个partitions,1个replication-factor 目的: 扩展partitions 到9个, replicatoion-factor 3个 原因:因为kafka是三台,如果replicatoion-factor设置1的 阅读全文
posted @ 2019-09-06 18:08 wxhw7021234 阅读(1393) 评论(0) 推荐(0)