Commit 635047b3 authored by daidekun's avatar daidekun

完成mq初始化,从15环境同步rabbitmq

parent 060564ff
...@@ -25,11 +25,11 @@ RUN apt-get update \ ...@@ -25,11 +25,11 @@ RUN apt-get update \
WORKDIR /home/quant_group/rabbitmq WORKDIR /home/quant_group/rabbitmq
# Add scripts # Add scripts
ADD scripts ./scripts ADD scripts /scripts
RUN chmod +x ./scripts/*.sh RUN chmod +x /scripts/*.sh
RUN touch /.firstrun RUN touch /.firstrun
ENTRYPOINT ["./scripts/docker-entrypoint.sh"] CMD ["/scripts/docker-entrypoint.sh"]
EXPOSE 5672 EXPOSE 5672
EXPOSE 15672 EXPOSE 15672
......
#!/bin/bash #!/bin/bash
# Initialize first run
if [[ -e /.firstrun ]]; then if [[ -e /.firstrun ]]; then
/scripts/first_run.sh /scripts/init_script.sh
fi fi
cd /home/quant_group/rabbitmq
touch nohup.out
echo "Starting RabbitMQ..." echo "Starting RabbitMQ..."
nohup /usr/sbin/rabbitmq-server & nohup /usr/sbin/rabbitmq-server > /tmp/rabbitmq.out &
echo "sleep 10" echo "sleep 10"
sleep 10 sleep 10
echo "get definitions from 192.168.4.15" echo "get definitions from 192.168.4.15"
response=$(curl -X GET -H "Authorization: Basic cWE6cWF0ZXN0" "http://192.168.4.15:15672/api/definitions") response=$(curl -X GET -H "Authorization: Basic cWE6cWF0ZXN0" "http://192.168.4.15:15672/api/definitions")
curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic cWE6cWF0ZXN0" -d $response "http://localhost:15672/api/definitions"
echo "curl post" tail -f /tmp/rabbitmq.out
curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic cWE6cWF0ZXN0" -d '$response' "http://localhost:15672/api/definitions" \ No newline at end of file
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment