create resources on cluster like floating_ip server-status httpd nginx with Configured Constraints
[root@controller ~]# pcs property set stonith-enabled=false
[root@controller ~]# pcs property set no-quorum-policy=ignore
[root@controller ~]# pcs property list
Cluster Properties:
cluster-infrastructure: corosync
cluster-name: cluster
dc-version: 1.1.20-5.el7_7.1-3c4c782f70
have-watchdog: false
no-quorum-policy: ignore
stonith-enabled: false
[root@controller ~]# pcs resource create floating_ip ocf:heartbeat:IPaddr2 ip=192.168.10.20 cidr_netmask=24 op monitor interval=60s
[root@controller ~]# pcs resource create http_server ocf:heartbeat:apache configfile="/etc/httpd/conf/httpd.conf" op monitor timeout="20s" interval="60s"
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Stopped
http_server (ocf::heartbeat:apache): Started controller
[root@controller ~]# firewall-cmd --permanent --add-service=http
success
[root@controller ~]# firewall-cmd --permanent --add-service=http ; firewall-cmd --reload
Warning: ALREADY_ENABLED: http
success
success
[root@controller ~]# service httpd status
Redirecting to /bin/systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2019-10-09 17:06:50 IST; 5h 39min ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 1446 (httpd)
Status: "Total requests: 90; Current requests/sec: 0.2; Current traffic: 512 B/sec"
Tasks: 33
CGroup: /system.slice/httpd.service
├─1446 /usr/sbin/httpd -DFOREGROUND
├─1870 aodh_wsgi -DFOREGROUND
├─1871 gnocchi_wsgi -DFOREGROUND
├─1872 keystone -DFOREGROUND
├─1873 placement_wsgi -DFOREGROUND
├─1874 horizon -DFOREGROUND
├─1875 horizon -DFOREGROUND
├─1901 /usr/sbin/httpd -DFOREGROUND
├─1902 /usr/sbin/httpd -DFOREGROUND
├─1903 /usr/sbin/httpd -DFOREGROUND
├─1904 /usr/sbin/httpd -DFOREGROUND
├─1905 /usr/sbin/httpd -DFOREGROUND
├─1906 /usr/sbin/httpd -DFOREGROUND
├─1907 /usr/sbin/httpd -DFOREGROUND
└─1908 /usr/sbin/httpd -DFOREGROUND
Oct 09 17:06:27 controller httpd[1446]: [Wed Oct 09 17:06:27.230916 2019] [s...g
Oct 09 17:06:27 controller httpd[1446]: [Wed Oct 09 17:06:27.232229 2019] [s...g
Oct 09 17:06:27 controller httpd[1446]: [Wed Oct 09 17:06:27.422013 2019] [s...g
Oct 09 17:06:27 controller httpd[1446]: [Wed Oct 09 17:06:27.422672 2019] [s...g
Oct 09 17:06:30 controller httpd[1446]: [Wed Oct 09 17:06:30.984929 2019] [s...g
Oct 09 17:06:33 controller httpd[1446]: [Wed Oct 09 17:06:33.544427 2019] [s...g
Oct 09 17:06:33 controller httpd[1446]: [Wed Oct 09 17:06:33.550667 2019] [s...g
Oct 09 17:06:36 controller httpd[1446]: [Wed Oct 09 17:06:36.862303 2019] [s...g
Oct 09 17:06:42 controller httpd[1446]: [Wed Oct 09 17:06:42.884760 2019] [a....
Oct 09 17:06:50 controller systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
[root@controller ~]# firewall-cmd --list-services
ssh dhcpv6-client high-availability http
[root@controller ~]# pcs cluster stop http_server
Error: nodes 'http_server' do not appear to exist in configuration
[root@controller ~]# pcs cluster stop apache
Error: nodes 'apache' do not appear to exist in configuration
[root@controller ~]# service httpd stop
Redirecting to /bin/systemctl stop httpd.service
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Stopped
http_server (ocf::heartbeat:apache): Started controller
[root@controller ~]# pcs cluster stop http_server
Error: nodes 'http_server' do not appear to exist in configuration
[root@controller ~]# pcs cluster stop http_server^C
[root@controller ~]# pcs resource delete floating_ip
Deleting Resource - floating_ip
[root@controller ~]# pcs resource create floating_ip ocf:heartbeat:IPaddr2 ip=192.168.0.20 cidr_netmask=24 op monitor interval=60s
[root@controller ~]# pcs status resources
http_server(ocf::heartbeat:apache): Started controller
floating_ip (ocf::heartbeat:IPaddr2): Started compute
[root@controller ~]# pcs cluster stop http_server
Error: nodes 'http_server' do not appear to exist in configuration
[root@controller ~]# pcs cluster stop controller
controller: Stopping Cluster (pacemaker)...
controller: Stopping Cluster (corosync)...
[root@controller ~]# pcs status resources
Error: unable to get cluster status from crm_mon
Error: cluster is not available on this node
[root@controller ~]# pcs cluster start controller
controller: Starting Cluster (corosync)...
controller: Starting Cluster (pacemaker)...
[root@controller ~]# pcs status resources
http_server (ocf::heartbeat:apache): Starting controller
floating_ip (ocf::heartbeat:IPaddr2): Started compute
[root@controller ~]# pcs cluster disable http_server
Error: unable to disable all nodes
Unable to connect to http_server, try setting higher timeout in --request-timeout option (Could not resolve host: http_server; Unknown error)
[root@controller ~]# pcs cluster disable 192.168.0.107
192.168.0.107: Cluster Disabled
[root@controller ~]# pcs status resources
http_server (ocf::heartbeat:apache): Started controller
floating_ip (ocf::heartbeat:IPaddr2): Started compute
[root@controller ~]# pcs cluster start 192.168.0.107
192.168.0.107: Starting Cluster (corosync)...
192.168.0.107: Starting Cluster (pacemaker)...
[root@controller ~]# pcs cluster stop ocf::heartbeat:apache
Error: nodes 'ocf::heartbeat:apache' do not appear to exist in configuration
[root@controller ~]# sudo pcs cluster stop http_server
Error: nodes 'http_server' do not appear to exist in configuration
[root@controller ~]# pcs resource create http ocf:heartbeat:nginx configfile="/etc/nginx/nginx.conf" op monitor timeout="20s" interval="60s"
[root@controller ~]# pcs status resources
http_server (ocf::heartbeat:apache): Started controller
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
[root@controller ~]# sudo pcs cluster stop http
Error: nodes 'http' do not appear to exist in configuration
[root@controller ~]# sudo pcs cluster start http
http: Unable to connect to http, try setting higher timeout in --request-timeout option (Could not resolve host: http; Unknown error)
http: Not starting cluster - node is unreachable
Error: unable to start all nodes
[root@controller ~]# sudo pcs cluster start controller
controller: Starting Cluster (corosync)...
controller: Starting Cluster (pacemaker)..
.
[root@controller ~]# pcs status resources
http_server (ocf::heartbeat:apache): Started controller
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
[root@controller ~]# pcs resource delete http_server
Attempting to stop: http_server... Stopped
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
[root@controller ~]# pcs resource create WebSite ocf:heartbeat:apache configfile=/etc/httpd/conf/httpd.conf statusurl="http://localhost/server-status" op monitor interval=1min
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
WebSite (ocf::heartbeat:apache): Starting compute
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
WebSite (ocf::heartbeat:apache): Starting compute
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
WebSite (ocf::heartbeat:apache): Starting compute
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
WebSite (ocf::heartbeat:apache): Stopped
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
WebSite (ocf::heartbeat:apache): Stopped
[root@controller ~]# vi /etc/httpd/conf/httpd.conf
<IfModule mod_status.c>
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Allow from all
</Location>
</IfModule>
[root@controller ~]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
WebSite (ocf::heartbeat:apache): Stopped
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
WebSite (ocf::heartbeat:apache): Stopped
[root@controller ~]# crm_resource --resource floating_ip --force-stop
Operation stop for floating_ip (ocf:heartbeat:IPaddr2) returned: 'ok' (0)
> stderr: INFO: IP status = no, IP_CIP=
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
WebSite (ocf::heartbeat:apache): Stopped
[root@controller ~]# crm_resource --resource WebSite --force-start
Operation start for WebSite (ocf:heartbeat:apache) returned: 'ok' (0)
> stderr: INFO: apache already running (pid 96421)
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
WebSite (ocf::heartbeat:apache): Stopped
[root@controller ~]# crm_resource --cleanup
Cleaned up all resources on all nodes
Waiting for 4 replies from the CRMd.... OK
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
WebSite (ocf::heartbeat:apache): Started controller
[root@controller ~]# crm_resource --resource floating_ip --force-stop
Operation stop for floating_ip (ocf:heartbeat:IPaddr2) returned: 'ok' (0)
> stderr: INFO: IP status = no, IP_CIP=
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
WebSite (ocf::heartbeat:apache): Started controller
[root@controller ~]#
on controller
server-status running
on compute node
floating_ip running
192.168.0.20
https://docs.google.com/document/d/e/2PACX-1vQIra2wThKq1-4dWwq3AYPmXpkn1y2xErCykYhv5TIG1E2J9BVdWWeQ3E3vGfwDPiMtq4onXHHYo9us/pub
[root@controller ~]# crm_resource --resource http --force-start
Operation start for http (ocf:heartbeat:nginx) returned: 'not installed' (5)
> stderr: ERROR: nginx binary not found! Please verify you've installed it
[root@controller ~]# yum install nginx
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.nbrc.ac.in
* centos-gluster6: mirror.nbrc.ac.in
* centos-qemu-ev: mirror.nbrc.ac.in
* epel: mirrors.aliyun.com
* extras: mirror.nbrc.ac.in
* openstack-stein: mirror.nbrc.ac.in
* updates: mirror.nbrc.ac.in
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
--> Running transaction check
---> Package nginx.x86_64 1:1.12.2-3.el7 will be installed
--> Processing Dependency: nginx-all-modules = 1:1.12.2-3.el7 for package: 1:nginx-1.12.2-3.el7.x86_64
--> Processing Dependency: nginx-filesystem = 1:1.12.2-3.el7 for package: 1:nginx-1.12.2-3.el7.x86_64
--> Processing Dependency: nginx-filesystem for package: 1:nginx-1.12.2-3.el7.x86_64
--> Running transaction check
---> Package nginx-all-modules.noarch 1:1.12.2-3.el7 will be installed
--> Processing Dependency: nginx-mod-http-geoip = 1:1.12.2-3.el7 for package: 1:nginx-all-modules-1.12.2-3.el7.noarch
--> Processing Dependency: nginx-mod-http-image-filter = 1:1.12.2-3.el7 for package: 1:nginx-all-modules-1.12.2-3.el7.noarch
--> Processing Dependency: nginx-mod-http-perl = 1:1.12.2-3.el7 for package: 1:nginx-all-modules-1.12.2-3.el7.noarch
--> Processing Dependency: nginx-mod-http-xslt-filter = 1:1.12.2-3.el7 for package: 1:nginx-all-modules-1.12.2-3.el7.noarch
--> Processing Dependency: nginx-mod-mail = 1:1.12.2-3.el7 for package: 1:nginx-all-modules-1.12.2-3.el7.noarch
--> Processing Dependency: nginx-mod-stream = 1:1.12.2-3.el7 for package: 1:nginx-all-modules-1.12.2-3.el7.noarch
---> Package nginx-filesystem.noarch 1:1.12.2-3.el7 will be installed
--> Running transaction check
---> Package nginx-mod-http-geoip.x86_64 1:1.12.2-3.el7 will be installed
---> Package nginx-mod-http-image-filter.x86_64 1:1.12.2-3.el7 will be installed
---> Package nginx-mod-http-perl.x86_64 1:1.12.2-3.el7 will be installed
---> Package nginx-mod-http-xslt-filter.x86_64 1:1.12.2-3.el7 will be installed
---> Package nginx-mod-mail.x86_64 1:1.12.2-3.el7 will be installed
---> Package nginx-mod-stream.x86_64 1:1.12.2-3.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository
Size
================================================================================
Installing:
nginx x86_64 1:1.12.2-3.el7 epel 531 k
Installing for dependencies:
nginx-all-modules noarch 1:1.12.2-3.el7 epel 16 k
nginx-filesystem noarch 1:1.12.2-3.el7 epel 17 k
nginx-mod-http-geoip x86_64 1:1.12.2-3.el7 epel 23 k
nginx-mod-http-image-filter x86_64 1:1.12.2-3.el7 epel 27 k
nginx-mod-http-perl x86_64 1:1.12.2-3.el7 epel 36 k
nginx-mod-http-xslt-filter x86_64 1:1.12.2-3.el7 epel 26 k
nginx-mod-mail x86_64 1:1.12.2-3.el7 epel 54 k
nginx-mod-stream x86_64 1:1.12.2-3.el7 epel 76 k
Transaction Summary
================================================================================
Install 1 Package (+8 Dependent packages)
Total download size: 807 k
Installed size: 1.9 M
Is this ok [y/d/N]: y
Downloading packages:
nginx-mod-http-image-filter-1. FAILED
http://mirror2.totbb.net/epel/7/x86_64/Packages/n/nginx-mod-http-image-filter-1.12.2-3.el7.x86_64.rpm: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article
https://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
(1/9): nginx-1.12.2-3.el7.x86_64.rpm | 531 kB 00:57
(2/9): nginx-mod-http-xslt-filter-1.12.2-3.el7.x86_64.rpm | 26 kB 00:00
(3/9): nginx-mod-mail-1.12.2-3.el7.x86_64.rpm | 54 kB 00:09
(4/9): nginx-mod-stream-1.12.2-3.el7.x86_64.rpm | 76 kB 00:00
(5/9): nginx-filesystem-1.12.2-3.el7.noarch.rpm | 17 kB 00:41
(6/9): nginx-mod-http-image-filter-1.12.2-3.el7.x86_64.rpm | 27 kB 00:00
(7/9): nginx-mod-http-geoip-1.12.2-3.el7.x86_64.rpm | 23 kB 00:37
(8/9): nginx-all-modules-1.12.2-3.el7.noarch.rpm | 16 kB 01:08
(9/9): nginx-mod-http-perl-1.12.2-3.el7.x86_64.rpm | 36 kB 00:17
--------------------------------------------------------------------------------
Total 11 kB/s | 807 kB 01:11
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:nginx-filesystem-1.12.2-3.el7.noarch 1/9
Installing : 1:nginx-mod-http-xslt-filter-1.12.2-3.el7.x86_64 2/9
Installing : 1:nginx-mod-http-perl-1.12.2-3.el7.x86_64 3/9
Installing : 1:nginx-mod-http-image-filter-1.12.2-3.el7.x86_64 4/9
Installing : 1:nginx-mod-mail-1.12.2-3.el7.x86_64 5/9
Installing : 1:nginx-mod-stream-1.12.2-3.el7.x86_64 6/9
Installing : 1:nginx-mod-http-geoip-1.12.2-3.el7.x86_64 7/9
Installing : 1:nginx-all-modules-1.12.2-3.el7.noarch 8/9
Installing : 1:nginx-1.12.2-3.el7.x86_64 9/9
Verifying : 1:nginx-all-modules-1.12.2-3.el7.noarch 1/9
Verifying : 1:nginx-mod-http-xslt-filter-1.12.2-3.el7.x86_64 2/9
Verifying : 1:nginx-mod-http-perl-1.12.2-3.el7.x86_64 3/9
Verifying : 1:nginx-mod-http-image-filter-1.12.2-3.el7.x86_64 4/9
Verifying : 1:nginx-1.12.2-3.el7.x86_64 5/9
Verifying : 1:nginx-filesystem-1.12.2-3.el7.noarch 6/9
Verifying : 1:nginx-mod-mail-1.12.2-3.el7.x86_64 7/9
Verifying : 1:nginx-mod-stream-1.12.2-3.el7.x86_64 8/9
Verifying : 1:nginx-mod-http-geoip-1.12.2-3.el7.x86_64 9/9
Installed:
nginx.x86_64 1:1.12.2-3.el7
Dependency Installed:
nginx-all-modules.noarch 1:1.12.2-3.el7
nginx-filesystem.noarch 1:1.12.2-3.el7
nginx-mod-http-geoip.x86_64 1:1.12.2-3.el7
nginx-mod-http-image-filter.x86_64 1:1.12.2-3.el7
nginx-mod-http-perl.x86_64 1:1.12.2-3.el7
nginx-mod-http-xslt-filter.x86_64 1:1.12.2-3.el7
nginx-mod-mail.x86_64 1:1.12.2-3.el7
nginx-mod-stream.x86_64 1:1.12.2-3.el7
Complete!
[root@controller ~]# crm_resource --resource http --force-start
Operation start for http (ocf:heartbeat:nginx) returned: 'not installed' (5)
> stderr: ERROR: nginx binary not found! Please verify you've installed it
[root@controller ~]# yum install nginx
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.nbrc.ac.in
* centos-gluster6: mirror.nbrc.ac.in
* centos-qemu-ev: mirror.nbrc.ac.in
* epel: mirrors.aliyun.com
* extras: mirror.nbrc.ac.in
* openstack-stein: mirror.nbrc.ac.in
* updates: mirror.nbrc.ac.in
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
--> Running transaction check
---> Package nginx.x86_64 1:1.12.2-3.el7 will be installed
--> Processing Dependency: nginx-all-modules = 1:1.12.2-3.el7 for package: 1:nginx-1.12.2-3.el7.x86_64
--> Processing Dependency: nginx-filesystem = 1:1.12.2-3.el7 for package: 1:nginx-1.12.2-3.el7.x86_64
--> Processing Dependency: nginx-filesystem for package: 1:nginx-1.12.2-3.el7.x86_64
--> Running transaction check
---> Package nginx-all-modules.noarch 1:1.12.2-3.el7 will be installed
--> Processing Dependency: nginx-mod-http-geoip = 1:1.12.2-3.el7 for package: 1:nginx-all-modules-1.12.2-3.el7.noarch
--> Processing Dependency: nginx-mod-http-image-filter = 1:1.12.2-3.el7 for package: 1:nginx-all-modules-1.12.2-3.el7.noarch
--> Processing Dependency: nginx-mod-http-perl = 1:1.12.2-3.el7 for package: 1:nginx-all-modules-1.12.2-3.el7.noarch
--> Processing Dependency: nginx-mod-http-xslt-filter = 1:1.12.2-3.el7 for package: 1:nginx-all-modules-1.12.2-3.el7.noarch
--> Processing Dependency: nginx-mod-mail = 1:1.12.2-3.el7 for package: 1:nginx-all-modules-1.12.2-3.el7.noarch
--> Processing Dependency: nginx-mod-stream = 1:1.12.2-3.el7 for package: 1:nginx-all-modules-1.12.2-3.el7.noarch
---> Package nginx-filesystem.noarch 1:1.12.2-3.el7 will be installed
--> Running transaction check
---> Package nginx-mod-http-geoip.x86_64 1:1.12.2-3.el7 will be installed
---> Package nginx-mod-http-image-filter.x86_64 1:1.12.2-3.el7 will be installed
---> Package nginx-mod-http-perl.x86_64 1:1.12.2-3.el7 will be installed
---> Package nginx-mod-http-xslt-filter.x86_64 1:1.12.2-3.el7 will be installed
---> Package nginx-mod-mail.x86_64 1:1.12.2-3.el7 will be installed
---> Package nginx-mod-stream.x86_64 1:1.12.2-3.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository
Size
================================================================================
Installing:
nginx x86_64 1:1.12.2-3.el7 epel 531 k
Installing for dependencies:
nginx-all-modules noarch 1:1.12.2-3.el7 epel 16 k
nginx-filesystem noarch 1:1.12.2-3.el7 epel 17 k
nginx-mod-http-geoip x86_64 1:1.12.2-3.el7 epel 23 k
nginx-mod-http-image-filter x86_64 1:1.12.2-3.el7 epel 27 k
nginx-mod-http-perl x86_64 1:1.12.2-3.el7 epel 36 k
nginx-mod-http-xslt-filter x86_64 1:1.12.2-3.el7 epel 26 k
nginx-mod-mail x86_64 1:1.12.2-3.el7 epel 54 k
nginx-mod-stream x86_64 1:1.12.2-3.el7 epel 76 k
Transaction Summary
================================================================================
Install 1 Package (+8 Dependent packages)
Total download size: 807 k
Installed size: 1.9 M
Is this ok [y/d/N]: y
Downloading packages:
nginx-mod-http-image-filter-1. FAILED
http://mirror2.totbb.net/epel/7/x86_64/Packages/n/nginx-mod-http-image-filter-1.12.2-3.el7.x86_64.rpm: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article
https://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
(1/9): nginx-1.12.2-3.el7.x86_64.rpm | 531 kB 00:57
(2/9): nginx-mod-http-xslt-filter-1.12.2-3.el7.x86_64.rpm | 26 kB 00:00
(3/9): nginx-mod-mail-1.12.2-3.el7.x86_64.rpm | 54 kB 00:09
(4/9): nginx-mod-stream-1.12.2-3.el7.x86_64.rpm | 76 kB 00:00
(5/9): nginx-filesystem-1.12.2-3.el7.noarch.rpm | 17 kB 00:41
(6/9): nginx-mod-http-image-filter-1.12.2-3.el7.x86_64.rpm | 27 kB 00:00
(7/9): nginx-mod-http-geoip-1.12.2-3.el7.x86_64.rpm | 23 kB 00:37
(8/9): nginx-all-modules-1.12.2-3.el7.noarch.rpm | 16 kB 01:08
(9/9): nginx-mod-http-perl-1.12.2-3.el7.x86_64.rpm | 36 kB 00:17
--------------------------------------------------------------------------------
Total 11 kB/s | 807 kB 01:11
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:nginx-filesystem-1.12.2-3.el7.noarch 1/9
Installing : 1:nginx-mod-http-xslt-filter-1.12.2-3.el7.x86_64 2/9
Installing : 1:nginx-mod-http-perl-1.12.2-3.el7.x86_64 3/9
Installing : 1:nginx-mod-http-image-filter-1.12.2-3.el7.x86_64 4/9
Installing : 1:nginx-mod-mail-1.12.2-3.el7.x86_64 5/9
Installing : 1:nginx-mod-stream-1.12.2-3.el7.x86_64 6/9
Installing : 1:nginx-mod-http-geoip-1.12.2-3.el7.x86_64 7/9
Installing : 1:nginx-all-modules-1.12.2-3.el7.noarch 8/9
Installing : 1:nginx-1.12.2-3.el7.x86_64 9/9
Verifying : 1:nginx-all-modules-1.12.2-3.el7.noarch 1/9
Verifying : 1:nginx-mod-http-xslt-filter-1.12.2-3.el7.x86_64 2/9
Verifying : 1:nginx-mod-http-perl-1.12.2-3.el7.x86_64 3/9
Verifying : 1:nginx-mod-http-image-filter-1.12.2-3.el7.x86_64 4/9
Verifying : 1:nginx-1.12.2-3.el7.x86_64 5/9
Verifying : 1:nginx-filesystem-1.12.2-3.el7.noarch 6/9
Verifying : 1:nginx-mod-mail-1.12.2-3.el7.x86_64 7/9
Verifying : 1:nginx-mod-stream-1.12.2-3.el7.x86_64 8/9
Verifying : 1:nginx-mod-http-geoip-1.12.2-3.el7.x86_64 9/9
Installed:
nginx.x86_64 1:1.12.2-3.el7
Dependency Installed:
nginx-all-modules.noarch 1:1.12.2-3.el7
nginx-filesystem.noarch 1:1.12.2-3.el7
nginx-mod-http-geoip.x86_64 1:1.12.2-3.el7
nginx-mod-http-image-filter.x86_64 1:1.12.2-3.el7
nginx-mod-http-perl.x86_64 1:1.12.2-3.el7
nginx-mod-http-xslt-filter.x86_64 1:1.12.2-3.el7
nginx-mod-mail.x86_64 1:1.12.2-3.el7
nginx-mod-stream.x86_64 1:1.12.2-3.el7
Complete!
root@controller ~]# crm_resource --resource http --force-start
Operation start for http (ocf:heartbeat:nginx) returned: 'unknown error' (1)
> stderr: ls: cannot access /etc/nginx/conf.d/*.conf: No such file or directory
> stderr: ls: cannot access /etc/nginx/default.d/*.conf: No such file or directory
> stderr: ls: cannot access /etc/nginx/conf.d/*.conf: No such file or directory
> stderr: ls: cannot access /etc/nginx/default.d/*.conf: No such file or directory
> stderr: INFO: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
> stderr: INFO: Starting /usr/sbin/nginx - nginx version: nginx/1.12.2
> stderr: INFO: /usr/sbin/nginx build configuration: configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_auth_request_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E'
> stderr: ERROR: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] still could not bind()
[root@controller ~]# service httpd stop
Redirecting to /bin/systemctl stop httpd.service
[root@controller ~]#
[root@controller ~]# crm_resource --resource http --force-start
Operation start for http (ocf:heartbeat:nginx) returned: 'unknown error' (1)
> stderr: ls: cannot access /etc/nginx/conf.d/*.conf: No such file or directory
> stderr: ls: cannot access /etc/nginx/default.d/*.conf: No such file or directory
> stderr: ls: cannot access /etc/nginx/conf.d/*.conf: No such file or directory
> stderr: ls: cannot access /etc/nginx/default.d/*.conf: No such file or directory
> stderr: INFO: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
> stderr: INFO: Starting /usr/sbin/nginx - nginx version: nginx/1.12.2
> stderr: INFO: /usr/sbin/nginx build configuration: configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_auth_request_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E'
> stderr: ERROR: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] still could not bind()
[root@controller ~]# service httpd stop
Redirecting to /bin/systemctl stop httpd.service
[root@controller ~]# chkconfig httpd off
Note: Forwarding request to 'systemctl disable httpd.service'.
Removed symlink /etc/systemd/system/multi-user.target.wants/httpd.service.
[root@controller ~]# crm_resource --resource http --force-start
Operation start for http (ocf:heartbeat:nginx) returned: 'unknown error' (1)
> stderr: ls: cannot access /etc/nginx/conf.d/*.conf: No such file or directory
> stderr: ls: cannot access /etc/nginx/default.d/*.conf: No such file or directory
> stderr: ls: cannot access /etc/nginx/conf.d/*.conf: No such file or directory
> stderr: ls: cannot access /etc/nginx/default.d/*.conf: No such file or directory
> stderr: INFO: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
> stderr: INFO: Starting /usr/sbin/nginx - nginx version: nginx/1.12.2
> stderr: INFO: /usr/sbin/nginx build configuration: configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_auth_request_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E'
> stderr: ERROR: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] still could not bind()
[root@controller ~]# pcs resource delete WebSite
Attempting to stop: WebSite... Stopped
You have new mail in /var/spool/mail/root
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
resource start/stop
root@controller ~]# crm_resource --resource http --force-start
Operation start for http (ocf:heartbeat:nginx) returned: 'ok' (0)
> stderr: ls: cannot access /etc/nginx/conf.d/*.conf: No such file or directory
> stderr: ls: cannot access /etc/nginx/default.d/*.conf: No such file or directory
> stderr: ls: cannot access /etc/nginx/conf.d/*.conf: No such file or directory
> stderr: ls: cannot access /etc/nginx/default.d/*.conf: No such file or directory
> stderr: INFO: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
> stderr: INFO: Starting /usr/sbin/nginx - nginx version: nginx/1.12.2
> stderr: INFO: /usr/sbin/nginx build configuration: configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_auth_request_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E'
[root@controller ~]#
root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
[root@controller ~]#
[root@controller ~]# crm_resource --cleanup
Cleaned up all resources on all nodes
Waiting for 2 replies from the CRMd.. OK
[root@controller ~]# pcs status resources
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Started controller
[root@controller ~]#
https://docs.google.com/document/d/e/2PACX-1vR0aEaYjOyU5vbajw5SRtROdJkBMwlfSnZPyn1DJ_iRfYNHqzlpigi02UxMPvpDQc5hBzV8r-AQvkV0/pub
Configure Constraints
[root@compute ~]# pcs constraint order floating_ip then http https
Adding floating_ip http (kind: Mandatory) (Options: first-action=start then-action=start)
Configure Constraints
[root@compute ~]# pcs constraint colocation add http https floating_ip INFINITY
[root@compute ~]# pcs constraint order floating_ip then http https
Adding floating_ip http (kind: Mandatory) (Options: first-action=start then-action=start)
[root@compute ~]# pcs status
Cluster name: cluster
Stack: corosync
Current DC: compute (version 1.1.20-5.el7_7.1-3c4c782f70) - partition with quorum
Last updated: Thu Oct 10 00:45:38 2019
Last change: Thu Oct 10 00:44:18 2019 by root via cibadmin on compute
2 nodes configured
3 resources configured
Online: [ compute controller ]
Full list of resources:
floating_ip (ocf::heartbeat:IPaddr2): Started controller
http (ocf::heartbeat:nginx): Started controller
https (ocf::heartbeat:nginx): Started controller
Failed Resource Actions:
* http_start_0 on compute 'not installed' (5): call=85, status=complete, exitreason='',
last-rc-change='Thu Oct 10 00:42:55 2019', queued=0ms, exec=30ms
* https_start_0 on compute 'not installed' (5): call=89, status=complete, exitreason='',
last-rc-change='Thu Oct 10 00:42:56 2019', queued=1ms, exec=45ms
Daemon Status:
corosync: active/enabled
pacemaker: active/enabled
pcsd: active/enabled
[root@controller ~]# pcs cluster stop controller
controller: Stopping Cluster (pacemaker)...
controller: Stopping Cluster (corosync)...
[root@compute ~]# pcs status
Cluster name: cluster
Stack: corosync
Current DC: compute (version 1.1.20-5.el7_7.1-3c4c782f70) - partition with quorum
Last updated: Thu Oct 10 00:51:03 2019
Last change: Thu Oct 10 00:44:18 2019 by root via cibadmin on compute
2 nodes configured
3 resources configured
Online: [ compute ]
OFFLINE: [ controller ]
Full list of resources:
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
https (ocf::heartbeat:nginx): Stopped
Failed Resource Actions:
* http_start_0 on compute 'not installed' (5): call=85, status=complete, exitreason='',
last-rc-change='Thu Oct 10 00:42:55 2019', queued=0ms, exec=30ms
* https_start_0 on compute 'not installed' (5): call=89, status=complete, exitreason='',
last-rc-change='Thu Oct 10 00:42:56 2019', queued=1ms, exec=45ms
Daemon Status:
corosync: active/enabled
pacemaker: active/enabled
pcsd: active/enabled
[root@compute ~]#
Cluster name: cluster
Stack: corosync
Current DC: compute (version 1.1.20-5.el7_7.1-3c4c782f70) - partition with quorum
Last updated: Thu Oct 10 00:45:38 2019
Last change: Thu Oct 10 00:44:18 2019 by root via cibadmin on compute
2 nodes configured
3 resources configured
Online: [ compute controller ]
Full list of resources:
floating_ip (ocf::heartbeat:IPaddr2): Started controller
http (ocf::heartbeat:nginx): Started controller
https (ocf::heartbeat:nginx): Started controller
Failed Resource Actions:
* http_start_0 on compute 'not installed' (5): call=85, status=complete, exitreason='',
last-rc-change='Thu Oct 10 00:42:55 2019', queued=0ms, exec=30ms
* https_start_0 on compute 'not installed' (5): call=89, status=complete, exitreason='',
last-rc-change='Thu Oct 10 00:42:56 2019', queued=1ms, exec=45ms
Daemon Status:
corosync: active/enabled
pacemaker: active/enabled
pcsd: active/enabled
[root@controller ~]# pcs cluster stop controller
controller: Stopping Cluster (pacemaker)...
controller: Stopping Cluster (corosync)...
[root@compute ~]# pcs status
Cluster name: cluster
Stack: corosync
Current DC: compute (version 1.1.20-5.el7_7.1-3c4c782f70) - partition with quorum
Last updated: Thu Oct 10 00:51:03 2019
Last change: Thu Oct 10 00:44:18 2019 by root via cibadmin on compute
2 nodes configured
3 resources configured
Online: [ compute ]
OFFLINE: [ controller ]
Full list of resources:
floating_ip (ocf::heartbeat:IPaddr2): Started compute
http (ocf::heartbeat:nginx): Stopped
https (ocf::heartbeat:nginx): Stopped
Failed Resource Actions:
* http_start_0 on compute 'not installed' (5): call=85, status=complete, exitreason='',
last-rc-change='Thu Oct 10 00:42:55 2019', queued=0ms, exec=30ms
* https_start_0 on compute 'not installed' (5): call=89, status=complete, exitreason='',
last-rc-change='Thu Oct 10 00:42:56 2019', queued=1ms, exec=45ms
Daemon Status:
corosync: active/enabled
pacemaker: active/enabled
pcsd: active/enabled
[root@compute ~]#
Comments
Post a Comment