1

Here is problem:

1) I have a RabbitMQ on Juju.

2) I have a charm which tries to use RabbitMQ, written in Java (I'll call it myCharm).

3) myCharm needs Hostname or IP address of RabbitMQ.

How can I find the IP address or hostname of RabbitMQ on my Juju?

Kevin Bowen
  • 20,055
  • 57
  • 82
  • 84
Rastin
  • 804

1 Answers1

1

You need to ensure your charm can relate to rabbitmq-server using the rabbitmq relation. For examples of other charms that already do this, take a look at https://manage.jujucharms.com/interfaces/rabbitmq.

Once you do that, deploying both rabbitmq charm and your charm and running juju add-relation rabbitmq mycharm will trigger a relation hook inside your charm where you can use the relation-get hostname command to get the IP.

For a much more detailed explanation of how relations work, check the excellent link Jorge Castro provided in the comment above.

dimitern
  • 2,023
  • 12
  • 21