用PCS建立WEB集群,一直不生效怎么解决!

简介: 本篇内容记录了如何解决用PCS建立WEB集群,一直不生效的问题。

心累,耗了我2天时间才解决。


[root@rs1 ~]# pcs resource create Website ocf💓apache
configfile=/etc/httpd/conf/httpd.conf
statusurl=“http://localhost/server-status” \ op monitor interval=1min
[root@rs1 ~]# pcs status Cluster name: cluster1 Stack: corosync
Current DC: rs1 (version 1.1.20-5.el7-3c4c782f70) - partition with
quorum Last updated: Sat May 9 02:29:59 2020 Last change: Sat May 9
02:28:36 2020 by root via cibadmin on rs1
2 nodes configured 2 resources configured
Online: [ rs1 rs2 ]
Full list of resources:
VirtualIP (ocf:💓IPaddr2): Started rs1 Website
(ocf:💓apache): Stopped
Failed Resource Actions:
• Website_start_0 o n rs1 ‘unknown error’ (1): call=19, status=Timed Out, exitreason=’’,
      last-rc-change=‘Sat May 9 02:29:17 2020’, queued=0ms, exec=40004ms
• Website_start_0 on rs2 ‘unknown error’ (1): call=14, status=Timed Out, exitreason=’’,
     last-rc-change=‘Sat May 9 02:28:36 2020’, queued=0ms, exec=40006ms
Daemon Status: corosync: active/disabled pacemaker:
active/disabled pcsd: active/enabled


在放个日志文件


May  9 02:29:48 b apache(Website)[12391]: INFO: waiting for apache /etc/httpd/conf/httpd.conf to come up
May  9 02:29:49 b apache(Website)[12391]: INFO: apache not running
May  9 02:29:49 b apache(Website)[12391]: INFO: waiting for apache /etc/httpd/conf/httpd.conf to come up
May  9 02:29:50 b apache(Website)[12391]: INFO: apache not running
May  9 02:29:50 b apache(Website)[12391]: INFO: waiting for apache /etc/httpd/conf/httpd.conf to come up
May  9 02:29:51 b apache(Website)[12391]: INFO: apache not running
May  9 02:29:51 b apache(Website)[12391]: INFO: waiting for apache /etc/httpd/conf/httpd.conf to come up
May  9 02:29:52 b apache(Website)[12391]: INFO: apache not running
May  9 02:29:52 b apache(Website)[12391]: INFO: waiting for apache /etc/httpd/conf/httpd.conf to come up
May  9 02:29:53 b apache(Website)[12391]: INFO: apache not running
May  9 02:29:53 b apache(Website)[12391]: INFO: waiting for apache /etc/httpd/conf/httpd.conf to come up
May  9 02:29:54 b apache(Website)[12391]: INFO: apache not running
May  9 02:29:54 b apache(Website)[12391]: INFO: waiting for apache /etc/httpd/conf/httpd.conf to come up
May  9 02:29:55 b apache(Website)[12391]: INFO: apache not running
May  9 02:29:55 b apache(Website)[12391]: INFO: waiting for apache /etc/httpd/conf/httpd.conf to come up
May  9 02:29:56 b apache(Website)[12391]: INFO: apache not running
May  9 02:29:56 b apache(Website)[12391]: INFO: waiting for apache /etc/httpd/conf/httpd.conf to come up
May  9 02:29:57 b lrmd[9228]: warning: Website_start_0 process (PID 12391) timed out
May  9 02:29:57 b lrmd[9228]: warning: Website_start_0:12391 - timed out after 40000ms
May  9 02:29:57 b crmd[9231]:   error: Result of start operation for Website on rs1: Timed Out
May  9 02:29:57 b crmd[9231]: warning: Action 5 (Website_start_0) on rs1 failed (target: 0 vs. rc: 1): Error
May  9 02:29:57 b crmd[9231]:  notice: Transition aborted by operation Website_start_0 'modify' on rs1: Event failed
May  9 02:29:57 b crmd[9231]:  notice: Transition 16 (Complete=2, Pending=0, Fired=0, Skipped=0, Incomplete=1, Source=/var/lib/pacemaker/pengine/pe-input-16.bz2): Complete
May  9 02:29:57 b pengine[9230]: warning: Processing failed start of Website on rs1: unknown error
May  9 02:29:57 b pengine[9230]: warning: Processing failed start of Website on rs1: unknown error
May  9 02:29:57 b pengine[9230]: warning: Processing failed start of Website on rs2: unknown error
May  9 02:29:57 b pengine[9230]: warning: Forcing Website away from rs1 after 1000000 failures (max=1000000)
May  9 02:29:57 b pengine[9230]: warning: Forcing Website away from rs2 after 1000000 failures (max=1000000)
May  9 02:29:57 b pengine[9230]:  notice:  * Stop       Website       (        rs1 )   due to node availability
May  9 02:29:57 b pengine[9230]:  notice: Calculated transition 17, saving inputs in /var/lib/pacemaker/pengine/pe-input-17.bz2


