Skip to content

Instantly share code, notes, and snippets.

@lazypower
Last active August 29, 2015 14:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lazypower/542b9a62321f3e806daa to your computer and use it in GitHub Desktop.
Save lazypower/542b9a62321f3e806daa to your computer and use it in GitHub Desktop.
Restoring a Juju Environment when every last IP has changed

How to restore connectivity in a Juju Environment when EVERY IP has changed

Restoring connectivity to the state server from your client workstation

You will need to edit the jenv that juju created for the environment during juju bootstrap which will be located: $JUJU_HOME/environments/<environment_name>.jenv

The jenv has a yaml file format, so be familiar with that so you know what to look for:

state-servers:
- 173.173.4.187:17070
- 172.187.3.21:17070

Each line item below state-servers will need to be updated with the new state servers address. You may have one or more listed here depending on if you did juju ensure-availability - which will turn a single node state server into a High Availability state server.

Restoring connectivity to the state server from juju-agents

There will be 2 or more configuration files to edit per agent.

  • 1 for the machine
  • 1 for each unit-agent of service you deploy to the machine

Given the scenario:

juju deploy elasticsearch

You will have 2 files to edit - the Machine conf, and the elasticsearch conf. If you have co-located any services on the machine you will have an additional config per service added to the machine. (Dont forget about KVM and LXC containers, as this also increases the number of conf files to edit, and will reside in that services container)

You will find the Machine configuration in /var/lib/juju/agents/machine-1/agent.conf You will find the service configuration in /var/lib/juju/agents/unit-elasticsearch-0/unit.conf

then kill jujud and let upstart restart it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment