随笔分类 -  Linux

摘要:很多时候需要批量跑脚本执行任务,但又不想分发再执行,而是直接一条命令下去就跑脚本,该怎么玩比较嗨? 例如以下脚本: 1、管道 s 后面跟的是脚本的参数,如果有。 2、source shell [root@ ~] source 阅读全文
posted @ 2019-03-01 15:39 wshenJin 阅读(2475) 评论(0) 推荐(0) 编辑
摘要:一个场景:目前越来越多的业务需要远程读写Redis,而Redis 本身不提供 SSL/TLS 的支持,在需要安全访问的环境下。 这时候就需要额外的手段进行加密认证,这里有两种手段:spiped 和 ngx stream proxy 现在服务端起一个监听在127 的 Redis server 1、使用 阅读全文
posted @ 2019-02-14 19:42 wshenJin 阅读(2515) 评论(0) 推荐(0) 编辑
摘要:平时用rsync做数据同步时,都是通过 password file 指定一个密码文件 这个密码文件权限要求比较高,一般是600,属主属组都是rsync命令执行者 如果是在脚本中执行rsync,比如定时任务执行带rsync的脚本,那么可以在脚本里 export RSYNC_PASSWORD="xxxx 阅读全文
posted @ 2019-01-23 13:16 wshenJin 阅读(2376) 评论(0) 推荐(0) 编辑
摘要:nginx和php fpm对于 USR2 、 HUP 信号的处理方式不一样: TERM, INT(快速退出,当前的请求不执行完成就退出) QUIT (优雅退出,执行完当前的请求后退出) HUP (重新加载配置文件,用新的配置文件启动新worker进程,并优雅的关闭旧的worker进程, 用于ngin 阅读全文
posted @ 2019-01-08 18:58 wshenJin 阅读(447) 评论(0) 推荐(0) 编辑
摘要:例如,启动配置文件 ` 阅读全文
posted @ 2018-10-30 12:04 wshenJin 阅读(1536) 评论(0) 推荐(0) 编辑
摘要:# curl -Lks http://www.hop5.in/yum/el6/hop5.repo > /etc/yum.repos.d/hop5.repo # cat /etc/yum.repos.d/hop5.repo [hop5] name=www.hop5.in Centos Reposito 阅读全文
posted @ 2018-10-23 09:34 wshenJin 阅读(522) 评论(0) 推荐(0) 编辑
摘要:rsync daemon 同步数据时,若想同时指定权限和属主属组,可以做如下配置: [test1] uid = admin gid = admin incoming chmod = Dug=rwx,Do=rx,Fug=rw,Fo=r #incoming chmod = D775,F664 outgo 阅读全文
posted @ 2018-06-26 15:03 wshenJin 阅读(4173) 评论(0) 推荐(0) 编辑
摘要:线上一台机器由于程序异常导致目录产生了很多文件名乱码的文件,直接通过rm好像删不了。 可以通过inode号 进行删除: 或者: 阅读全文
posted @ 2018-06-13 21:44 wshenJin 阅读(550) 评论(0) 推荐(0) 编辑
摘要:curl 下载文件 o:将文件保存为命令行中指定的文件名的文件中 O:使用URL中默认的文件名保存文件到本地 limit rate:限速 C:对大文件使用断点续传功能 silent:不显示进度信息 认证授权 在访问需要授权的页面时,可通过 u 选项提供用户名和密码进行授权 传递请求数据 默认curl 阅读全文
posted @ 2018-06-06 12:53 wshenJin 阅读(2621) 评论(0) 推荐(0) 编辑
摘要:修改 lsyncd 的默认配置,不直接执行rsync 进行同步,而是改用自己的脚本。 binary 指定我们的脚本 vim /usr/local/lsyncd/etc/lsyncd.conf settings { logfile = "/usr/local/lsyncd/logs/lsyncd.lo 阅读全文
posted @ 2017-08-09 11:32 wshenJin 阅读(1068) 评论(8) 推荐(0) 编辑
摘要:查看硬件RAID中某块硬盘SN sas 口: [root@ ~]$ smartctl a /dev/sda d megaraid,n Serial number: 6RJ974SR sat 口 [root@ ~]$ smartctl a /dev/sda d sat+megaraid,n Seria 阅读全文
posted @ 2017-07-01 12:54 wshenJin 阅读(15732) 评论(0) 推荐(0) 编辑
摘要:Linux系统出现hung_task_timeout_secs和blocked for more than 120 seconds的解决方法 Linux系统出现系统没有响应。 在/var/log/message日志中出现大量的 “echo 0 /proc/sys/kernel/hung_task_t 阅读全文
posted @ 2017-06-29 11:22 wshenJin 阅读(14581) 评论(0) 推荐(0) 编辑
摘要:环境部署 源机:192.168.31.140 目标机:192.168.31.130 源机配置 基于rsync的lsyncd 自动同步,rsync的配置省略 安装lsyncd rpm ivh lsyncd 2.1.5 1.x86_64.rpm 配置文件:/usr/local/lsyncd/etc/ls 阅读全文
posted @ 2017-06-27 14:25 wshenJin 阅读(3119) 评论(0) 推荐(0) 编辑
摘要:redis3.0 主从 两个实例:6000为主,6001为从。 主实例配置如下: # replication repl-diskless-sync no repl-ping-slave-period 10 repl-timeout 60 repl-backlog-size 100mb repl-ba 阅读全文
posted @ 2017-06-16 14:49 wshenJin 阅读(235) 评论(0) 推荐(0) 编辑
摘要:简介 Memcached是一款开源、高性能、分布式内存对象缓存系统,可应用各种需要缓存的场景,其主要目的是通过降低对Database的访问来加速web应用程序。它是一个基于内存的“键值对”存储,用于存储数据库调用、API调用或页面引用结果的直接数据,如字符串、对象等。 memcached是以Live 阅读全文
posted @ 2017-06-03 19:35 wshenJin 阅读(281) 评论(0) 推荐(0) 编辑
摘要:简介 TCMalloc(Thread Caching Malloc)与标准glibc库的malloc实现一样的功能,但是TCMalloc在效率和速度效率都比标准malloc高很多。TCMalloc是google perftools工具中的一个(gperftools四个工具分别是:TCMalloc、h 阅读全文
posted @ 2017-06-03 11:09 wshenJin 阅读(669) 评论(0) 推荐(0) 编辑
摘要:1、配置默认路由 ip route add default via 192.168.10.1 dev eth0 route add default gw 192.168.10.1 2、间接路由: ip route add 192.168.10.0/24 via 192.168.10.1 dev et 阅读全文
posted @ 2017-06-02 15:23 wshenJin 阅读(423) 评论(0) 推荐(0) 编辑
摘要:安装libyaml [root@ ~]#wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz -O /dist/dist/yaml-0.1.4.tar.gz [root@ ~]#cd /dist/src/ [root@ ~]#tar zx 阅读全文
posted @ 2017-05-24 20:24 wshenJin 阅读(1270) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示