解决方案:


重新创建web集群


[root@rs1 html]# pcs resource create Wbsite ocf:heartbeat:apache 
httpd="/usr/sbin/httpd" \
configfile=/etc/httpd/conf/httpd.conf  \
statusurl="http://localhost/server-status" \
op monitor interval=1min
可以看出我在原来的基础上加了一个httpd="/usr/sbin/httpd" \,也就是httpd命令的位置,看结果:
[root@rs1 html]# pcs status
Cluster name: cluster1
Stack: corosync
Current DC: rs1 (version 1.1.20-5.el7-3c4c782f70) - partition with quorum
Last updated: Sat May  9 03:33:01 2020
Last change: Sat May  9 03:21:45 2020 by root via cibadmin on rs1
2 nodes configured
3 resources configured
Online: [ rs1 rs2 ]
Full list of resources:
 VirtualIP  (ocf::heartbeat:IPaddr2): Started rs1
 WebFS  (ocf::heartbeat:Filesystem):  Started rs1
 Wbsite (ocf::heartbeat:apache):  Started rs1
Daemon Status:
  corosync: active/disabled
  pacemaker: active/disabled
  pcsd: active/enabled


解决了!

相关文章
|
Java 应用服务中间件 Shell
Nginx+Keepalived+Tomcat 实现Web高可用集群
Nginx+Keepalived+Tomcat 实现Web高可用集群
664 0
|
前端开发 数据库 Python
使用 Python 的 Web 框架(如 Django 或 Flask)来建立后端接口,用于处理用户的请求,从数据库中查找答案并返回给前端界面
【1月更文挑战第13天】使用 Python 的 Web 框架(如 Django 或 Flask)来建立后端接口,用于处理用户的请求,从数据库中查找答案并返回给前端界面
812 7
|
运维 关系型数据库 MySQL
【运维知识进阶篇】集群架构-Nginx实现基础web架构(Linux+Nginx+PHP+Mysql)(二)
【运维知识进阶篇】集群架构-Nginx实现基础web架构(Linux+Nginx+PHP+Mysql)(二)
533 0
|
Go
Go http包建立Web服务器
Go http包建立Web服务器
320 0
|
负载均衡 算法 应用服务中间件
负载均衡技术在Web服务器集群中的应用
【8月更文第28天】随着互联网的发展和用户对Web服务需求的增长,单台服务器很难满足大规模访问的需求。为了提高系统的稳定性和扩展性,通常会采用Web服务器集群的方式。在这种架构中,负载均衡器扮演着至关重要的角色,它能够合理地分配客户端请求到不同的后端服务器上,从而实现资源的最优利用。
687 2
|
负载均衡 监控 算法
百度搜索:蓝易云【HAProxy搭建web集群教程。】
这是一个简单的HAProxy搭建Web集群的教程。在实际应用中,还可以进行更多的配置和优化,以满足你的需求。建议在搭建之前查阅官方文档或参考其他详细的教程以获取更全面的指导。
347 3
百度搜索:蓝易云【HAProxy搭建web集群教程。】
|
弹性计算 Kubernetes 索引
使用Kubectl部署web服务到K8s集群
本场景带您体验如何使用k8s的原生命令kubectl部署一个web应用(魔方应用)的镜像到k8s集群中,并通过Ingress将部署的服务暴露出来由外部访问。
|
弹性计算 Kubernetes 容器
使用Kubectl部署web服务到K8s集群
本次基于阿里云实验室提供的实验环境,使用预创建好的创建云服务器ECS和ACK集群资源,实现通过Kubectl部署web服务到K8s集群。
|
弹性计算 Kubernetes Cloud Native
容器实验班开课!30 分钟学会使用 Kubectl 部署 web 服务到 K8s 集群
容器实验班开课!30 分钟学会使用 Kubectl 部署 web 服务到 K8s 集群
容器实验班开课!30 分钟学会使用 Kubectl 部署 web 服务到 K8s 集群
|
弹性计算 Kubernetes 容器
使用Kubectl部署web服务到K8s集群-3
使用Kubectl部署web服务到K8s集群-3
447 0
使用Kubectl部署web服务到K8s集群-3