Permalink
Browse files

move EE pr 90/99 to OS

  • Loading branch information...
1 parent 1bd7f43 commit 4f8f0f88fc30d698bf5ccc95731f98b33797195a @evanmcc evanmcc committed Nov 9, 2012
Showing with 164 additions and 17 deletions.
  1. +1 −0 .gitignore
  2. +17 −5 Makefile
  3. +29 −0 rel/gen_dev
  4. +13 −3 rel/vars/dev1_vars.config
  5. +13 −3 rel/vars/dev2_vars.config
  6. +13 −3 rel/vars/dev3_vars.config
  7. +13 −3 rel/vars/dev4_vars.config
  8. +65 −0 rel/vars/dev_vars.config.src
View
@@ -1,4 +1,5 @@
deps/*
rel/riak
+rel/vars/dev*_vars.config
dev/
ebin/
View
@@ -45,16 +45,28 @@ relclean:
##
## Developer targets
##
-stagedevrel: dev1 dev2 dev3 dev4
- $(foreach dev,$^,\
- $(foreach dep,$(wildcard deps/*), rm -rf dev/$(dev)/lib/$(shell basename $(dep))-* && ln -sf $(abspath $(dep)) dev/$(dev)/lib;))
+## devN - Make a dev build for node N
+## stagedevN - Make a stage dev build for node N (symlink libraries)
+## devrel - Make a dev build for 1..$DEVNODES
+## stagedevrel Make a stagedev build for 1..$DEVNODES
+##
+## Example, make a 68 node devrel cluster
+## make stagedevrel DEVNODES=68
+
+.PHONY : stagedevrel devrel
+DEVNODES=6
-devrel: dev1 dev2 dev3 dev4
+$(eval stagedevrel : $(foreach n,$(shell seq 1 $(DEVNODES)),dev$(n)))
+$(eval devrel : $(foreach n,$(shell seq 1 $(DEVNODES)),dev$(n)))
-dev1 dev2 dev3 dev4: all
+dev% :
mkdir -p dev
+ rel/gen_dev $@ rel/vars/dev_vars.config.src rel/vars/$@_vars.config
(cd rel && ../rebar generate target_dir=../dev/$@ overlay_vars=vars/$@_vars.config)
+stagedev% : dev%
+ $(foreach dep,$(wildcard deps/*), rm -rf dev/$^/lib/$(shell basename $(dep))-* && ln -sf $(abspath $(dep)) dev/$^/lib;))
+
devclean: clean
rm -rf dev
View
@@ -0,0 +1,29 @@
+#! /bin/bash
+#
+# gen_dev dev4 vars.src vars
+#
+# Generate an overlay config for devNNN from vars.src and write to vars
+#
+
+NAME=$1
+TEMPLATE=$2
+VARFILE=$3
+
+## Allocate 10 ports per node
+## .
+## .7 - http
+NODE="$NAME@127.0.0.1"
+
+NUMBER=${NAME##dev}
+BASE=$((10000 + 10 * $NUMBER))
+SNMPPORT=$(($BASE))
+PBPORT=$(($BASE + 7))
+WEBPORT=$(($BASE + 8))
+HANDOFFPORT=$(($BASE + 9))
+
+echo "Generating $NAME - node='$NODE' snmp=$SNMPPORT pbc=$PBPORT http=$WEBPORT handoff=$HANDOFFPORT"
+sed -e "s/@NODE@/$NODE/" \
+ -e "s/@SNMPPORT@/$SNMPPORT/" \
+ -e "s/@PBPORT@/$PBPORT/" \
+ -e "s/@WEBPORT@/$WEBPORT/" \
+ -e "s/@HANDOFFPORT@/$HANDOFFPORT/" < $TEMPLATE > $VARFILE
@@ -12,16 +12,21 @@
%% etc/app.config
%%
{web_ip, "127.0.0.1"}.
-{web_port, 8091}.
-{handoff_port, 8101}.
+{cluster_mgr_ip, "127.0.0.1"}.
+{cluster_mgr_port, 9088}.
+{web_port, 10018}.
+{handoff_port, 10019}.
{pb_ip, "127.0.0.1"}.
-{pb_port, 8081}.
+{pb_port, 10017}.
{ring_state_dir, "{{platform_data_dir}}/ring"}.
{bitcask_data_root, "{{platform_data_dir}}/bitcask"}.
{leveldb_data_root, "{{platform_data_dir}}/leveldb"}.
{sasl_error_log, "{{platform_log_dir}}/sasl-error.log"}.
{sasl_log_dir, "{{platform_log_dir}}/sasl"}.
{mapred_queue_dir, "{{platform_data_dir}}/mr_queue"}.
+{repl_data_root, "{{platform_data_dir}}/riak_repl/"}.
+{snmp_agent_conf, "{{platform_etc_dir}}/snmp/agent/conf"}.
+{snmp_db_dir, "{{platform_data_dir}}/snmp/agent/db"}.
{merge_index_data_root, "{{platform_data_dir}}/merge_index"}.
%% lager
@@ -53,3 +58,8 @@
{runner_log_dir, "$RUNNER_BASE_DIR/log"}.
{pipe_dir, "/tmp/$RUNNER_BASE_DIR/"}.
{runner_user, ""}.
+
+%%
+%% etc/snmp/agent.conf
+%%
+{snmp_agent_port, 10010}.
@@ -12,16 +12,21 @@
%% etc/app.config
%%
{web_ip, "127.0.0.1"}.
-{web_port, 8092}.
-{handoff_port, 8102}.
+{cluster_mgr_ip, "127.0.0.1"}.
+{cluster_mgr_port, 9088}.
+{web_port, 10028}.
+{handoff_port, 10029}.
{pb_ip, "127.0.0.1"}.
-{pb_port, 8082}.
+{pb_port, 10027}.
{ring_state_dir, "{{platform_data_dir}}/ring"}.
{bitcask_data_root, "{{platform_data_dir}}/bitcask"}.
{leveldb_data_root, "{{platform_data_dir}}/leveldb"}.
{sasl_error_log, "{{platform_log_dir}}/sasl-error.log"}.
{sasl_log_dir, "{{platform_log_dir}}/sasl"}.
{mapred_queue_dir, "{{platform_data_dir}}/mr_queue"}.
+{repl_data_root, "{{platform_data_dir}}/riak_repl/"}.
+{snmp_agent_conf, "{{platform_etc_dir}}/snmp/agent/conf"}.
+{snmp_db_dir, "{{platform_data_dir}}/snmp/agent/db"}.
{merge_index_data_root, "{{platform_data_dir}}/merge_index"}.
%% lager
@@ -53,3 +58,8 @@
{runner_log_dir, "$RUNNER_BASE_DIR/log"}.
{pipe_dir, "/tmp/$RUNNER_BASE_DIR/"}.
{runner_user, ""}.
+
+%%
+%% etc/snmp/agent.conf
+%%
+{snmp_agent_port, 10020}.
@@ -12,16 +12,21 @@
%% etc/app.config
%%
{web_ip, "127.0.0.1"}.
-{web_port, 8093}.
-{handoff_port, 8103}.
+{cluster_mgr_ip, "127.0.0.1"}.
+{cluster_mgr_port, 9088}.
+{web_port, 10038}.
+{handoff_port, 10039}.
{pb_ip, "127.0.0.1"}.
-{pb_port, 8083}.
+{pb_port, 10037}.
{ring_state_dir, "{{platform_data_dir}}/ring"}.
{bitcask_data_root, "{{platform_data_dir}}/bitcask"}.
{leveldb_data_root, "{{platform_data_dir}}/leveldb"}.
{sasl_error_log, "{{platform_log_dir}}/sasl-error.log"}.
{sasl_log_dir, "{{platform_log_dir}}/sasl"}.
{mapred_queue_dir, "{{platform_data_dir}}/mr_queue"}.
+{repl_data_root, "{{platform_data_dir}}/riak_repl/"}.
+{snmp_agent_conf, "{{platform_etc_dir}}/snmp/agent/conf"}.
+{snmp_db_dir, "{{platform_data_dir}}/snmp/agent/db"}.
{merge_index_data_root, "{{platform_data_dir}}/merge_index"}.
%% lager
@@ -53,3 +58,8 @@
{runner_log_dir, "$RUNNER_BASE_DIR/log"}.
{pipe_dir, "/tmp/$RUNNER_BASE_DIR/"}.
{runner_user, ""}.
+
+%%
+%% etc/snmp/agent.conf
+%%
+{snmp_agent_port, 10030}.
@@ -12,16 +12,21 @@
%% etc/app.config
%%
{web_ip, "127.0.0.1"}.
-{web_port, 8094}.
-{handoff_port, 8104}.
+{cluster_mgr_ip, "127.0.0.1"}.
+{cluster_mgr_port, 9088}.
+{web_port, 10048}.
+{handoff_port, 10049}.
{pb_ip, "127.0.0.1"}.
-{pb_port, 8084}.
+{pb_port, 10047}.
{ring_state_dir, "{{platform_data_dir}}/ring"}.
{bitcask_data_root, "{{platform_data_dir}}/bitcask"}.
{leveldb_data_root, "{{platform_data_dir}}/leveldb"}.
{sasl_error_log, "{{platform_log_dir}}/sasl-error.log"}.
{sasl_log_dir, "{{platform_log_dir}}/sasl"}.
{mapred_queue_dir, "{{platform_data_dir}}/mr_queue"}.
+{repl_data_root, "{{platform_data_dir}}/riak_repl/"}.
+{snmp_agent_conf, "{{platform_etc_dir}}/snmp/agent/conf"}.
+{snmp_db_dir, "{{platform_data_dir}}/snmp/agent/db"}.
{merge_index_data_root, "{{platform_data_dir}}/merge_index"}.
%% lager
@@ -53,3 +58,8 @@
{runner_log_dir, "$RUNNER_BASE_DIR/log"}.
{pipe_dir, "/tmp/$RUNNER_BASE_DIR/"}.
{runner_user, ""}.
+
+%%
+%% etc/snmp/agent.conf
+%%
+{snmp_agent_port, 10040}.
@@ -0,0 +1,65 @@
+%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ft=erlang ts=4 sw=4 et
+
+%% Platform-specific installation paths
+{platform_bin_dir, "./bin"}.
+{platform_data_dir, "./data"}.
+{platform_etc_dir, "./etc"}.
+{platform_lib_dir, "./lib"}.
+{platform_log_dir, "./log"}.
+
+%%
+%% etc/app.config
+%%
+{web_ip, "127.0.0.1"}.
+{cluster_mgr_ip, "127.0.0.1"}.
+{cluster_mgr_port, 9088}.
+{web_port, @WEBPORT@}.
+{handoff_port, @HANDOFFPORT@}.
+{pb_ip, "127.0.0.1"}.
+{pb_port, @PBPORT@}.
+{ring_state_dir, "{{platform_data_dir}}/ring"}.
+{bitcask_data_root, "{{platform_data_dir}}/bitcask"}.
+{leveldb_data_root, "{{platform_data_dir}}/leveldb"}.
+{sasl_error_log, "{{platform_log_dir}}/sasl-error.log"}.
+{sasl_log_dir, "{{platform_log_dir}}/sasl"}.
+{mapred_queue_dir, "{{platform_data_dir}}/mr_queue"}.
+{repl_data_root, "{{platform_data_dir}}/riak_repl/"}.
+{snmp_agent_conf, "{{platform_etc_dir}}/snmp/agent/conf"}.
+{snmp_db_dir, "{{platform_data_dir}}/snmp/agent/db"}.
+{merge_index_data_root, "{{platform_data_dir}}/merge_index"}.
+
+%% lager
+{lager_handlers, "[ \
+ {lager_console_backend, info}, \
+ {lager_file_backend, [ \
+ {\"{{platform_log_dir}}/error.log\", error, 10485760, \"$D0\", 5}, \
+ {\"{{platform_log_dir}}/console.log\", info, 10485760, \"$D0\", 5} \
+ ]} \
+ ]"}.
+
+%% Javascript VMs
+{map_js_vms, 8}.
+{reduce_js_vms, 6}.
+{hook_js_vms, 2}.
+
+%%
+%% etc/vm.args
+%%
+{node, "@NODE@"}.
+{crash_dump, "{{platform_log_dir}}/erl_crash.dump"}.
+
+%%
+%% bin/riak
+%%
+{runner_script_dir, "$(cd ${0%/*} && pwd)"}.
+{runner_base_dir, "${RUNNER_SCRIPT_DIR%/*}"}.
+{runner_etc_dir, "$RUNNER_BASE_DIR/etc"}.
+{runner_log_dir, "$RUNNER_BASE_DIR/log"}.
+{pipe_dir, "/tmp/$RUNNER_BASE_DIR/"}.
+{runner_user, ""}.
+
+%%
+%% etc/snmp/agent.conf
+%%
+{snmp_agent_port, @SNMPPORT@}.

0 comments on commit 4f8f0f8

Please sign in to comment.