«   2018/12   »
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Archives
Today
421
Total
1,190,722
안정적인 DNS서비스 DNSEver
관리 메뉴

Blue Breeze

HAProxy MySQL replication, cluster 본문

Server Side/HAProxy

HAProxy MySQL replication, cluster

푸른바람 C/H 2017.05.10 18:34

/etc/haproxy/haproxy.cfg

global
	log		 127.0.0.1 local0 info
	log		 127.0.0.1 local1 notice
	#chroot	 /var/lib/haproxy
	#pidfile		/var/run/haproxy.pid
	maxconn	 80000		   # 최대 동시접속 설정, 1GM 40,000 ~ 50,000
	#user	   haproxy
	#group	  haproxy
	tune.bufsize	65536
	tune.ssl.default-dh-param   2048
	#nbproc	 4			   # 실행 프로세스 수
	daemon					  # daemon 모드실행(권장)
	# turn on stats unix socket
	stats socket /var/lib/haproxy/stats

defaults
	log global
	option tcplog
	retries 2
	timeout connect 3000
	timeout server 5000
	timeout client 5000

listen mysql-read
	bind :3306
	mode tcp
	balance roundrobin
	option mysql-check user haproxy_check
	server mysql1 x.x.x.x:3306 check
	server mysql2 x.x.x.x:3306 check
	server mysql3 x.x.x.x:3306 check

mysql health check user

use mysql;
#insert into user (Host, User) values ('%', 'haproxy_check');
insert into user (Host, User) values ('haproxyServerIP', 'haproxy_check');
flush privileges;
# haproxy server
yum install mysql
# connect check
mysql -h"haproxyServerIP" -u haproxy_check -p -e "show variables like 'pid_file'"
mysql -h 127.0.0.1 -u haproxy_check -p -e "show variables like 'server_id'"

init script - unary operator expected

# . /etc/rc.d/init.d/haproxy: line 26: [: =: unary operator expected
#[ ${NETWORKING} = "no" ] && exit 1
[ "${NETWORKING}"" = "no" ] && exit 1


'Server Side > HAProxy' 카테고리의 다른 글

haproxy log setup  (0) 2017.06.09
HAProxy Mysql 'Reading initial communication packet'  (0) 2017.05.12
HAProxy MySQL replication, cluster  (0) 2017.05.10
HAProxy COMODO Wildcard SSL  (0) 2017.05.08
HAProxy Stats Scoket Path Error  (0) 2017.05.02
HAProxy Multi Process Warning  (0) 2017.05.01
0 Comments
댓글쓰기 폼