Updated Branches: refs/heads/1843-feature-bigcouch 02993ad3a -> 69b9fd3a4
Add dev cluster scripts and HAProxy config Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/69b9fd3a Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/69b9fd3a Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/69b9fd3a Branch: refs/heads/1843-feature-bigcouch Commit: 69b9fd3a4240f9b4a42278aeb4584779dfb3b4ff Parents: 02993ad Author: Russell Branca <[email protected]> Authored: Mon Dec 23 14:34:07 2013 -0800 Committer: Russell Branca <[email protected]> Committed: Mon Dec 23 14:36:36 2013 -0800 ---------------------------------------------------------------------- rel/boot_dev_cluster.sh | 27 +++++++++++++++++++++++++++ rel/haproxy.cfg | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/69b9fd3a/rel/boot_dev_cluster.sh ---------------------------------------------------------------------- diff --git a/rel/boot_dev_cluster.sh b/rel/boot_dev_cluster.sh new file mode 100755 index 0000000..4559141 --- /dev/null +++ b/rel/boot_dev_cluster.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Make log directory +mkdir -p ./rel/logs/ + +# Start each node +./rel/dev1/bin/couchdb > ./rel/logs/couchdb1.log 2>&1 & +DB1_PID=$! + +./rel/dev2/bin/couchdb > ./rel/logs/couchdb2.log 2>&1 & +DB2_PID=$! + +./rel/dev3/bin/couchdb > ./rel/logs/couchdb3.log 2>&1 & +DB3_PID=$! + +/usr/local/sbin/haproxy -f rel/haproxy.cfg > ./rel/logs/haproxy.log 2>&1 & +HP_PID=$! + +sleep 2 + +# Connect the cluster +curl localhost:15986/nodes/[email protected] -X PUT -d '{}' +curl localhost:15986/nodes/[email protected] -X PUT -d '{}' + +trap "kill $DB1_PID $DB2_PID $DB3_PID $HP_PID" SIGINT SIGTERM SIGHUP + +wait http://git-wip-us.apache.org/repos/asf/couchdb/blob/69b9fd3a/rel/haproxy.cfg ---------------------------------------------------------------------- diff --git a/rel/haproxy.cfg b/rel/haproxy.cfg new file mode 100644 index 0000000..eb72363 --- /dev/null +++ b/rel/haproxy.cfg @@ -0,0 +1,33 @@ +global + maxconn 512 + spread-checks 5 + +defaults + mode http + log global + monitor-uri /_haproxy_health_check + option log-health-checks + option httplog + balance roundrobin + option forwardfor + option redispatch + retries 4 + option http-server-close + timeout client 150000 + timeout server 3600000 + timeout connect 500 + + stats enable + stats scope . + stats uri /_stats + +frontend http-in + # This requires HAProxy 1.5.x + # bind *:$HAPROXY_PORT + bind *:5984 + default_backend couchdbs + +backend couchdbs + server couchdb1 127.0.0.1:15984 check inter 5s + server couchdb2 127.0.0.1:25984 check inter 5s + server couchdb3 127.0.0.1:35984 check inter 5s
