[关闭]
@tony-yin 2018-12-23T16:25:28.000000Z 字数 9466 阅读 928

Record

Record


  1. 前端代码
  2. 路由
  3. 后端代码调用,数据库
  4. 项目打包
  5. 项目部署
  6. 开发环境和部署环境目录对应关系
  7. 虚拟机环境申请
  8. 日志

  9. ipython
    yum install python-devel

(yum install gcc; pip install pysmb libnfs celery)
2. pip install libnfs报错:libnfs/libnfs_wrap.c:2969:25: fatal error: nfsc/libnfs.h: No such file or directory

wget http://li.nux.ro/download/nux/dextop/el7/x86_64//libnfs-1.9.8-1.el7.nux.x86_64.rpm
wget http://li.nux.ro/download/nux/dextop/el7/x86_64//libnfs-devel-1.9.8-1.el7.nux.x86_64.rpm

yum localinstall libnfs-1.9.8-1.el7.nux.x86_64.rpm
yum localinstall libnfs-devel-1.9.8-1.el7.nux.x86_64.rpm

  1. 一启动celery就自动执行任务

这是因为后端rabbitmq队列中之前的任务没有执行完全

  1. celery阻塞

这是因为worker默认分配数量和cpu核数相等,小于job数量后面的job则没有被分配到worker

  1. out of memory

对文件上传下载进行分段操作

  1. 三个服务同时读写时,cifs经常ERROR
    内存溢出的问题导致的,导致原因一个是nfs全文件读写,第二个是获取文件md5时也是全文件读写

  2. 虚拟IP需要能跟业务网段相通,考虑多网段的情况

python 字典无序,但是比如页面需要有顺序

ctdb if 判断

gridform 和 gridWrappedWindow

python dic default 递归创建


  1. print 导致daemon执行异常
  2. /proc/如何生成进程文件
  3. subprocess执行daemon异常

  1. ${text[@]}
  2. shell trap
  3. 虚拟机快照,只对磁盘快照,不对内存快照,那么进程的快照信息怎么说呢?

架构问题:随机选择一个节点作为管理节点,这个随机节点应该可以提供方式获取到,而不是逐个去获取


1.python全局变量包含全局变量,当被包含变量被覆盖赋值后,上层的全局变量不会变化

2.ctdb 50.samba timeount

  1. /etc/resov
  2. testparm & dns server?

3.nfs client挂载server目录写操作提示permission deny

原因是server暴露目录时,同时要让该目录具有写权限,一般设置为777


2018/8/30

  1. P2000 SDK Command
  1. java -jar osmw-1.0.jar
  1. python boto
  1. 1. 文件上传
  2. key.set_contents_from_filename() //参数为filename,全路径
  3. key.set_contents_from_file() // 参数为file fd,一个文件句柄
  1. tftp

  1. cronjob

cronjob需要在命令前加用户,尤其是root用户

  1. nfs export
  1. /mnt/tt *(rw,sync,no_all_squash,root_squash,fsid=accc9105df5383111407fd5b41255e23)
  1. monitor iscsi client
    • subprocess returncode == 1
    • cronjob shell command 全路径,为什么要全路径?如何针对不同平台的路径不同做兼容

url


SAMBA排错

  1. 检查配置文件合法性
  1. testparm
  1. 运用自带命令,输出日志
  1. smbd -F -S

2018/9/5

gitlab push error

  1. [root@tony asr_tftp_agent]# git push -u origin yinhui_dev
  2. Counting objects: 12, done.
  3. Delta compression using up to 2 threads.
  4. Compressing objects: 100% (11/11), done.
  5. Writing objects: 100% (12/12), 5.46 KiB | 0 bytes/s, done.
  6. Total 12 (delta 0), reused 0 (delta 0)
  7. remote: GitLab: You are not allowed to push code to protected branches on this project.
  8. To git@192.168.232.81:cg20/asr_tftp_agent.git
  9. ! [remote rejected] yinhui_dev -> yinhui_dev (pre-receive hook declined)
  10. error: failed to push some refs to 'git@192.168.232.81:cg20/asr_tftp_agent.git'

这是由于设置masterprotected branch时,没有勾选developers can push选项,详见: http://www.cnblogs.com/xxcanghai/p/5009926.html

抓包系统日志

在客户机器上系统日志中发现以下日志:

  1. device eth0 entered promiscuous mode
  2. device eth0 left promiscuous mode

首先,这不是异常的错误日志,对服务器系统没有影响。

device eth0 entered promiscuous mode是指网卡eth0 进入了混杂模式。
device eth0 left promiscuous mode网卡eth0离开了混杂模式。

混杂模式 是网卡的一种工作模式,一般在抓取网卡数据包时使用。

系统日志里出现这个日志信息,说明在服务器上对网卡进行过抓包的操作,tcpdump抓包命令会产生这个日志信息。

