Code Monkey home page Code Monkey logo

Comments (8)

caffeinated92 avatar caffeinated92 commented on July 23, 2024

Hi @dibrother,

Thank you for your information.

We are not embedding HAProxy in replication-manager yet. So you have to install HAProxy by yourself.

For the semi sync status we will check and fix this.

from replication-manager.

caffeinated92 avatar caffeinated92 commented on July 23, 2024

Semi sync indicator should be fixed by #658

from replication-manager.

svaroqui avatar svaroqui commented on July 23, 2024

If you wan't replication-manager to drive haproxy you need to turn on runtime_api and create a writer and reader group we are generating some config with the configurator that you could found inside the data directory under each software directory and init subdirectory

from replication-manager.

dibrother avatar dibrother commented on July 23, 2024

Haproxy installed using yum on 10.10.2.11
Haproxy version - 2.4.22
But it seems that the replication manager did not call it
image

from replication-manager.

svaroqui avatar svaroqui commented on July 23, 2024

Here is a sample of what your haproxy should look when using DNS service

In the read pool the backend name is the id of the server inside replication-manager this should be documented how to get it

global

 daemon
 maxconn 4096

 stats socket /run/haproxy.sock mode 666 level admin
 stats socket [email protected]:6032 level admin expose-fd listeners


 log /dev/log local0 debug
 external-check
 
defaults
   log global
   mode http
   option dontlognull
   option redispatch
   option clitcpka
   option srvtcpka
   retries 3
   maxconn 500000
   timeout http-request 5s
   timeout connect 5000ms
   timeout client 50000s
   timeout server 50000s

listen stats
   bind 0.0.0.0:1988
   mode http
   stats enable
   stats uri /
   stats refresh 2s
   stats realm Haproxy\ Stats
   stats show-legends


resolvers dns
 parse-resolv-conf
 resolve_retries       3
 timeout resolve       1s
 timeout retry         1s
 hold other           30s
 hold refused         30s
 hold nx              30s
 hold timeout         30s
 hold valid           10s
 hold obsolete        30s


frontend my_write_frontend
    bind 0.0.0.0:3306
    option tcplog 
    mode tcp
    default_backend service_write

frontend my_read_frontend
    bind 0.0.0.0:3306
    option tcplog 
    mode tcp
    default_backend service_read

backend service_write
    mode tcp
    balance leastconn 
 
   
    server leader db1.bench.svc.cloud18:3306 init-addr last,libc,none resolvers dns  weight 100 maxconn 2000 check inter 1000

backend service_read
    mode tcp
    balance leastconn 
     
    
    server db12445110637138812663 db1.bench.svc.cloud18:3306 init-addr last,libc,none resolvers dns weight 100 maxconn 2000 check inter 1000
    server db5242879977071083029 db2.bench.svc.cloud18:3306 init-addr last,libc,none resolvers dns weight 100 maxconn 2000 check inter 1000
    server db1508429827329252939 db3.bench.svc.cloud18:3306 init-addr last,libc,none resolvers dns weight 100 maxconn 2000 check inter 1000

Or using IP

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 socket [email protected]:1999 level admin expose-fd listeners
	stats timeout 30s
	user haproxy
	group haproxy
	daemon
	ca-base /etc/ssl/certs
	crt-base /etc/ssl/private
	 ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
        ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
        ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
defaults
	log	global
	mode	http
	option	httplog
	option	dontlognull
        timeout connect 5000
        timeout client  50000
        timeout server  50000
	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
listen stats
   bind 0.0.0.0:1988
   mode http
   stats enable
   stats uri /
   stats refresh 2s
   stats realm Haproxy\ Stats
   stats show-legends

frontend my_write_frontend
    bind 0.0.0.0:3306
    option tcplog 
    mode tcp
    default_backend service_write
frontend my_read_frontend
    bind 0.0.0.0:3307
    option tcplog 
    mode tcp
    default_backend service_read
backend service_write
    mode tcp
    balance leastconn 
    server leader 10.0.0.41:3306 init-addr last,libc,none weight 100 maxconn 2000 check inter 1000
backend service_read
    mode tcp
    balance leastconn 
   server db9641622786185905475 <xx.xx.xx.01>:3306 init-addr last,libc,none  weight 100 maxconn 2000 check inter 1000
   server db7042070123332511137 <xx.xx.xx.02>:3306 init-addr last,libc,none weight 100 maxconn 2000 check inter 1000

Note that the internal id can change when you change the cluster name , the db host name or ip and the port
And the config should then be regenerate and reload

A good repman default conf to start with

[Default]

include = "/etc/replication-manager/cluster.d"
prov-orchestrator = "onpremise"
onpremise-ssh = true
onpremise-ssh-credential = "root:"
onpremise-ssh-private-key= "/root/.ssh/id_rsa"
scheduler-jobs-ssh = true
monitoring-address = "mcmetrepman01"
monitoring-ssl-cert = "/etc/replication-manager/certs/server.crt"
monitoring-ssl-key = "/etc/replication-manager/certs/server.key"
test = true
sysbench-v1 = true 
compress-backups = true

backup-mysqlclient-path ="/usr/bin/mysql"
backup-mysqlbinlog-path = "/usr/bin/mysqlbinlog"
backup-mysqldump-path="/usr/bin/mysqldump" 
backup-mysqldump-options = "--hex-blob --single-transaction --verbose --all-databases"

#monitoring-save-config = true

#########
## LOG ##
#########

log-file = "/var/log/replication-manager.log"

api-port = "443"
mail-from = "repman@<repmanhost>"
mail-smtp-addr = "<maillhost>:25"
mail-to = "<yourmail>, [email protected]"
alert-slack-channel  = "#test_alert"
alert-slack-url = "https://meet.signal18.io/hooks/<slackhook>"
alert-slack-user = "repman"

and for your first cluster

[test]
title = "test"
prov-orchestrator = "onpremise"
prov-db-tags = "localinfile,compressbinlog,ssd,userstats,gtidstrict,readonly,threadpool,diskmonitor,innodb,noquerycache,slow,pfs,linux,logtotable,deb,nosplitpath,readcommitted,optimistic,utf8ci,semisync,row,sqlerror"
prov-db-memory = "12G"
prov-db-memory-shared-pct = "threads:16,innodb:60,myisam:10,aria:10,rocksdb:1,tokudb:1,s3:1,archive:1,querycache:0"
prov-db-disk-size = "100"
prov-db-cpu-cores = "4"
prov-db-disk-iops = "20000"


db-servers-hosts = "xx.xx.xx.01,xx.xx.xx.02"

db-servers-prefered-master = "xx.xx.xx.01"
db-servers-credential = "repman:hash_900676eb357b6f45a36e09a54df421782df1b33e7716b02e43f4967e"
db-servers-connect-timeout = 1
replication-credential = "replication:hash_900676eb357b6f45a36e09a54df421782df1b33e7716b02e43f4967e"

haproxy = true
haproxy-servers = "xx.xx.xx.70,xx.xx.xx.71"

#proxy-servers-read-on-master=true 

verbose = false
log-failed-election  = true
log-level = 1
log-rotate-max-age = 7
log-rotate-max-backup = 7
log-rotate-max-size = 5
log-sql-in-monitoring   = true
log-sst = false 

from replication-manager.

svaroqui avatar svaroqui commented on July 23, 2024

If wan't haproxy to start colocated with replication-manager please try
--haproxy-mode string HAProxy mode [standby|runtimeapi|dataplaneapi] (default "runtimeapi") standby
could be the doc is wrong here as we changed this later on when introducing runtime api

from replication-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.