linux 基础运维

1..Supervisor

一个进程监控程序两个命令:
supervisord : supervisor的服务器端部分
supervisorctl:启动supervisor的命令行窗口

需求:
redis-server这个进程是运行redis的服务。我们要求这个服务能在意外停止后自动重启。

#安装(Centos):
yum install python-setuptools
easy_install supervisor

#修改配置文件 /etc/supervisord.conf:
#在supervisord.conf最后增加:

[program:redis]
command = redis-server   //需要执行的命令
autostart=true    //supervisor启动的时候是否随着同时启动
autorestart=true   //当程序跑出exit的时候,自动重启
startsecs=3  //程序重启时候停留在runing状态的秒数
(更多配置说明请参考:http://supervisord.org/configuration.html)

运行命令:
supervisord //启动supervisor
supervisorctl //打开命令行
redis RUNNING pid 24068, uptime 3:41:55
ctl中: help //查看命令
ctl中: status //查看状态
遇到的问题:
1). redis出现的不是running而是FATAL 状态
应该要去查看log
log在/tmp/supervisord.log
2). 日志中显示:
gave up: redis entered FATAL state, too many start retries too quickly
修改redis.conf的daemonize为no
具体说明:http://xingqiba.sinaapp.com/?p=240


2.git

error: The requested URL returned error: 403 Forbidden while accessing

vi .git/config
https://github.com/iopqrst/learn20140823.git/info/refs
[remote "origin"]  
    url = https://github.com/iopqrst/learn20140823.git
修改为:
[remote "origin"]
url = https://iopqrst@github.com/iopqrst/learn20140823.git

你可能感兴趣的:(linux运维)