9/8/2023 0 Comments Airflow docker connection![]() ![]() In this example amq will be a defined host in the container. In addition Docker adds a host entry for the source container to the /etc/hosts file. Now you have access to the IP and Port of the rabbitmq container because docker automatically added some environmental variables: $AMQ_PORT_5672_TCP_ADDR You can use the link parameter to map a container (we use the name here, the id would be ok too): docker run -link rabbitmq:amq -i -t markellul/celery /bin/bash Note that i also used the new "name" feature which makes life a litte bit easier: docker run -name rabbitmq -d -p :5672 markellul/rabbitmq /usr/sbin/rabbitmq-server There is a new feature in Docker 0.6.5 called linking, which is meant to help the communication between docker containers.įirst, create your rabbitmq container as usual. Now, both containers are in the same network and can communicate with each other.Ī very detailed user guide can be found at Work with networks: Connect containers. Then you create a network (last parameter is your network name): docker network create -d bridge -subnet 172.25.0.0/16 mynetworkĬonnect the containers to your newly created network: docker network connect mynetwork rabbitmq It works quite similar to virtual networks and has a wider feature set than the old way of linking.įirst you create your named containers: docker run -name rabbitmq -d -p :5672 markellul/rabbitmq /usr/sbin/rabbitmq-serverĭocker run -name celery -it markellul/celery /bin/bash ![]() ![]() The new way to do link containers is docker network connect. I have tried using 127.0.0.1 and localhost both.ĭirect links are deprecated now. However, I am not able to connect my airflow scheduler to rabbitMQ. I am able to build images using docker compose. RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG" Where I am using broker_url = and celery_result_backend = docker compose file is as follows version: '3' Airflow.cfg file is used to config airflow. In airflow I am building airflow webserver, airflow scheduler, airflow worker and airflow flower. And I am able to access rabbitMQ UI, and API. I am trying to build my airflow using docker and rabbitMQ. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |