diff --git a/source/resources/apps/mariadb-galera/forksand-mariadb-setup b/source/resources/apps/mariadb-galera/forksand-mariadb-setup index aac3ead..2f346df 100755 --- a/source/resources/apps/mariadb-galera/forksand-mariadb-setup +++ b/source/resources/apps/mariadb-galera/forksand-mariadb-setup @@ -80,3 +80,54 @@ service mysql start # Maybe need on most advanced node: # sed -i -e 's/safe_to_bootstrap: 0/safe_to_bootstrap: 1/g' /var/lib/mysql/grastate.dat + + +########################## +# haproxy + +# for code.forksand.com, insert on sql1 (or any of them): +# http://galeracluster.com/documentation-webpages/haproxy.html +USE mysql; + +# This fails. Not a good way to create users either. +CREATE USER 'haproxy'@'10.42.1.163' IDENTIFIED BY 'password'; +FLUSH PRIVILEGES; +SHOW GRANTS FOR 'haproxy'@'10.42.1.163'; + + +# pen proxy instead of haproxy +# To run manually: +pen -l pen.log -p pen.pid localhost:3306 10.42.1.171:3306 10.42.1.172:3306 10.42.1.173:3306 10.42.1.174:3306 + + +useradd pen +echo "d /var/run/pen 0755 pen pen -" > /etc/tmpfiles.d/pen.conf +systemd-tmpfiles --create + +mkdir -p /etc/pen +cat > /etc/pen/galera.cfg < /lib/systemd/system/pen-galera.service <