This repository has been archived by the owner on May 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from goncalotomas/multi-fmk2
Implement scripts to start multiple replicas of FMKe
- Loading branch information
Showing
24 changed files
with
582 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,7 @@ erl_crash.dump | |
.rebar | ||
logs | ||
_build | ||
deps/ | ||
TEST-* | ||
rebar3.crashdump | ||
tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
export RELX_REPLACE_OS_VARS=true | ||
i=$1 | ||
echo "stopping FMKe instances..." | ||
./bin/stop-nodes.sh ${i} | ||
echo "cleanning old FMKe releases and building new ones..." | ||
./bin/build-releases.sh ${i} | ||
echo "launching FMKe releases..." | ||
./bin/launch-nodes.sh ${i} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
export RELX_REPLACE_OS_VARS=true | ||
make relclean | ||
for i in `seq 1 $1`; | ||
do | ||
./rebar3 release -n fmk${i} | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/bash | ||
|
||
# HTTP port. | ||
if [ -z "$HTTP_PORT" ]; then | ||
export HTTP_PORT=9090 | ||
fi | ||
|
||
# HTTP IP address. | ||
if [ -z "$IP" ]; then | ||
export IP="127.0.0.1" | ||
fi | ||
|
||
# Antidote instance port. | ||
if [ -z "$ANTIDOTE_PB_PORT" ]; then | ||
export ANTIDOTE_PB_PORT=8087 | ||
fi | ||
|
||
# Antidote instance IP address. | ||
if [ -z "$ANTIDOTE_ADDRESS" ]; then | ||
export ANTIDOTE_ADDRESS="127.0.0.1" | ||
fi | ||
|
||
# Receive the host name from the parameters | ||
if [ -z "$INSTANCE_NAME" ]; then | ||
export INSTANCE_NAME=fmk | ||
fi | ||
|
||
# Choose the hostname for the epmd long name if the hostname exists | ||
# and if it resolves through the resolver; using a resolvable name | ||
# that's only resolvable with resolv.conf won't work for long names. | ||
if [ ! -z "$HOSTNAME" ]; then | ||
if /usr/bin/dig ${HOSTNAME} | grep -q 'NXDOMAIN' | ||
export NODE_NAME=${INSTANCE_NAME}@${HOSTNAME} | ||
then | ||
export NODE_NAME=${INSTANCE_NAME}@${IP} | ||
fi | ||
fi | ||
# Else, default to IP. | ||
if [ -z "$NODE_NAME" ]; then | ||
export NODE_NAME=${INSTANCE_NAME}@${IP} | ||
fi | ||
# | ||
# # Handoff port. | ||
# export HANDOFF_PORT=${PORT1} | ||
# | ||
# # Protocol buffer port. | ||
# export PB_PORT=${PORT2} | ||
# | ||
# # Pub/sub port. | ||
# export PUBSUB_PORT=${PORT3} | ||
# | ||
# # Logeader port. | ||
# export LOGREADER_PORT=${PORT4} | ||
#fi | ||
|
||
# Assume 127.0.0.1 as bind host. | ||
if [ -z "$IP" ]; then | ||
echo "IP address not set; defaulting to 127.0.0.1." | ||
export IP=127.0.0.1 | ||
fi | ||
|
||
if [ -z "$NODE_NAME" ]; then | ||
export NODE_NAME=${INSTANCE_NAME}@${IP} | ||
fi | ||
|
||
if [ -z "$COOKIE" ]; then | ||
export COOKIE=antidote | ||
fi | ||
|
||
export RELX_REPLACE_OS_VARS=true | ||
|
||
echo "PORT0: ${PORT0}" | ||
echo "PORT1: ${PORT1}" | ||
echo "PORT2: ${PORT2}" | ||
echo "PORT3: ${PORT3}" | ||
echo "PORT4: ${PORT4}" | ||
|
||
|
||
echo "NODE_NAME: ${NODE_NAME}" | ||
echo "COOKIE: ${COOKIE}" | ||
echo "IP: ${IP}" | ||
echo "IP: ${IP}" | ||
echo "HTTP_PORT: ${HTTP_PORT}" | ||
|
||
RELNAME="`dirname \"$0\"`"/${INSTANCE_NAME} | ||
exec ${RELNAME} "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
export RELX_REPLACE_OS_VARS=true | ||
for i in `seq 1 $1`; | ||
do | ||
HTTP_PORT=9${i}90 INSTANCE_NAME=fmk${i} ANTIDOTE_PB_PORT=8${i}87 COOKIE=antidote _build/default/rel/fmk${i}/bin/env foreground & | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
export RELX_REPLACE_OS_VARS=true | ||
for i in `seq 1 $1`; | ||
do | ||
_build/default/rel/fmk${i}/bin/fmk${i} stop | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%% | ||
%% etc/vm.args | ||
%% | ||
{node, "fmk@127.0.0.1"}. | ||
{cookie, "antidote"}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,10 @@ | |
antidote_pb, | ||
riak_pb, | ||
poolboy, | ||
cowboy | ||
cowboy, | ||
jsx | ||
]}, | ||
{env,[]}, | ||
|
||
{modules, []}, | ||
|
||
{maintainers, []}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[{"test" : {"id" : "FMKeTest", | ||
"phases" : ["Phase1"], | ||
"plugins" : ["LocalFMKeNode"] | ||
}}, | ||
|
||
{"plugin" : {"id" : "LocalFMKeNode", | ||
"plugin_info" : {"http-plugin" : {"servers" : [{"host" : "localhost", | ||
"port" : 9090, | ||
"ssl" : false} | ||
], | ||
"stats_per_url" : true | ||
}} | ||
}}, | ||
|
||
{"phase" : {"id" : "Phase1", | ||
"arrival_rate" : 10, | ||
"duration" : 60, | ||
"concurrent_scenarios" : 250, | ||
"rate" : 500, | ||
"scenarios" : [{"Scenario1" : 1}]}}, | ||
|
||
{"scenario" : {"id" : "Scenario1", | ||
"keepalive" : true, | ||
"actions" : [ {"http-request" : {"plugin_id" : "LocalFMKeNode", | ||
"method" : "GET", | ||
"path" : "/patients/1" | ||
} | ||
}]}} | ||
] |
Oops, something went wrong.