Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: cloudant/bigcouch
...
head fork: cloudant/bigcouch
  • 3 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
4 .gitignore
View
@@ -8,6 +8,7 @@
erl_crash.dump
# building
+deps/
apps/*/ebin/
rel/dbcore
rel/bigcouch.config
@@ -28,4 +29,5 @@ apps/couch/test/temp*
# dev
rel/dev*
-rel/tmpdata
+rel/logs*
+rel/tmpdata
2  rebar.config
View
@@ -25,6 +25,8 @@
{tag, "2.0.4"}}},
{mem3, ".*", {git, "https://github.com/cloudant/mem3.git",
{tag, "2.0.0"}}},
+ {arbiter, ".*", {git, "git@github.com:cloudant/arbiter.git",
+ {branch, "master"}}},
{chttpd, ".*", {git, "https://github.com/cloudant/chttpd.git",
{tag, "1.4.3"}}}
]}.
29 rel/boot_dev_cluster.sh
View
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Make log directory
+mkdir -p ./rel/logs/
+
+# Start each node
+./rel/dev1/bin/bigcouch > ./rel/logs/bigcouch1.log 2>&1 &
+DB1_PID=$!
+
+./rel/dev2/bin/bigcouch > ./rel/logs/bigcouch2.log 2>&1 &
+DB2_PID=$!
+
+./rel/dev3/bin/bigcouch > ./rel/logs/bigcouch3.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 -s localhost:15986/nodes/dev2@127.0.0.1 -X PUT -d '{}' > /dev/null 2>&1
+curl -s localhost:15986/nodes/dev3@127.0.0.1 -X PUT -d '{}' > /dev/null 2>&1
+curl -s localhost:5984/_membership | python -m json.tool
+
+
+trap "kill $DB1_PID $DB2_PID $DB3_PID $HP_PID" SIGINT SIGTERM SIGHUP
+
+wait
31 rel/haproxy.cfg
View
@@ -0,0 +1,31 @@
+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
+ bind *:5984
+ default_backend servers
+
+backend servers
+ server server1 127.0.0.1:15984 check inter 5s
+ server server2 127.0.0.1:25984 check inter 5s
+ server server3 127.0.0.1:35984 check inter 5s
22 rel/link_dev.sh
View
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+
+mklinks() {
+ for node in `ls -d rel/dev?`; do
+ app=`basename $1`
+ apppath=`ls -d $node/lib/$app*`
+
+ rm -rf $apppath/ebin
+ rm -rf $apppath/include
+ rm -rf $apppath/priv
+
+ ln -s $PWD/$1/ebin $apppath/ebin 2>/dev/null
+ ln -s $PWD/$1/include $apppath/include 2>/dev/null
+ ln -s $PWD/$1/priv $apppath/priv 2>/dev/null
+ done
+}
+
+for dir in `ls -d deps/*`; do
+ mklinks $dir
+done
+
+mklinks apps/couch
2  rel/reltool.config
View
@@ -31,6 +31,7 @@
rexi,
fabric,
mem3,
+ arbiter,
chttpd
]},
{rel, "start_clean", "", [kernel, stdlib]},
@@ -45,6 +46,7 @@
{app, rexi, [{incl_cond, include}]},
{app, fabric, [{incl_cond, include}]},
{app, mem3, [{incl_cond, include}]},
+ {app, arbiter, [{incl_cond, include}]},
{app, couch, [{incl_cond, include}]},
{app, chttpd, [{incl_cond, include}]}
]}.
22 rel/remsh
View
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+if [ -z $NODE ]; then
+ if [ -z $1 ]; then
+ NODE=1
+ else
+ NODE=$1
+ fi
+fi
+
+if [ -z $HOST ]; then
+ HOST="127.0.0.1"
+fi
+
+VSN=`grep rel.*bigcouch rel/reltool.config | awk '{print $3}'`
+VSN=`echo $VSN | sed -e 's/^\"//g' -e 's/\",$//g'`
+
+NAME="remsh$$@$HOST"
+NODE="dev$NODE@$HOST"
+BOOT=./rel/dev1/releases/$VSN/start_clean
+COOKIE=monster
+erl -name $NAME -remsh $NODE -hidden -boot $BOOT

No commit comments for this range

Something went wrong with that request. Please try again.