Updated Branches: refs/heads/1843-feature-bigcouch-dev-scripts [created] dcbb57098
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/dcbb5709 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/dcbb5709 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/dcbb5709 Branch: refs/heads/1843-feature-bigcouch-dev-scripts Commit: dcbb5709866e5939d9818dd99bef0dece93d3d11 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:34:07 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/dcbb5709/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/dcbb5709/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