可以通过如下命令设置网卡的混杂模式:

  1. ifconfig eth0 promisc 设置网卡eth0为混杂模式
  2. ifconfig eth0 -promisc 取消网卡eth0的混杂模式

这是因为我在这套环境中部署了监控脚本,当/var/log/message重新打包时触发抓包操作,然后记录在了系统日志

Bug Fix

  1. qianjing
    • ftp codeerror
    • cifs can't delete
    • ftp delete error, accout.txt not clean

2018/9/6

Bug Fix

  1. qianjing
    • nfs export range permission
  2. wangling
    • ctdb unhealthy -> tgtd error
    • rbd delete
  3. guoziqing
    • light adaptation
    • ctdb exception:can't get lock because of ceph host down
    • disk source empty

获取磁盘来源

需要安装两个python软件包

  1. python-greenlet
  2. python-eventlet

2018/9/7

samba user

samba用户如果配置了clustering = yes,那么整个samba服务便是集群化的,集群信息是依赖于ctdb的。

查看samba用户列表:

  1. pdbedit -L

增删samba用户:

  1. smbpasswd -a "username"
  2. smbpasswd -x "username"

2018/9/10

python boto

连接s3,报错如下:

  1. S3ResponseError: S3ResponseError: 403 Forbidden
  2. <?xml version="1.0" encoding="UTF-8"?>
  3. <Error><Code>RequestTimeTooSkewed</Code><Message>The difference between the request time and the current time is too large.</Message><RequestTime>Mon, 10 Sep 2018 18:16:28 GMT</RequestTime><ServerTime>2018-09-10T06:17:07Z</ServerTime><MaxAllowedSkewMilliseconds>900000</MaxAllowedSkewMilliseconds><RequestId>008A421DA0974F5F</RequestId><HostId>9f4f960f-fe52-4979-a226-3981f04eded7f85ffb31-467a-48c7-b544-abe649f2c3de</HostId></Error>

原因是客户端时间和时区不对,修改时区和时间即可:

  1. # 设置时区
  2. [root@tony ~]# timedatectl list-timezones |grep Shanghai
  3. Asia/Shanghai
  4. [root@tony ~]# timedatectl set-timezone Asia/Shanghai
  5. # 设置时间
  6. [root@tony ~]# date -s "<year>-<month>-<day> <hour>:<min>:<second>"

2018/9/11

hostagent独立出来

  1. asr_tftp code revise

    • log
    • try catch
    • s3 retry
  2. tftp ip range
  3. history
  4. preset
  5. nfs cidr permission
  6. asyncio

2018/9/12

  1. good code

    • log
    • exception process
    • retry
    • validate
    • no hardcode
    • scalable
    • fucntion unit
    • object

空间换时间


2018/9/13

shell eof

2018/9/19

  1. FTP 删除逻辑

    • 删除用户
    • 添加匿名用户
    • 删除ftp服务
    • 删除匿名ftp服务
  1. ftp del -u storageuser /ftp3
  2. ftp add -a -p ld /ftp3
  3. ftp del /ftp3
  4. ftp del -a /ftp3

2018/9/21

  1. 命名考虑易读,即使是唯一性标识,字符串标识+唯一性的时间戳或UUID来表示;
  2. 提供代码的健壮性,考虑各种异常情况,比如:

    • 创建bucket,要考虑创建同名的情况,要考虑创建失败的情况;
    • 获取bucket要考虑不存在该bucket的情况,是否要考虑自动创建;
    • 上传S3,考虑上传失败的情况,需要考虑上传失败是否要重传?重传几次等等

2018/9/26

ASR构造百万级别的假数据

以一个txt文件和其对应的音频文件作为一个单元,具体数目通过循环次数做到可配

循环所取源txt内容和源音频文件则通过njbak提供的九条数据遍历,没有采取随机算法,是因为遍历次数过多会导致性能消耗

  1. 100: 2s
  2. 200: 8s
  3. 300: 5s
  4. 500: 3s
  5. 1000: 22s
  6. 191
  7. 10000: 27s
  8. 100000 5min

2018/9/27

修改操作系统文件最大打开数

  1. 暂时修改
  1. ulimit -n <number>
  1. 永久修改

修改配置文件

  1. vim /etc/security/limits.conf

在最后加入

  1. * soft nofile 4096
  2. * hard nofile 4096

需要重启才可以生效

  1. 查看限制
  1. [root@tony ~]# ulimit -a
  2. core file size (blocks, -c) 0
  3. data seg size (kbytes, -d) unlimited
  4. scheduling priority (-e) 0
  5. file size (blocks, -f) unlimited
  6. pending signals (-i) 7226
  7. max locked memory (kbytes, -l) 64
  8. max memory size (kbytes, -m) unlimited
  9. open files (-n) 1024
  10. pipe size (512 bytes, -p) 8
  11. POSIX message queues (bytes, -q) 819200
  12. real-time priority (-r) 0
  13. stack size (kbytes, -s) 8192
  14. cpu time (seconds, -t) unlimited
  15. max user processes (-u) 7226
  16. virtual memory (kbytes, -v) unlimited
  17. file locks (-x) unlimited

