<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[Ops运维 | Mr`kang Blog｜小豆子]]></title> 
<link>https://www.cnmysql.com/index.php</link> 
<description><![CDATA[关注服务器运维技术、DB优化、Docker虚拟化、自动化运维、工作积累]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[Ops运维 | Mr`kang Blog｜小豆子]]></copyright>
<item>
<link>https://www.cnmysql.com/post/141/</link>
<title><![CDATA[GITLAB无缝升级版本]]></title> 
<author>kangyang &lt;kangyang315@qq.com&gt;</author>
<category><![CDATA[LINUX系统管理]]></category>
<pubDate>Thu, 20 Aug 2015 02:33:22 +0000</pubDate> 
<guid>https://www.cnmysql.com/post/141/</guid> 
<description>
<![CDATA[ 
	git下载<br/><a href="https://about.gitlab.com/downloads/archives/" target="_blank">https://about.gitlab.com/downloads/archives/</a><br/><br/><a href="https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/update/README.md#updating-from-gitlab-66-and-higher-to-710-or-newer" target="_blank">https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/update/README.md#updating-from-gitlab-66-and-higher-to-710-or-newer</a><br/>Updating from GitLab 6.6 and higher to the latest version<br/><br/>sudo gitlab-ctl stop unicorn<br/>sudo gitlab-ctl stop sidekiq<br/>sudo gitlab-ctl stop nginx<br/>sudo gitlab-rake gitlab:backup:create<br/><br/># Ubuntu/Debian:<br/>sudo dpkg -i gitlab_x.x.x-omnibus.xxx.deb<br/><br/># CentOS:<br/>sudo rpm -Uvh gitlab-x.x.x_xxx.rpm<br/><br/>sudo gitlab-ctl reconfigure<br/>sudo gitlab-ctl restart<br/><br/>sudo gitlab-ctl status<br/>sudo gitlab-rake gitlab:check SANITIZE=true<br/><br/>Tags - <a href="https://www.cnmysql.com/tags/gitlab/" rel="tag">gitlab</a> , <a href="https://www.cnmysql.com/tags/git%25E5%258D%2587%25E7%25BA%25A7/" rel="tag">git升级</a>
]]>
</description>
</item><item>
<link>https://www.cnmysql.com/post/137/</link>
<title><![CDATA[PPTP简单部署使用]]></title> 
<author>kangyang &lt;kangyang315@qq.com&gt;</author>
<category><![CDATA[LINUX系统管理]]></category>
<pubDate>Mon, 05 Jan 2015 07:40:45 +0000</pubDate> 
<guid>https://www.cnmysql.com/post/137/</guid> 
<description>
<![CDATA[ 
	<span style="font-family: 宋体;"><span style="font-size: 12px;"><br/>1、安装<br/>yum install -y ppp<br/><br/>2、服务器配置<br/>&nbsp;&nbsp;1、配置内核转发<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vi /etc/sysctl.conf <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ip_forword=1<br/><br/>&nbsp;&nbsp; 2、pptpd.conf配置<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[pptpd.conf]<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ppp /usr/sbin/pppd<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option /etc/ppp/options.pptpd<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;connections 10&nbsp;&nbsp;&nbsp;&nbsp; #最大连接数<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;localip xx.xx.xx.xx&nbsp;&nbsp;#本机ip，如有外网ip直接配置外网ip<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;remoteip 192.168.99.234-240&nbsp;&nbsp; #连接后分配的ip<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;netmask 255.255.255.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#分配的子网掩码<br/>&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp; 3、options.pptpd配置<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name pptpd<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; refuse-pap<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; refuse-chap<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; refuse-mschap<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxyarp<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lock<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nobsdcomp<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; novj<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; novjccomp<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nologfd<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; idle 2592000<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ms-dns 114.114.114.114<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ms-dns 8.8.8.8<br/>&nbsp;&nbsp;&nbsp;&nbsp;4、防火墙配置<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iptables -A INPUT -p gre -j ACCEPT<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iptables -A INPUT -p tcp -m tcp --dport 1723 -j ACCEPT<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iptables -A FORWARD -s 192.168.99.0/24 -o eth1 -j ACCEPT<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iptables -A FORWARD -d 192.168.99.0/24 -i eth1 -j ACCEPT<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iptables -t nat -A POSTROUTING -s 192.168.99.0/24 -o eth1 -j MASQUERADE<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iptables -A FORWARD -i ppp -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j TCPMSS --set-mss 135 <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iptables -A FORWARD -s 192.168.99.0/255.255.255.0 -p udp -m udp --dport 53 -j ACCEPT <br/>3、客户端配置<br/><a href="https://www.cnmysql.com/attachment.php?fid=44" target="_blank"><img src="https://www.cnmysql.com/attachment.php?fid=44" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/><br/></span><br/></span>
]]>
</description>
</item><item>
<link>https://www.cnmysql.com/post/136/</link>
<title><![CDATA[git使用]]></title> 
<author>kangyang &lt;kangyang315@qq.com&gt;</author>
<category><![CDATA[LINUX系统管理]]></category>
<pubDate>Mon, 05 Jan 2015 07:30:34 +0000</pubDate> 
<guid>https://www.cnmysql.com/post/136/</guid> 
<description>
<![CDATA[ 
	<span style="font-family: 宋体;"><span style="font-size: 12px;"><br/>Git 是一个很强大的分布式版本控制系统。它不但适用于管理大型开源软件的源代码，管理私人的文档和源代码也有很多优势。<br/>　　本来想着只把最有用、最常用的 Git 命令记下来，但是总觉得这个也挺有用、那个也用得着，结果越记越多。<br/><a href="https://www.cnmysql.com/attachment.php?fid=43" target="_blank"><img src="https://www.cnmysql.com/attachment.php?fid=43" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/></span><br/></span><br/>Tags - <a href="https://www.cnmysql.com/tags/git/" rel="tag">git</a>
]]>
</description>
</item><item>
<link>https://www.cnmysql.com/post/134/</link>
<title><![CDATA[Supervisor进程管理工具]]></title> 
<author>kangyang &lt;kangyang315@qq.com&gt;</author>
<category><![CDATA[LINUX系统管理]]></category>
<pubDate>Mon, 05 Jan 2015 07:24:03 +0000</pubDate> 
<guid>https://www.cnmysql.com/post/134/</guid> 
<description>
<![CDATA[ 
	<span style="font-family: 宋体;"><span style="font-size: 12px;"><br/>之前研究docker，希望docker里面的应用挂了自动拉起，看到Supervisor很适合，现在线上已采用。而且通过Supervisor可以实现在docker容器里面启动N个进程。<br/><br/>Supervisor是一个C/S系统,它可以在类UNIX系统上控制系统进程，由python编写，它提供了大量的功能来实现对进程的管理。<br/>程序的多进程启动，可以配置同时启动的进程数，而不需要一个个启动<br/>程序的退出码，可以根据程序的退出码来判断是否需要自动重启<br/>程序所产生日志的处理<br/>进程初始化的环境，包括目录，用户，umask，关闭进程所需要的信号等等<br/>手动管理进程(开始，启动，重启，查看进程状态)的web界面，和xmlrpc接口<br/>支持的平台<br/><br/>可以运行在大多数类UNIX系统上，比如Linux、MAC OS X、Solaris、FreeBSD。<br/>不支持任何版本的Windows。<br/>支持Python2.4以及之后的版本，但不支持Python3。<br/><br/>安装（centos 6.5 ）<br/>rpm -ivh <a href="http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm" target="_blank">http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm</a><br/>rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6<br/>yum install supervisor<br/><br/>启动：/usr/bin/supervisord<br/>可以写到rc.local里面实现开机启动<br/><br/>以redis为例，配置文件如下：redis必须以前台运行方式<br/>[supervisord]<br/>logfile=/var/log/supervisor/supervisord.log ; 定义supervisord日志文件<br/>logfile_maxbytes=50MB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 日志大小<br/>logfile_backups=10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 日志个数<br/>loglevel=info&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 日志等级<br/>pidfile=/var/run/supervisord.pid ;pid路径<br/>nodaemon=false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;；是否以daemon模式启动<br/><br/>[program:redis]<br/>command=/usr/local/redis/bin/redis-server /etc/redis.conf&nbsp;&nbsp; ；redis启动命令<br/>log_stdout=true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; if true, log program stdout (default true)<br/>log_stderr=true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; if true, log program stderr (def false)<br/>logfile=/var/log/redis.log&nbsp;&nbsp;；redis日志<br/>logfile_maxbytes=102400MB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; max # logfile bytes b4 rotation (default 50MB)<br/>logfile_backups=10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; # of logfile backups (default 10)<br/>logfile_maxbytes=50MB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; (max main logfile bytes b4 rotation;default 50MB)<br/>logfile_backups=10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; (num of main logfile rotation backups;default 10)<br/>loglevel=info&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; (logging level;default info; others: debug,warn)<br/>pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)<br/>minfds=1024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; (min. avail startup file descriptors;default 1024)<br/>minprocs=200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; (min. avail process descriptors;default 200)<br/>nodaemon=false<br/><br/>supervisor配置文件详解<br/><br/>; Sample supervisor config file.<br/>;<br/>; For more information on the config file, please see:<br/>; <a href="http://supervisord.org/configuration.html" target="_blank">http://supervisord.org/configuration.html</a><br/>;<br/>; Note: shell expansion ("~" or "$HOME") is not supported.&nbsp;&nbsp;Environment<br/>; variables can be expanded using this syntax: "%(ENV_HOME)s".<br/><br/>[unix_http_server]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; supervisord的unix socket服务配置<br/>file=/tmp/supervisor.sock&nbsp;&nbsp; ; socket文件的保存目录<br/>;chmod=0700&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; socket的文件权限 (default 0700)<br/>;chown=nobody:nogroup&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; socket的拥有者和组名<br/>;username=user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 默认不需要登陆用户 (open server)<br/>;password=123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 默认不需要登陆密码 (open server)<br/><br/>;[inet_http_server]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; supervisord的tcp服务配置<br/>;port=127.0.0.1:9001&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; tcp端口<br/>;username=user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; tcp登陆用户<br/>;password=123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; tcp登陆密码<br/><br/>[supervisord]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; supervisord的主进程配置<br/>logfile=/tmp/supervisord.log ; 主要的进程日志配置<br/>logfile_maxbytes=50MB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 最大日志体积，默认50MB<br/>logfile_backups=10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 日志文件备份数目，默认10<br/>loglevel=info&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 日志级别，默认info; 还有:debug,warn,trace<br/>pidfile=/tmp/supervisord.pid ; supervisord的pidfile文件<br/>nodaemon=false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 是否以守护进程的方式启动<br/>minfds=1024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 最小的有效文件描述符，默认1024<br/>minprocs=200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 最小的有效进程描述符，默认200<br/>;umask=022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 进程文件的umask，默认200<br/>;user=chrism&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 默认为当前用户，如果为root则必填<br/>;identifier=supervisor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; supervisord的表示符, 默认时'supervisor'<br/>;directory=/tmp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 默认不cd到当前目录<br/>;nocleanup=true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 不在启动的时候清除临时文件，默认false<br/>;childlogdir=/tmp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; ('AUTO' child log dir, default $TEMP)<br/>;environment=KEY=value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 初始键值对传递给进程<br/>;strip_ansi=false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; (strip ansi escape codes in logs; def. false)<br/><br/>; the below section must remain in the config file for RPC<br/>; (supervisorctl/web interface) to work, additional interfaces may be<br/>; added by defining them in separate rpcinterface: sections<br/>[rpcinterface:supervisor]<br/>supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface<br/><br/>[supervisorctl]<br/>serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL&nbsp;&nbsp;for a unix socket<br/>;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket<br/>;username=chris&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 如果设置应该与http_username相同<br/>;password=123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 如果设置应该与http_password相同<br/>;prompt=mysupervisor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 命令行提示符，默认"supervisor"<br/>;history_file=~/.sc_history&nbsp;&nbsp;; 命令行历史纪录<br/><br/>; The below sample program section shows all possible program subsection values,<br/>; create one or more 'real' program: sections to be able to control them under<br/>; supervisor.<br/><br/>;[program:theprogramname]<br/>;command=/bin/cat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 运行的程序 (相对使用PATH路径, 可以使用参数)<br/>;process_name=%(program_name)s ; 进程名表达式，默认为%(program_name)s<br/>;numprocs=1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 默认启动的进程数目，默认为1<br/>;directory=/tmp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 在运行前cwd到指定的目录，默认不执行cmd<br/>;umask=022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 进程umask，默认None<br/>;priority=999&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 程序运行的优先级，默认999<br/>;autostart=true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 默认随supervisord自动启动，默认true<br/>;autorestart=unexpected&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; whether/when to restart (default: unexpected)<br/>;startsecs=1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; number of secs prog must stay running (def. 1)<br/>;startretries=3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; max # of serial start failures (default 3)<br/>;exitcodes=0,2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 期望的退出码，默认0,2<br/>;stopsignal=QUIT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 杀死进程的信号，默认TERM<br/>;stopwaitsecs=10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; max num secs to wait b4 SIGKILL (default 10)<br/>;stopasgroup=false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 向unix进程组发送停止信号，默认false<br/>;killasgroup=false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 向unix进程组发送SIGKILL信号，默认false<br/>;user=chrism&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 为运行程序的unix帐号设置setuid<br/>;redirect_stderr=true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 将标准错误重定向到标准输出，默认false<br/>;stdout_logfile=/a/path&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 标准输出的文件路径NONE＝none;默认AUTO<br/>;stdout_logfile_maxbytes=1MB&nbsp;&nbsp; ; max # logfile bytes b4 rotation (default 50MB)<br/>;stdout_logfile_backups=10&nbsp;&nbsp;&nbsp;&nbsp; ; # of stdout logfile backups (default 10)<br/>;stdout_capture_maxbytes=1MB&nbsp;&nbsp; ; number of bytes in 'capturemode' (default 0)<br/>;stdout_events_enabled=false&nbsp;&nbsp; ; emit events on stdout writes (default false)<br/>;stderr_logfile=/a/path&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; stderr log path, NONE for none; default AUTO<br/>;stderr_logfile_maxbytes=1MB&nbsp;&nbsp; ; max # logfile bytes b4 rotation (default 50MB)<br/>;stderr_logfile_backups=10&nbsp;&nbsp;&nbsp;&nbsp; ; # of stderr logfile backups (default 10)<br/>;stderr_capture_maxbytes=1MB&nbsp;&nbsp; ; number of bytes in 'capturemode' (default 0)<br/>;stderr_events_enabled=false&nbsp;&nbsp; ; emit events on stderr writes (default false)<br/>;environment=A=1,B=2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; process environment additions (def no adds)<br/>;serverurl=AUTO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; override serverurl computation (childutils)<br/><br/>; The below sample eventlistener section shows all possible<br/>; eventlistener subsection values, create one or more 'real'<br/>; eventlistener: sections to be able to handle event notifications<br/>; sent by supervisor.<br/><br/>;[eventlistener:theeventlistenername]<br/>;command=/bin/eventlistener&nbsp;&nbsp;&nbsp;&nbsp;; 运行的程序 (相对使用PATH路径, 可以使用参数)<br/>;process_name=%(program_name)s ; 进程名表达式，默认为%(program_name)s<br/>;numprocs=1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 默认启动的进程数目，默认为1<br/>;events=EVENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; event notif. types to subscribe to (req'd)<br/>;buffer_size=10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 事件缓冲区队列大小，默认10<br/>;directory=/tmp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 在运行前cwd到指定的目录，默认不执行cmd<br/>;umask=022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 进程umask，默认None<br/>;priority=-1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 程序运行的优先级，默认-1<br/>;autostart=true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 默认随supervisord自动启动，默认true<br/>;autorestart=unexpected&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; whether/when to restart (default: unexpected)<br/>;startsecs=1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; number of secs prog must stay running (def. 1)<br/>;startretries=3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; max # of serial start failures (default 3)<br/>;exitcodes=0,2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 期望的退出码，默认0,2<br/>;stopsignal=QUIT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 杀死进程的信号，默认TERM<br/>;stopwaitsecs=10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; max num secs to wait b4 SIGKILL (default 10)<br/>;stopasgroup=false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 向unix进程组发送停止信号，默认false<br/>;killasgroup=false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; 向unix进程组发送SIGKILL信号，默认false<br/>;user=chrism&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; setuid to this UNIX account to run the program<br/>;redirect_stderr=true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; redirect proc stderr to stdout (default false)<br/>;stdout_logfile=/a/path&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; stdout log path, NONE for none; default AUTO<br/>;stdout_logfile_maxbytes=1MB&nbsp;&nbsp; ; max # logfile bytes b4 rotation (default 50MB)<br/>;stdout_logfile_backups=10&nbsp;&nbsp;&nbsp;&nbsp; ; # of stdout logfile backups (default 10)<br/>;stdout_events_enabled=false&nbsp;&nbsp; ; emit events on stdout writes (default false)<br/>;stderr_logfile=/a/path&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; stderr log path, NONE for none; default AUTO<br/>;stderr_logfile_maxbytes=1MB&nbsp;&nbsp; ; max # logfile bytes b4 rotation (default 50MB)<br/>;stderr_logfile_backups&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; # of stderr logfile backups (default 10)<br/>;stderr_events_enabled=false&nbsp;&nbsp; ; emit events on stderr writes (default false)<br/>;environment=A=1,B=2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; process environment additions<br/>;serverurl=AUTO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; override serverurl computation (childutils)<br/><br/>; The below sample group section shows all possible group values,<br/>; create one or more 'real' group: sections to create "heterogeneous"<br/>; process groups.<br/><br/>;[group:thegroupname]<br/>;programs=progname1,progname2&nbsp;&nbsp;; 任何在[program:x]中定义的x<br/>;priority=999&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; 程序运行的优先级，默认999<br/><br/>; The [include] section can just contain the "files" setting.&nbsp;&nbsp;This<br/>; setting can list multiple files (separated by whitespace or<br/>; newlines).&nbsp;&nbsp;It can also contain wildcards.&nbsp;&nbsp;The filenames are<br/>; interpreted as relative to this file.&nbsp;&nbsp;Included files *cannot*<br/>; include files themselves.<br/><br/>;[include]<br/>;files = relative/directory/*.ini<br/><br/><br/>参考：<br/><a href="http://ilvsx.im/index.php/archives/32/" target="_blank">http://ilvsx.im/index.php/archives/32/</a><br/></span><br/></span><br/>Tags - <a href="https://www.cnmysql.com/tags/supervisor/" rel="tag">supervisor</a> , <a href="https://www.cnmysql.com/tags/%25E8%25BF%259B%25E7%25A8%258B/" rel="tag">进程</a> , <a href="https://www.cnmysql.com/tags/%25E5%25B7%25A5%25E5%2585%25B7/" rel="tag">工具</a>
]]>
</description>
</item><item>
<link>https://www.cnmysql.com/post/127/</link>
<title><![CDATA[glances--Linux系统资源监控工具]]></title> 
<author>kangyang &lt;kangyang315@qq.com&gt;</author>
<category><![CDATA[LINUX系统管理]]></category>
<pubDate>Mon, 15 Sep 2014 08:49:09 +0000</pubDate> 
<guid>https://www.cnmysql.com/post/127/</guid> 
<description>
<![CDATA[ 
	<span style="font-family: 宋体;"><span style="font-size: 12px;"><br/>glances 是一款用于 Linux、BSD 的开源命令行系统监视工具，它使用 Python 语言开发，能够监视 CPU、负载、内存、磁盘 I/O、网络流量、文件系统、系统温度等信息。<br/>glances 可以为 Unix 和 Linux 性能专家提供监视和分析性能数据的功能，其中包括：<br/><div class="code">CPU 使用率<br/>内存使用情况<br/>内核统计信息和运行队列信息<br/>磁盘 I/O 速度、传输和读/写比率<br/>文件系统中的可用空间<br/>磁盘适配器<br/>网络 I/O 速度、传输和读/写比率<br/>页面空间和页面速度<br/>消耗资源最多的进程<br/>计算机信息和系统资源</div><br/>glances 工具还可以将相同的数据捕获到一个文件，便于以后对报告进行分析和绘制图形。输出文件可以是电子表格的格式 (.csv) 或者 html 格式。<br/>glances 是一个命令行工具包括如下命令选项：<br/><div class="code">-b：显示网络连接速度 Byte/ 秒<br/>-B @IP&#124;host ：绑定服务器端 IP 地址或者主机名称<br/>-c @IP&#124;host：连接 glances 服务器端<br/>-C file：设置配置文件默认是 /etc/glances/glances.conf<br/>-d：关闭磁盘 I/O 模块<br/>-e：显示传感器温度<br/>-f file：设置输出文件（格式是 HTML 或者 CSV）<br/>-m：关闭挂载的磁盘模块<br/>-n：关闭网络模块<br/>-p PORT：设置运行端口默认是 61209<br/>-P password：设置客户端 / 服务器密码<br/>-s：设置 glances 运行模式为服务器<br/>-t sec：设置屏幕刷新的时间间隔，单位为秒，默认值为 2 秒，数值许可范围：1~32767<br/>-h : 显示帮助信息<br/>-v : 显示版本信息</div><br/>安装方式：<br/>Glance 支持 Linux, Mac OS X, FreeBSD, Windows 等多个系统，安装也很方便。在 Ubuntu 上安装：<br/><div class="code">$ sudo apt-get update<br/>$ sudo apt-get install python-pip build-essential python-dev<br/>$ sudo pip install glances</div><br/>在 CentOS 6.x 上安装：<br/><div class="code">$ su root<br/># rpm -ivh http://fr2.rpmfind.net/linux/epel/6/x86_64/epel-release-6-7.noarch.rpm<br/># yum install python-pip python-devel<br/># pip-python install glances</div><br/>在 FreeBSD 上安装：<br/><div class="code"># pkg_add -r py27-glances<br/>或者<br/># cd /usr/ports/sysutils/py-glances/<br/># make install clean</div><br/></span><br/></span><br/>Tags - <a href="https://www.cnmysql.com/tags/glances/" rel="tag">glances</a>
]]>
</description>
</item>
</channel>
</rss>