Skip to content
This repository has been archived by the owner on Jun 1, 2020. It is now read-only.

Commit

Permalink
Merge pull request #53 from mitchellwrosen/develop
Browse files Browse the repository at this point in the history
Expose search option
  • Loading branch information
hectcastro authored Oct 3, 2016
2 parents fca6e78 + 28762d8 commit 787c1ce
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Jeff Zellner (@sofuture)
Waldemar Hummer (@whummer)
Eduardo Colabardini (@ecolabardini)
@chapsuk
Scott Wiersdorf (@scottw)
Scott Wiersdorf (@scottw)
Mitchell Rosen (@mitchellwrosen)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ $ make build
- `DOCKER_RIAK_PROTO_BUF_PORT_OFFSET` - Optional port offset (default: `100`)
- `DOCKER_RIAK_BACKEND` - Optional Riak backend to use (default: `bitcask`)
- `DOCKER_RIAK_STRONG_CONSISTENCY` - Enables strong consistency subsystem (values: `on` or `off`, default: `off`)
- `DOCKER_RIAK_SEARCH` - Enables search (values: `on` or `off`, default: `off`)

### Launch cluster

Expand Down
3 changes: 3 additions & 0 deletions bin/riak.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ sed -i.bak "s/storage_backend = \(.*\)/storage_backend = ${DOCKER_RIAK_BACKEND}/
# Ensure the strong consistency property is set correctly
sed -i.bak "s/## strong_consistency = \(.*\)/strong_consistency = ${DOCKER_RIAK_STRONG_CONSISTENCY}/" /etc/riak/riak.conf

# Ensure the search property is set correctly
sed -i.bak "s/search = \(.*\)/search = ${DOCKER_RIAK_SEARCH}/" /etc/riak/riak.conf

# Start Riak
exec /sbin/setuser riak "$(ls -d /usr/lib/riak/erts*)/bin/run_erl" "/tmp/riak" \
"/var/log/riak" "exec /usr/sbin/riak console"
11 changes: 7 additions & 4 deletions bin/start-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ function start_exited_riak_containers {
containers=$(docker ps -a -f "status=exited" --format "table {{.Names}}\t{{.ID}}\t{{.Image}}" | grep "hectcastro/riak" || :)
if [[ ! -z $containers ]]; then
echo "Bringing up stopped docker instances."
echo "$containers" | sort -V | while read -r container;
echo "$containers" | sort -V | while read -r container;
do
CONTAINER_ID=$(echo "$container" | awk '{print $2}')
CONTAINER_NAME=$(echo "$container" | awk '{print $1}')
echo -n "Starting ${CONTAINER_NAME}..."
docker start "${CONTAINER_ID}" > /dev/null 2>&1
docker start "${CONTAINER_ID}" > /dev/null 2>&1
echo " Completed"
done

Expand All @@ -20,7 +20,7 @@ function start_exited_riak_containers {
}

function start_new_riak_cluter {

# The default allows Docker to forward arbitrary ports on the VM for the Riak
# containers. Ports used by default are usually in the 49xx range.

Expand All @@ -34,7 +34,7 @@ function start_new_riak_cluter {
# defaults to 100.

DOCKER_RIAK_PROTO_BUF_PORT_OFFSET=${DOCKER_RIAK_PROTO_BUF_PORT_OFFSET:-100}

echo
echo "Bringing up cluster nodes:"
echo
Expand All @@ -54,6 +54,7 @@ function start_new_riak_cluter {
-e "DOCKER_RIAK_AUTOMATIC_CLUSTERING=${DOCKER_RIAK_AUTOMATIC_CLUSTERING}" \
-e "DOCKER_RIAK_BACKEND=${DOCKER_RIAK_BACKEND}" \
-e "DOCKER_RIAK_STRONG_CONSISTENCY=${DOCKER_RIAK_STRONG_CONSISTENCY}" \
-e "DOCKER_RIAK_SEARCH=${DOCKER_RIAK_SEARCH}" \
-p $publish_http_port \
-p $publish_pb_port \
--link "riak01:seed" \
Expand All @@ -64,6 +65,7 @@ function start_new_riak_cluter {
-e "DOCKER_RIAK_AUTOMATIC_CLUSTERING=${DOCKER_RIAK_AUTOMATIC_CLUSTERING}" \
-e "DOCKER_RIAK_BACKEND=${DOCKER_RIAK_BACKEND}" \
-e "DOCKER_RIAK_STRONG_CONSISTENCY=${DOCKER_RIAK_STRONG_CONSISTENCY}" \
-e "DOCKER_RIAK_SEARCH=${DOCKER_RIAK_SEARCH}" \
-p $publish_http_port \
-p $publish_pb_port \
--name "riak${index}" \
Expand Down Expand Up @@ -107,6 +109,7 @@ fi
DOCKER_RIAK_CLUSTER_SIZE=${DOCKER_RIAK_CLUSTER_SIZE:-5}
DOCKER_RIAK_BACKEND=${DOCKER_RIAK_BACKEND:-bitcask}
DOCKER_RIAK_STRONG_CONSISTENCY=${DOCKER_RIAK_STRONG_CONSISTENCY:-off}
DOCKER_RIAK_SEARCH=${DOCKER_RIAK_SEARCH:-off}

if docker ps -a | grep "hectcastro/riak" >/dev/null; then
echo ""
Expand Down

0 comments on commit 787c1ce

Please sign in to comment.