forked from paunin/docker-rabbitmq-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dmitriy Paunin
committed
Oct 25, 2016
1 parent
17cfd1c
commit 7a76e5d
Showing
5 changed files
with
31 additions
and
73 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,9 +1,21 @@ | ||
FROM relaxart/rabbitmq-base | ||
MAINTAINER Ilya Isaev [email protected] | ||
FROM ubuntu | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y wget && \ | ||
echo "deb http://www.rabbitmq.com/debian/ testing main" | tee /etc/apt/sources.list.d/rabbitmq.list && \ | ||
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | apt-key add - && \ | ||
apt-get update && \ | ||
apt-get install -y rabbitmq-server && \ | ||
/usr/sbin/rabbitmq-plugins enable --offline rabbitmq_management rabbitmq_management_agent rabbitmq_management_visualiser rabbitmq_federation rabbitmq_federation_management | ||
|
||
ENV DOCKERIZE_VERSION v0.2.0 | ||
|
||
ADD rabbitmq.config /etc/rabbitmq/rabbitmq.config | ||
ADD erlang.cookie /var/lib/rabbitmq/.erlang.cookie | ||
|
||
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | ||
|
||
RUN chmod u+rw /etc/rabbitmq/rabbitmq.config && \ | ||
chown rabbitmq:rabbitmq /var/lib/rabbitmq/.erlang.cookie && \ | ||
chmod 400 /var/lib/rabbitmq/.erlang.cookie && \ | ||
|
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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$CLUSTERED" ]; then | ||
# if not clustered then start it normally as if it is a single server | ||
/usr/sbin/rabbitmq-server | ||
/usr/sbin/rabbitmq-server -detached | ||
else | ||
if [ -z "$CLUSTER_WITH" ]; then | ||
# If clustered, but cluster with is not specified then again start normally, could be the first server in the | ||
# cluster | ||
/usr/sbin/rabbitmq-server | ||
/usr/sbin/rabbitmq-server -detached | ||
else | ||
#clean folder with data before joining cluster | ||
rm -rf /var/lib/rabbitmq/* | ||
dockerize -wait tcp://$CLUSTER_WITH:25672 -timeout 250s | ||
|
||
/usr/sbin/rabbitmq-server -detached | ||
|
||
rabbitmqctl stop_app | ||
if [ -z "$RAM_NODE" ]; then | ||
rabbitmqctl join_cluster rabbit@$CLUSTER_WITH | ||
else | ||
rabbitmqctl join_cluster --ram rabbit@$CLUSTER_WITH | ||
fi | ||
rabbitmqctl start_app | ||
|
||
# Tail to keep the a foreground process active.. | ||
tail -f /var/log/rabbitmq/rabbit\@$HOSTNAME.log | ||
fi | ||
fi | ||
|
||
sleep 60 && echo "Ilya we need to fix logging..." | ||
tail -f /var/log/rabbitmq/* |