Last active
December 21, 2015 00:29
-
-
Save markusklems/6220686 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install haproxy | |
echo " | |
listen riak 0.0.0.0:8087 | |
balance leastconn | |
mode tcp | |
option tcplog | |
option contstats | |
option tcpka | |
option srvtcpka | |
server riak1 192.168.75.233:8087 check weight 1 maxconn 1024 | |
server riak2 192.168.75.234:8087 check weight 1 maxconn 1024 | |
server riak3 192.168.75.236:8087 check weight 1 maxconn 1024 | |
server riak4 192.168.75.238:8087 check weight 1 maxconn 1024 | |
server riak5 192.168.75.235:8087 check weight 1 maxconn 1024 | |
server riak6 192.168.75.231:8087 check weight 1 maxconn 1024 | |
" | sudo tee -a /etc/haproxy/haproxy.cfg | |
sed -i -e "s|ENABLED=0|ENABLED=1|" /etc/default/haproxy | |
sudo /etc/init.d/haproxy start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment