Skip to content
This repository
  • 3 commits
  • 7 files changed
  • 0 comments
  • 1 contributor
4 .gitignore
@@ -8,6 +8,7 @@
8 8 erl_crash.dump
9 9
10 10 # building
  11 +deps/
11 12 apps/*/ebin/
12 13 rel/dbcore
13 14 rel/bigcouch.config
@@ -28,4 +29,5 @@ apps/couch/test/temp*
28 29
29 30 # dev
30 31 rel/dev*
31   -rel/tmpdata
  32 +rel/logs*
  33 +rel/tmpdata
2  rebar.config
@@ -25,6 +25,8 @@
25 25 {tag, "2.0.4"}}},
26 26 {mem3, ".*", {git, "https://github.com/cloudant/mem3.git",
27 27 {tag, "2.0.0"}}},
  28 + {arbiter, ".*", {git, "git@github.com:cloudant/arbiter.git",
  29 + {branch, "master"}}},
28 30 {chttpd, ".*", {git, "https://github.com/cloudant/chttpd.git",
29 31 {tag, "1.4.3"}}}
30 32 ]}.
29 rel/boot_dev_cluster.sh
... ... @@ -0,0 +1,29 @@
  1 +#!/bin/bash
  2 +
  3 +# Make log directory
  4 +mkdir -p ./rel/logs/
  5 +
  6 +# Start each node
  7 +./rel/dev1/bin/bigcouch > ./rel/logs/bigcouch1.log 2>&1 &
  8 +DB1_PID=$!
  9 +
  10 +./rel/dev2/bin/bigcouch > ./rel/logs/bigcouch2.log 2>&1 &
  11 +DB2_PID=$!
  12 +
  13 +./rel/dev3/bin/bigcouch > ./rel/logs/bigcouch3.log 2>&1 &
  14 +DB3_PID=$!
  15 +
  16 +/usr/local/sbin/haproxy -f rel/haproxy.cfg > ./rel/logs/haproxy.log 2>&1 &
  17 +HP_PID=$!
  18 +
  19 +sleep 2
  20 +
  21 +# Connect the cluster
  22 +curl -s localhost:15986/nodes/dev2@127.0.0.1 -X PUT -d '{}' > /dev/null 2>&1
  23 +curl -s localhost:15986/nodes/dev3@127.0.0.1 -X PUT -d '{}' > /dev/null 2>&1
  24 +curl -s localhost:5984/_membership | python -m json.tool
  25 +
  26 +
  27 +trap "kill $DB1_PID $DB2_PID $DB3_PID $HP_PID" SIGINT SIGTERM SIGHUP
  28 +
  29 +wait
31 rel/haproxy.cfg
... ... @@ -0,0 +1,31 @@
  1 +global
  2 + maxconn 512
  3 + spread-checks 5
  4 +
  5 +defaults
  6 + mode http
  7 + log global
  8 + monitor-uri /_haproxy_health_check
  9 + option log-health-checks
  10 + option httplog
  11 + balance roundrobin
  12 + option forwardfor
  13 + option redispatch
  14 + retries 4
  15 + option http-server-close
  16 + timeout client 150000
  17 + timeout server 3600000
  18 + timeout connect 500
  19 +
  20 + stats enable
  21 + stats scope .
  22 + stats uri /_stats
  23 +
  24 +frontend http-in
  25 + bind *:5984
  26 + default_backend servers
  27 +
  28 +backend servers
  29 + server server1 127.0.0.1:15984 check inter 5s
  30 + server server2 127.0.0.1:25984 check inter 5s
  31 + server server3 127.0.0.1:35984 check inter 5s
22 rel/link_dev.sh
... ... @@ -0,0 +1,22 @@
2  rel/reltool.config
@@ -31,6 +31,7 @@
31 31 rexi,
32 32 fabric,
33 33 mem3,
  34 + arbiter,
34 35 chttpd
35 36 ]},
36 37 {rel, "start_clean", "", [kernel, stdlib]},
@@ -45,6 +46,7 @@
45 46 {app, rexi, [{incl_cond, include}]},
46 47 {app, fabric, [{incl_cond, include}]},
47 48 {app, mem3, [{incl_cond, include}]},
  49 + {app, arbiter, [{incl_cond, include}]},
48 50 {app, couch, [{incl_cond, include}]},
49 51 {app, chttpd, [{incl_cond, include}]}
50 52 ]}.
22 rel/remsh
... ... @@ -0,0 +1,22 @@
  1 +#!/bin/bash
  2 +
  3 +if [ -z $NODE ]; then
  4 + if [ -z $1 ]; then
  5 + NODE=1
  6 + else
  7 + NODE=$1
  8 + fi
  9 +fi
  10 +
  11 +if [ -z $HOST ]; then
  12 + HOST="127.0.0.1"
  13 +fi
  14 +
  15 +VSN=`grep rel.*bigcouch rel/reltool.config | awk '{print $3}'`
  16 +VSN=`echo $VSN | sed -e 's/^\"//g' -e 's/\",$//g'`
  17 +
  18 +NAME="remsh$$@$HOST"
  19 +NODE="dev$NODE@$HOST"
  20 +BOOT=./rel/dev1/releases/$VSN/start_clean
  21 +COOKIE=monster
  22 +erl -name $NAME -remsh $NODE -hidden -boot $BOOT

No commit comments for this range

Something went wrong with that request. Please try again.