Ich habe kürzlich Galera Cluster auf zwei Red Hat 7 Servern installiert und richtig konfiguriert. Allerdings kann ich HAProxy nicht zum Laufen bringen. Ich bekomme nur Fehler.Haproxy kann nicht geladen werden Balanace Galera Cluster-Knoten
Knoten 1 hat eine IP von 1.1.1.1 und der gesamte Verkehr ist offen. SELinux hat mysql auf permissive gesetzt.
Knoten 2 hat eine IP von 2.2.2.2 und der gesamte Verkehr ist offen. SELinux hat mysql auf permissive gesetzt.
HAProxy hat eine IP von 3.3.3.3 und der gesamte Verkehr ist offen. SELinux wurde deaktiviert.
Alle Knoten befinden sich auf separaten Servern. Die einzige Sache, die Knoten 3 auf ihm installiert hat, ist HAProxy und Mysql-Client.
So pro der Dokumentation Galera, ich HAProxy installieren und diesen Teil auf dem Boden der Konfigurationsdatei hinzufügen:
# Load Balancing for Galera Cluster
listen galera 3.3.3.3:3306
balance roundrobin
mode tcp
option tcpka
option mysql-check user haproxy
server node1 1.1.1.1:3306 check weight 1
server node2 2.2.2.2:3306 check weight 1
Aber dann, wenn ich Status HAProxy prüfe ich diese Fehler erhalten:
[[email protected] haproxy]# service haproxy restart
Redirecting to /bin/systemctl restart haproxy.service
[[email protected] haproxy]# service haproxy status
Redirecting to /bin/systemctl status haproxy.service
● haproxy.service - HAProxy Load Balancer
Loaded: loaded (/usr/lib/systemd/system/haproxy.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2017-07-04 20:18:50 EDT; 3s ago
Process: 11773 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid $OPTIONS (code=exited, status=1/FAILURE)
Main PID: 11773 (code=exited, status=1/FAILURE)
Jul 04 20:18:50 nodemgr systemd[1]: Started HAProxy Load Balancer.
Jul 04 20:18:50 nodemgr systemd[1]: Starting HAProxy Load Balancer...
Jul 04 20:18:50 nodemgr haproxy-systemd-wrapper[11773]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /ru...pid -Ds
Jul 04 20:18:50 nodemgr haproxy-systemd-wrapper[11773]: [WARNING] 184/201850 (11774) : parsing [/etc/haproxy/haproxy.cfg:45] : 'option httplog'...cplog'.
Jul 04 20:18:50 nodemgr haproxy-systemd-wrapper[11773]: [WARNING] 184/201850 (11774) : config : 'option forwardfor' ignored for proxy 'galera' ...P mode.
Jul 04 20:18:50 nodemgr haproxy-systemd-wrapper[11773]: [ALERT] 184/201850 (11774) : Starting proxy galera: cannot bind socket [3.3.3.3:3306]
Jul 04 20:18:50 nodemgr systemd[1]: haproxy.service: main process exited, code=exited, status=1/FAILURE
Jul 04 20:18:50 nodemgr haproxy-systemd-wrapper[11773]: haproxy-systemd-wrapper: exit, haproxy RC=1
Jul 04 20:18:50 nodemgr systemd[1]: Unit haproxy.service entered failed state.
Jul 04 20:18:50 nodemgr systemd[1]: haproxy.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
ich mein Problem gehe davon ist hier:
Jul 04 20:18:50 nodemgr haproxy-systemd-wrapper[11773]: [ALERT] 184/201850 (11774) : Starting proxy galera: cannot bind socket [3.3.3.3:3306]
aber nach SELinux deaktivieren ich kno nicht Was ich noch tun muss. Jede Hilfe wird sehr geschätzt!
Voll haproxy Konfigurationsdatei ist hier:
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# /etc/sysconfig/syslog
#
# 2) configure local2 events to go to the /var/log/haproxy.log
# file. A line like the following can be added to
# /etc/sysconfig/syslog
#
# local2.* /var/log/haproxy.log
#
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
# turn on stats unix socket
stats socket /var/lib/haproxy/stats
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------
frontend main *:5000
acl url_static path_beg -i /static /images /javascript /stylesheets
acl url_static path_end -i .jpg .gif .png .css .js
use_backend static if url_static
default_backend app
#---------------------------------------------------------------------
# static backend for serving up images, stylesheets and such
#---------------------------------------------------------------------
backend static
balance roundrobin
server static 127.0.0.1:4331 check
#---------------------------------------------------------------------
# round robin balancing between the various backends
#---------------------------------------------------------------------
backend app
balance roundrobin
server app1 127.0.0.1:5001 check
server app2 127.0.0.1:5002 check
server app3 127.0.0.1:5003 check
server app4 127.0.0.1:5004 check
# Load Balancing for Galera Cluster
listen galera 3.3.3.3:3306
balance roundrobin
mode tcp
option tcpka
option mysql-check user haproxy
server node1 1.1.1.1:3306 check weight 1
server node2 2.2.2.2:3306 check weight 1
'netstat -a -n | grep ': 3306'' ... irgendwas zeigt? Zeigt 'ifconfig' eine aktuelle Schnittstelle mit 3.3.3.3 an? –
Nach stundenlangem Scratchen meines Kopfes fand ich diesen Schritt: vi /etc/sysctl.conf und füge 'net.ipv4.ip_nonlocal_bind = 1' am Ende der Datei hinzu – user3299633
Das hätte nicht nötig sein sollen. 'höre galera: 3306' hätte wahrscheinlich erreicht, was du vorhattest. –