Вы находитесь на странице: 1из 21

Version : 1.

0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 1 of 21

History................................................................................................................................................................................................................................................................................ 3
Relation.............................................................................................................................................................................................................................................................................. 4
Software............................................................................................................................................................................................................................................................................. 5
Load Balancer........................................................................................................................................................................................................................................................... 5
Web Server................................................................................................................................................................................................................................................................5
Database Server:......................................................................................................................................................................................................................................................5
Installation..........................................................................................................................................................................................................................................................................5
Configuration..................................................................................................................................................................................................................................................................... 5
HAProxy Load Balancer.......................................................................................................................................................................................................................................... 5
hary@darkstar:~$ ifconfig............................................................................................................................................................................................................................... 5
hary@darkstar:~$ cat /etc/haproxy/haproxy.cfg..........................................................................................................................................................................................6
hary@darkstar:~$ sudo service haproxy status.......................................................................................................................................................................................... 8
Apache I.A................................................................................................................................................................................................................................................................. 8
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0.............................................................................................................................................................8
[root@localhost ~]# ifconfig............................................................................................................................................................................................................................ 9
[root@localhost ~]# service httpd start......................................................................................................................................................................................................... 9
[root@localhost ~]# service httpd status.......................................................................................................................................................................................................9
Apache I.B............................................................................................................................................................................................................................................................... 10
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0...........................................................................................................................................................10
[root@localhost ~]# ifconfig.......................................................................................................................................................................................................................... 10
[root@localhost ~]# service httpd start....................................................................................................................................................................................................... 11
[root@localhost ~]# service httpd status.................................................................................................................................................................................................... 11
Apache I.C...............................................................................................................................................................................................................................................................11
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0...........................................................................................................................................................11
[root@localhost ~]# ifconfig.......................................................................................................................................................................................................................... 11
[root@localhost ~]# service httpd start....................................................................................................................................................................................................... 12
[root@localhost ~]# service httpd status.................................................................................................................................................................................................... 12
MariaDB Galera Cluster II.A................................................................................................................................................................................................................................. 12
[root@node0 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0............................................................................................................................................................... 12
[root@node0 ~]# ifconfig...............................................................................................................................................................................................................................12

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 2 of 21

[root@node0 ~]# cat /etc/my.cnf.d/server.cnf............................................................................................................................................................................................13


[root@node0 ~]# /etc/init.d/mysql start --wsrep-new-cluster...................................................................................................................................................................14
MariaDB Galera Cluster II.B................................................................................................................................................................................................................................. 14
[root@node1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0............................................................................................................................................................... 14
[root@node1 ~]# ifconfig...............................................................................................................................................................................................................................14
[root@node1 ~]# cat /etc/my.cnf.d/server.cnf............................................................................................................................................................................................15
[root@node1 ~]# /etc/init.d/mysql start....................................................................................................................................................................................................... 16
MariaDB Galera Cluster II.C.................................................................................................................................................................................................................................16
[root@node2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0............................................................................................................................................................... 16
[root@node2 ~]# ifconfig...............................................................................................................................................................................................................................16
[root@node2 ~]# cat /etc/my.cnf.d/server.cnf............................................................................................................................................................................................17
[root@node2 ~]# /etc/init.d/mysql start....................................................................................................................................................................................................... 17
Result............................................................................................................................................................................................................................................................................... 18
Apache Console..................................................................................................................................................................................................................................................... 18
Apache Welcome Page.........................................................................................................................................................................................................................................19
HAProxy Statistics Page....................................................................................................................................................................................................................................... 19
MariaDB Load Balancing...................................................................................................................................................................................................................................... 20
Reference........................................................................................................................................................................................................................................................................ 21
HAProxy...................................................................................................................................................................................................................................................................21
MariaDB Galera Cluster........................................................................................................................................................................................................................................ 21
Test Conducted and Results Reviewed..................................................................................................................................................................................................................... 21

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 3 of 21

History

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 4 of 21

Relation

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 5 of 21

Software
Load Balancer
Operating System: Ubuntu v16.04 LTS
TCP/HTTP Balancer: HAProxy v1.6.3

Web Server
Operating System: Red Hat Enterprise Linux v6.6
Web Server: Apache v.2.2.15

Database Server:
Operating System: Red Hat Enterprise Linux v6.6
Database Server: MariaDB Galera Cluster v5.5.48

Installation
Please read online documentation for each software installation

Configuration
HAProxy Load Balancer
hary@darkstar:~$ ifconfig
enp9s0 Link encap:Ethernet HWaddr 08:9e:01:35:c0:1f
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 6 of 21

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:25079 errors:0 dropped:0 overruns:0 frame:0
TX packets:25079 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:3139603 (3.1 MB) TX bytes:3139603 (3.1 MB)

wlp3s0 Link encap:Ethernet HWaddr 84:a6:c8:ef:7b:7b


inet addr:192.168.0.55 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::86a6:c8ff:feef:7b7b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:118728 errors:0 dropped:0 overruns:0 frame:0
TX packets:61473 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:121884781 (121.8 MB) TX bytes:7347297 (7.3 MB)

hary@darkstar:~$ cat /etc/haproxy/haproxy.cfg


global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon

# Default SSL material locations


ca-base /etc/ssl/certs
crt-base /etc/ssl/private

# Default ciphers to use on SSL-enabled listening sockets.

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 7 of 21

# For more information, see ciphers(1SSL). This list is from:


# https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
ssl-default-bind-options no-sslv3
ssl-default-bind-ciphers
ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS

defaults
log global
mode http
option httplog
option dontlognull
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
retries 3
option redispatch
timeout connect 5000
timeout client 10000
timeout server 10000

listen HA:Stats
bind *:90
mode http
stats enable
stats realm Haproxy\ Statistics
stats uri /
stats auth Username:Password

listen HA:Apache
bind *:8080
balance roundrobin
option httpclose

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 8 of 21

option forwardfor
mode http
option httpchk HEAD /check.txt HTTP/1.0
server httpd:222 192.168.0.222:80 cookie A check
server httpd:223 192.168.0.223:80 cookie B check
server httpd:224 192.168.0.224:80 cookie C check

hary@darkstar:~$ sudo service haproxy status


● haproxy.service - HAProxy Load Balancer
Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled)
Active: active (running) since Kam 2016-07-14 12:33:09 WIB; 1h 10min ago
Docs: man:haproxy(1)
file:/usr/share/doc/haproxy/configuration.txt.gz
Process: 970 ExecStartPre=/usr/sbin/haproxy -f ${CONFIG} -c -q (code=exited, status=0/SUCCESS)
Main PID: 1029 (haproxy-systemd)
CGroup: /system.slice/haproxy.service
├─1029 /usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
├─1030 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
└─1033 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds

Jul 14 12:33:08 darkstar systemd[1]: Starting HAProxy Load Balancer...


Jul 14 12:33:09 darkstar systemd[1]: Started HAProxy Load Balancer.
Jul 14 12:33:09 darkstar haproxy-systemd-wrapper[1029]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Jul 14 12:33:09 darkstar haproxy[1030]: Proxy HA.apache started.
Jul 14 12:33:09 darkstar haproxy[1030]: Proxy HA.apache started.

Apache I.A
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:A5:ED:6A
TYPE=Ethernet
UUID=09b2ed0e-668e-4daa-b9dd-a1dfd410d265
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 9 of 21

BROADCAST=192.168.0.255
NETWORK=192.168.0.0
IPADDR=192.168.0.222
NETMASK=255.255.255.0

[root@localhost ~]# ifconfig


eth0 Link encap:Ethernet HWaddr 08:00:27:A5:ED:6A
inet addr:192.168.0.222 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fea5:ed6a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3268 errors:0 dropped:0 overruns:0 frame:0
TX packets:576 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:248005 (242.1 KiB) TX bytes:74304 (72.5 KiB)

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

[root@localhost ~]# service httpd start


Starting httpd: [ OK ]

[root@localhost ~]# service httpd status


httpd (pid 1629) is running...

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 10 of 21

Apache I.B
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:A5:ED:6A
TYPE=Ethernet
UUID=09b2ed0e-668e-4daa-b9dd-a1dfd410d265
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static

BROADCAST=192.168.0.255
NETWORK=192.168.0.0
IPADDR=192.168.0.223
NETMASK=255.255.255.0

[root@localhost ~]# ifconfig


eth0 Link encap:Ethernet HWaddr 08:00:27:A5:ED:6A
inet addr:192.168.0.223 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fea5:ed6a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4930 errors:0 dropped:0 overruns:0 frame:0
TX packets:728 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:374340 (365.5 KiB) TX bytes:99280 (96.9 KiB)

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 11 of 21

[root@localhost ~]# service httpd start


Starting httpd: [ OK ]

[root@localhost ~]# service httpd status


httpd (pid 1798) is running...

Apache I.C
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:A5:ED:6A
TYPE=Ethernet
UUID=09b2ed0e-668e-4daa-b9dd-a1dfd410d265
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static

BROADCAST=192.168.0.255
NETWORK=192.168.0.0
IPADDR=192.168.0.224
NETMASK=255.255.255.0

[root@localhost ~]# ifconfig


eth0 Link encap:Ethernet HWaddr 08:00:27:A5:ED:6A
inet addr:192.168.0.224 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fea5:ed6a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7867 errors:0 dropped:0 overruns:0 frame:0
TX packets:1119 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:607885 (593.6 KiB) TX bytes:156581 (152.9 KiB)

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 12 of 21

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

[root@localhost ~]# service httpd start


Starting httpd: [ OK ]

[root@localhost ~]# service httpd status


httpd (pid 1731) is running...

MariaDB Galera Cluster II.A


[root@node0 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:ad:38:00
TYPE=Ethernet
UUID=6d57f6e2-769b-4dcb-a297-09c74871e960
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
BROADCAST=192.168.1.255
NETWORK=192.168.1.0
IPADDR=192.168.1.11
NETMASK=255.255.255.0

[root@node0 ~]# ifconfig


eth0 Link encap:Ethernet HWaddr 08:00:27:AD:38:00
inet addr:192.168.1.11 Bcast:192.168.1.255 Mask:255.255.255.0

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 13 of 21

inet6 addr: fe80::a00:27ff:fead:3800/64 Scope:Link


UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:66305 errors:0 dropped:0 overruns:0 frame:0
TX packets:14250 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:36966818 (35.2 MiB) TX bytes:2035424 (1.9 MiB)

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:720 (720.0 b) TX bytes:720 (720.0 b)

[root@node0 ~]# cat /etc/my.cnf.d/server.cnf


[server]

[mysqld]

[galera]
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://192.168.1.11,192.168.1.12,192.168.1.13"
wsrep_cluster_name="mdb_gcluster"
wsrep_node_address="192.168.1.11"
wsrep_node_name="node0"
wsrep_sst_method=rsync
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0

[embedded]

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 14 of 21

[mysqld-5.5]

[mariadb]

[mariadb-5.5]

[root@node0 ~]# /etc/init.d/mysql start --wsrep-new-cluster


Starting MySQL SUCCESS!

MariaDB Galera Cluster II.B


[root@node1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:ad:38:00
TYPE=Ethernet
UUID=6d57f6e2-769b-4dcb-a297-09c74871e960
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
BROADCAST=192.168.1.255
NETWORK=192.168.1.0
IPADDR=192.168.1.11
NETMASK=255.255.255.0

[root@node1 ~]# ifconfig


eth0 Link encap:Ethernet HWaddr 08:00:27:AD:38:00
inet addr:192.168.1.12 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fead:3800/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:66305 errors:0 dropped:0 overruns:0 frame:0
TX packets:14250 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:36966818 (35.2 MiB) TX bytes:2035424 (1.9 MiB)

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 15 of 21

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:720 (720.0 b) TX bytes:720 (720.0 b)

[root@node1 ~]# cat /etc/my.cnf.d/server.cnf


[server]

[mysqld]

[galera]
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://192.168.1.11,192.168.1.12,192.168.1.13"
wsrep_cluster_name="mdb_gcluster"
wsrep_node_address="192.168.1.12"
wsrep_node_name="node1"
wsrep_sst_method=rsync
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0

[embedded]

[mysqld-5.5]

[mariadb]

[mariadb-5.5]

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 16 of 21

[root@node1 ~]# /etc/init.d/mysql start


Starting MySQL SUCCESS!

MariaDB Galera Cluster II.C


[root@node2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:ad:38:00
TYPE=Ethernet
UUID=6d57f6e2-769b-4dcb-a297-09c74871e960
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
BROADCAST=192.168.1.255
NETWORK=192.168.1.0
IPADDR=192.168.1.11
NETMASK=255.255.255.0

[root@node2 ~]# ifconfig


eth0 Link encap:Ethernet HWaddr 08:00:27:AD:38:00
inet addr:192.168.1.13 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fead:3800/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:66305 errors:0 dropped:0 overruns:0 frame:0
TX packets:14250 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:36966818 (35.2 MiB) TX bytes:2035424 (1.9 MiB)

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 17 of 21

RX packets:12 errors:0 dropped:0 overruns:0 frame:0


TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:720 (720.0 b) TX bytes:720 (720.0 b)

[root@node2 ~]# cat /etc/my.cnf.d/server.cnf


[server]

[mysqld]

[galera]
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://192.168.1.11,192.168.1.12,192.168.1.13"
wsrep_cluster_name="mdb_gcluster"
wsrep_node_address="192.168.1.13"
wsrep_node_name="node2"
wsrep_sst_method=rsync
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0

[embedded]

[mysqld-5.5]

[mariadb]

[mariadb-5.5]

[root@node2 ~]# /etc/init.d/mysql start


Starting MySQL SUCCESS!

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 18 of 21

Result
Apache Console

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 19 of 21

Apache Welcome Page

HAProxy Statistics Page

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 20 of 21

MariaDB Load Balancing

https://id.linkedin.com/in/haryx8
Version : 1.0
HTTP/TCP Load Balancer Apache, MariaDB Galera Cluster & Replication
Date : 14/07/2016

HAProxy Page : Page 21 of 21

Reference
HAProxy
鐙 https://www.howtoforge.com/setting-up-a-high-availability-load-balancer-with-haproxy-keepalived-on-debian-lenny
鐙 https://www.digitalocean.com/community/tutorials/how-to-use-haproxy-to-set-up-http-load-balancing-on-an-ubuntu-vps
鐙 https://www.digitalocean.com/community/tutorials/how-to-share-php-sessions-on-multiple-memcached-servers-on-ubuntu-14-04
鐙 http://severalnines.com/tutorials/mysql-load-balancing-haproxy-tutorial
鐙 http://serverfault.com/questions/352253/haproxy-mysql-failover-load-balancing

MariaDB Galera Cluster


鐙 https://www.digitalocean.com/community/tutorials/how-to-configure-a-galera-cluster-with-mariadb-on-ubuntu-12-04-servers
鐙 https://mariadb.com/kb/en/mariadb/setting-up-replication/
鐙 https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-in-mysql

Test Conducted and Results Reviewed


Test Conducted by: Test Results Reviewed by:
Name: Haryanto. Name: ...
Start Date: 13 July 2016. Start Date: ...
Finish Date: ... Finish Date: ...

https://id.linkedin.com/in/haryx8

Вам также может понравиться