@tony-yin
2018-12-23T16:25:28.000000Z
字数 9466
阅读 1295
Record
日志
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
这是因为后端rabbitmq队列中之前的任务没有执行完全
这是因为worker默认分配数量和cpu核数相等,小于job数量后面的job则没有被分配到worker
对文件上传下载进行分段操作
三个服务同时读写时,cifs经常ERROR
内存溢出的问题导致的,导致原因一个是nfs全文件读写,第二个是获取文件md5时也是全文件读写
虚拟IP需要能跟业务网段相通,考虑多网段的情况
python 字典无序,但是比如页面需要有顺序
ctdb if 判断
gridform 和 gridWrappedWindow
python dic default 递归创建
架构问题:随机选择一个节点作为管理节点,这个随机节点应该可以提供方式获取到,而不是逐个去获取
1.python全局变量包含全局变量,当被包含变量被覆盖赋值后,上层的全局变量不会变化
2.ctdb 50.samba timeount
/etc/resovtestparm & dns server?
3.nfs client挂载server目录写操作提示permission deny
原因是server暴露目录时,同时要让该目录具有写权限,一般设置为777
2018/8/30
java -jar osmw-1.0.jar
1. 文件上传key.set_contents_from_filename() //参数为filename,全路径key.set_contents_from_file() // 参数为file fd,一个文件句柄
cronjob需要在命令前加用户,尤其是root用户
/mnt/tt *(rw,sync,no_all_squash,root_squash,fsid=accc9105df5383111407fd5b41255e23)
testparm
smbd -F -S
2018/9/5
[root@tony asr_tftp_agent]# git push -u origin yinhui_devCounting objects: 12, done.Delta compression using up to 2 threads.Compressing objects: 100% (11/11), done.Writing objects: 100% (12/12), 5.46 KiB | 0 bytes/s, done.Total 12 (delta 0), reused 0 (delta 0)remote: GitLab: You are not allowed to push code to protected branches on this project.To git@192.168.232.81:cg20/asr_tftp_agent.git! [remote rejected] yinhui_dev -> yinhui_dev (pre-receive hook declined)error: failed to push some refs to 'git@192.168.232.81:cg20/asr_tftp_agent.git'
这是由于设置master为protected branch时,没有勾选developers can push选项,详见: http://www.cnblogs.com/xxcanghai/p/5009926.html
在客户机器上系统日志中发现以下日志:
device eth0 entered promiscuous modedevice eth0 left promiscuous mode
首先,这不是异常的错误日志,对服务器系统没有影响。
device eth0 entered promiscuous mode是指网卡eth0 进入了混杂模式。
device eth0 left promiscuous mode网卡eth0离开了混杂模式。
混杂模式 是网卡的一种工作模式,一般在抓取网卡数据包时使用。
系统日志里出现这个日志信息,说明在服务器上对网卡进行过抓包的操作,tcpdump抓包命令会产生这个日志信息。
可以通过如下命令设置网卡的混杂模式:
ifconfig eth0 promisc 设置网卡eth0为混杂模式ifconfig eth0 -promisc 取消网卡eth0的混杂模式
这是因为我在这套环境中部署了监控脚本,当/var/log/message重新打包时触发抓包操作,然后记录在了系统日志
2018/9/6
需要安装两个python软件包
python-greenletpython-eventlet
2018/9/7
samba用户如果配置了clustering = yes,那么整个samba服务便是集群化的,集群信息是依赖于ctdb的。
查看samba用户列表:
pdbedit -L
增删samba用户:
smbpasswd -a "username"smbpasswd -x "username"
2018/9/10
连接s3,报错如下:
S3ResponseError: S3ResponseError: 403 Forbidden<?xml version="1.0" encoding="UTF-8"?><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>
原因是客户端时间和时区不对,修改时区和时间即可:
# 设置时区[root@tony ~]# timedatectl list-timezones |grep ShanghaiAsia/Shanghai[root@tony ~]# timedatectl set-timezone Asia/Shanghai# 设置时间[root@tony ~]# date -s "<year>-<month>-<day> <hour>:<min>:<second>"
2018/9/11
asr_tftp code revise
2018/9/12
good code
空间换时间
2018/9/13
shell eof
2018/9/19
FTP 删除逻辑
ftp del -u storageuser /ftp3ftp add -a -p ld /ftp3ftp del /ftp3ftp del -a /ftp3
2018/9/21
提供代码的健壮性,考虑各种异常情况,比如:
bucket,要考虑创建同名的情况,要考虑创建失败的情况;bucket要考虑不存在该bucket的情况,是否要考虑自动创建;S3,考虑上传失败的情况,需要考虑上传失败是否要重传?重传几次等等2018/9/26
以一个txt文件和其对应的音频文件作为一个单元,具体数目通过循环次数做到可配
循环所取源txt内容和源音频文件则通过njbak提供的九条数据遍历,没有采取随机算法,是因为遍历次数过多会导致性能消耗
100: 2s200: 8s300: 5s500: 3s1000: 22s19110000: 27s100000: 5min
2018/9/27
ulimit -n <number>
修改配置文件
vim /etc/security/limits.conf
在最后加入
* soft nofile 4096* hard nofile 4096
需要重启才可以生效
[root@tony ~]# ulimit -acore file size (blocks, -c) 0data seg size (kbytes, -d) unlimitedscheduling priority (-e) 0file size (blocks, -f) unlimitedpending signals (-i) 7226max locked memory (kbytes, -l) 64max memory size (kbytes, -m) unlimitedopen files (-n) 1024pipe size (512 bytes, -p) 8POSIX message queues (bytes, -q) 819200real-time priority (-r) 0stack size (kbytes, -s) 8192cpu time (seconds, -t) unlimitedmax user processes (-u) 7226virtual memory (kbytes, -v) unlimitedfile locks (-x) unlimited
2018/10/10
C15000 FTP逻辑整理文档CG20集群化文档编写Linux returncode Q3绩效评估和Q4绩效目标2018/10/12
2018/10/23
2018/10/24
yum install --downloadonly --downloaddir=/tmp <package-name>
2018/10/25
2018/10/26
2018/11/12
kibana汉化grafana绘图monitoring组件默认是启用的
xpack.monitoring.enabled: true
但是监控收集服务默认是关闭的
xpack.monitoring.collection.enabled
注:该配置是在/etc/elasticsearch.yml文件中
GET /_cluster/state/cluster
cluster uuid
http://192.168.232.191:5601/app/monitoring#/elasticsearch?_g=(cluster_uuid:cIw_0EpNTCSQTMX0EAxydg)
get all nodes:
GET /_nodes/usage
http://192.168.232.191:5601/app/monitoring#/elasticsearch/nodes/LlegvJE5TIihJfHfoeyPkQ?_g=(cluster_uuid:cIw_0EpNTCSQTMX0EAxydg)
http://192.168.232.191:5601/app/monitoring#/elasticsearch/nodes/LlegvJE5TIihJfHfoeyPkQ/advanced?_g=(cluster_uuid:cIw_0EpNTCSQTMX0EAxydg)
get indices name and uuid
GET /_cat/indices?v
http://192.168.232.191:5601/app/monitoring#/elasticsearch/indices/.kibana?_g=(cluster_uuid:cIw_0EpNTCSQTMX0EAxydg)
http://192.168.232.191:5601/app/monitoring#/elasticsearch/indices/.kibana/advanced?_g=(cluster_uuid:cIw_0EpNTCSQTMX0EAxydg)
前面需要加上file://,否则会默认为在线资源去解析url并下载
unix
sudo bin/elasticsearch-plugin install file:///path/to/plugin.zip
windows:
假定需要安装的插件本地地址为C:\path\to\plugin.zip
bin\elasticsearch-plugin install file:///C:/path/to/plugin.zip
refer:
sentinl
py yaml
YAML(python3) order
https://stackoverflow.com/questions/5121931/in-python-how-can-you-load-yaml-mappings-as-ordereddicts
CentOS 7 安装强制使用GPT分区
inst.gpt
http://blog.51cto.com/isenknows/2053969
MBR:MBR分区表(即主引导记录)所支持的最大卷:2T,而且对分区有限制:最多4个主分区或3个主分区加一个扩展分区
GPT: GPT(即GUID分区表)。是源自EFI标准的一种较新的磁盘分区表结构的标准,是未来磁盘分区的主要形式。与MBR分区方式相比,具有如下优点。突破4个主分区限制,每个磁盘最多支持128个分区。支持大于2T的分区,最大卷可达18EB。
MBR(Master Boot Record):最大只支持2 TB的盘,最多只支持4个主分区,信息只存储在一个区域。
GPT(GUID partition table):是MBR的替代,属于UEFI,磁盘的每一个分区都有唯一的识别号,支持更大的盘和更多的分区,信息存储在多个区域,当一部分受损后可修复。
主分区,扩展分区,逻辑分区,扩展分区
物理扇区,逻辑扇区
missing: 只推荐不包含自己的结果,但是rock和rocks例外,原因未知
tmux 不同终端进入导致屏幕size显示异常
tmux detach