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
  • 19,395
  • 55
  • 76
  • 81
Rastin
  • 784
  • 2
  • 11
  • 25
  • 1
    Check out this question, if it doesn't answer your questions please edit your existing question with your specific question, thanks!: http://askubuntu.com/questions/504482/how-do-i-add-a-relationship-between-two-charms-to-pass-information-between-them/504581#504581 – Jorge Castro Aug 29 '14 at 03:11

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,015
  • 11
  • 21