分类 "Linux" 下的文章

问题:使用supervisord管理rq队列进程时,启动不起来,报FATAL      Exited too quickly (process log may have details)的错误
解决:配置文件出错
方法:
一、在配置文件中添加redirect_stderr=true,将错误信息重定向到日志文件中
二、此时会发现报错RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment.等等信息,这是因为使用python3的原因,导致编码出现问题
在配置文件中添加environment=LC_ALL="C.UTF-8",LANG="C.UTF-8"

下面是我的最终配置文件
[program:rq]
user=qingcheng
command=/alidata/www/dongman/website/.venv/bin/rqworker --path /alidata/www/dongman/website/jobs
redirect_stderr=true
stdout_logfile=/alidata/www/dongman/website/logs/rq_stdout.log
environment=LC_ALL="C.UTF-8",LANG="C.UTF-8"

问题:由于ubuntu服务器时间与北京时间不同步,导致出错,需要将服务器时间进行同步
解决:使用ntpdate命令
方法:
一、查看时间:date
二、更改时间:sudo ntpdate -u ntp.api.bz
三、查看更改后的时间:date

注:ntp常用服务器:
中国国家授时中心:210.72.145.44(本人测试,此服务器不行)
NTP服务器(上海) :ntp.api.bz
参考:http://blog.csdn.net/bbirdsky/article/details/20445385

如果上面方法仍不行,报错no server suitable for synchronization found,那就用rdate吧
rdate -s time-b.nist.gov
当然先前需要sudo apt-get install rdate