2018/10/10

  1. C15000 FTP逻辑整理文档
  2. CG20集群化文档编写
  3. Linux returncode
  4. Q3绩效评估和Q4绩效目标

2018/10/12

  1. nvim python-mode bug fix
  2. review es document
  3. revise asr agent last time
    • 定时任务支持分钟级别
  4. JD server deploy

2018/10/23

  1. cron blog(10/28)
  2. elastalert && sentinl

2018/10/24

  1. 下载rpm包
  1. yum install --downloadonly --downloaddir=/tmp <package-name>
  1. es doc(监控、告警和报表的完善)
  2. tftp local deploy
  3. tftp doc

2018/10/25

  1. asr agent deploy doc
  2. agent monitor solution

2018/10/26

  1. asr agent code restsruct

2018/11/12

  1. 监控方案
  2. kibana汉化
  3. grafana绘图
  4. 更新文档
  5. 方案review
  6. kiabna monitor enable
  7. url interface
  8. i18n

monitoring组件默认是启用的

  1. xpack.monitoring.enabled: true

但是监控收集服务默认是关闭的

  1. xpack.monitoring.collection.enabled

注:该配置是在/etc/elasticsearch.yml文件中

API

es cluster

  1. GET /_cluster/state/cluster

cluster uuid

  1. http://192.168.232.191:5601/app/monitoring#/elasticsearch?_g=(cluster_uuid:cIw_0EpNTCSQTMX0EAxydg)

es node

get all nodes:

  1. GET /_nodes/usage

overview

  1. http://192.168.232.191:5601/app/monitoring#/elasticsearch/nodes/LlegvJE5TIihJfHfoeyPkQ?_g=(cluster_uuid:cIw_0EpNTCSQTMX0EAxydg)

advanced

  1. http://192.168.232.191:5601/app/monitoring#/elasticsearch/nodes/LlegvJE5TIihJfHfoeyPkQ/advanced?_g=(cluster_uuid:cIw_0EpNTCSQTMX0EAxydg)

indicies

get indices name and uuid

  1. GET /_cat/indices?v

overview

  1. http://192.168.232.191:5601/app/monitoring#/elasticsearch/indices/.kibana?_g=(cluster_uuid:cIw_0EpNTCSQTMX0EAxydg)

advanced

  1. http://192.168.232.191:5601/app/monitoring#/elasticsearch/indices/.kibana/advanced?_g=(cluster_uuid:cIw_0EpNTCSQTMX0EAxydg)

2018/11/21

  1. kibana plugin localinstall

前面需要加上file://,否则会默认为在线资源去解析url并下载

unix

  1. sudo bin/elasticsearch-plugin install file:///path/to/plugin.zip

windows:

假定需要安装的插件本地地址为C:\path\to\plugin.zip

  1. bin\elasticsearch-plugin install file:///C:/path/to/plugin.zip

refer:

2018/11/22

sentinl

2018/11/29

py yaml

2018/12/5

  1. elastalert supervisor verify
  2. elastalert config es ip and port with basic auth
  3. elastalert test rule when config panzura es
  4. mc container get es ip and port from host machine to config elastalert yaml and rule yaml

2018/12/10

CentOS 7 安装强制使用GPT分区

  1. inst.gpt

http://blog.51cto.com/isenknows/2053969

MBRMBR分区表(即主引导记录)所支持的最大卷:2T,而且对分区有限制:最多4个主分区或3个主分区加一个扩展分区

GPTGPT(即GUID分区表)。是源自EFI标准的一种较新的磁盘分区表结构的标准,是未来磁盘分区的主要形式。与MBR分区方式相比,具有如下优点。突破4个主分区限制,每个磁盘最多支持128个分区。支持大于2T的分区,最大卷可达18EB

MBR(Master Boot Record):最大只支持2 TB的盘,最多只支持4个主分区,信息只存储在一个区域。

GPT(GUID partition table):是MBR的替代,属于UEFI,磁盘的每一个分区都有唯一的识别号,支持更大的盘和更多的分区,信息存储在多个区域,当一部分受损后可修复。

主分区,扩展分区,逻辑分区,扩展分区

物理扇区,逻辑扇区

2018/12/17

  1. excel merge
  2. excel export

2018/12/24

missing: 只推荐不包含自己的结果,但是rock和rocks例外,原因未知

2018/12/21

tmux 不同终端进入导致屏幕size显示异常

  1. tmux detach
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注