如何解决Keepalived日志里报的这个错误

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何解决Keepalived日志里报的这个错误相关的知识,希望对你有一定的参考价值。

参考技术A Keepalived默认所有的日志都是写入到/var/log/message下的,由于message的日志太多了,而Keepalived的日志又很难分离出来,所以本文提供了一个调整Keepalived日志输出路径的方法。具体操作步骤如下:一、修改 /etc/sysconfig/keepalived把KEEPALIVED_OPTIONS="-D" 修改为KEEPALIVED_OPTIONS="-D -d -S 0"#其中-S指定syslog的facility二、重启服务service keepalived restart三、设置syslog,修改/etc/syslog.conf,添加内容如下# keepalived -S 0 local0.* /var/log/keepalived.log注意:local0是l是字符L的小写四、Keepalived相关管理的知识拓展/usr/local/keepalived/sbin/keepalived --vrrp -P Only run with VRRP subsystem. /usr/local/keepalived/sbin/keepalived --check -C Only run with Health-checker subsystem. /usr/local/keepalived/sbin/keepalived --dont-release-vrrp -V Dont remove VRRP VIPs & VROUTEs on daemon stop. /usr/local/keepalived/sbin/keepalived --dont-release-ipvs -I Dont remove IPVS topology on daemon stop. /usr/local/keepalived/sbin/keepalived --dont-fork -n Dont fork the daemon process. /usr/local/keepalived/sbin/keepalived --use-file -f Use the specified configuration file. Default is /etc/keepalived/keepalived.conf. /usr/local/keepalived/sbin/keepalived --dump-conf -d Dump the configuration data. /usr/local/keepalived/sbin/keepalived --log-console -l Log message to local console. /usr/local/keepalived/sbin/keepalived --log-detail -D Detailed log messages. /usr/local/keepalived/sbin/keepalived --log-facility -S 0-7 Set syslog facility to LOG_LOCAL[0-7]. (default=LOG_DAEMON) /usr/local/keepalived/sbin/keepalived --help -h Display this short inlined help screen. /usr/local/keepalived/sbin/keepalived --version -v Display the version number /usr/local/keepalived/sbin/keepalived --pid -p pidfile /usr/local/keepalived/sbin/keepalived --checkers_pid -c checkers pidfile /usr/local/keepalived/sbin/keepalived --vrrp_pid -r vrrp pidfile

Thinkphp+Nginx(PHPstudy)下报的404错误解决

最近一个TP5的项目说放到Nginx下测试看看,下载个 PHPstudy,放到WWW下,配置好域名,直接给个报个404;

解决方法:

1.先在phpstudy下配置好域名目录指向项目下的public下;

2.复制下面这段代码放进nginx/conf/vhost文件里:

location / {
   index index.html index.htm index.php;
        #autoindex on;
       if (!-e $request_filename) {
       rewrite ^(.*)$ /index.php?s=/$1 last;
       break;
    }
}

代码截图如下:

3.重新启动nginx即可,上面这段代码在TP5手册的部署里也有提到;

4.上面红色是的什么呢;

  当访问该网站的时,nginx 会按照 index.html,index.htm ,index.php 的先后顺序在根目录中查找文件。如果这三个文件都不存在,那么nginx就会返回403 Forbidden。

  所以,在vhost里没有这段内容直接输入域名访问就会报403的错误,除非你在域名后面加个 /index.php才可以正常访问;

以上是关于如何解决Keepalived日志里报的这个错误的主要内容,如果未能解决你的问题,请参考以下文章

关于致命错误28000: 角色 “Administrator“ 不存在的问题解决

关于致命错误28000: 角色 “Administrator“ 不存在的问题解决

迁移设备存储报的错误及解决方式

eclipse从SVN导出项目总是报错

MHA+keepalived(补充)

请问各位大师:spring mvc中下面报的这个错是啥原因?应该如何解决?