* Using CLI and GUI, deployment fails when I try to create relations between ES and Kibana or ES and Logstash Indexer.
* This was tested on EC2
* To reproduce, simply deploy the latest versions of ES and Kibana and try to create the relation
The issue is that on ec2, private-address is sent as a private dns entry, whereas the firewall rules require an IP. The attached branch fixes this.
The log looks like:
unit-kibana-0: 2014-10-28 10:56:27 INFO juju-log rest:68: elasticsearch/0 joined
unit-kibana-0: 2014-10-28 10:56:27 INFO rest-relation-changed ++ relation-get cluster-name
unit-kibana-0: 2014-10-28 10:56:28 INFO rest-relation-changed + '[' -z '' ']'
unit-kibana-0: 2014-10-28 10:56:28 INFO rest-relation-changed + exit 0
unit-kibana-0: 2014-10-28 10:56:28 INFO juju-log rest:68: elasticsearch/1 joined
unit-kibana-0: 2014-10-28 10:56:28 INFO rest-relation-changed ++ relation-get cluster-name
unit-kibana-0: 2014-10-28 10:56:28 INFO rest-relation-changed + '[' -z '' ']'
unit-kibana-0: 2014-10-28 10:56:28 INFO rest-relation-changed + exit 0
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined PLAY [localhost] **************************************************************
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined GATHERING FACTS ***************************************************************
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined ok: [localhost]
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined TASK: [Update ufw config to avoid error] **************************************
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined changed: [localhost]
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined TASK: [Reset firewall] ********************************************************
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined changed: [localhost]
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined TASK: [Turn on fire wall with logging.] ***************************************
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined changed: [localhost]
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined TASK: [Open the firewall for all clients] *************************************
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined skipping: [localhost] => (item={'value': {'private-address': 'ip-10-55-75-173.eu-west-1.compute.internal'}, 'key': 'elasticsearch/1'})
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined failed: [localhost] => (item={'value': {'private-address': 'ip-10-84-12-135.eu-west-1.compute.internal', '__unit__': 'kibana/0', '__relid__': 'client:68'}, 'key': 'kibana/0'}) => {"failed": true, "item": {"key": "kibana/0", "value": {"__relid__": "client:68", "__unit__": "kibana/0", "private-address": "ip-10-84-12-135.eu-west-1.compute.internal"}}}
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined msg: ERROR: Bad source address
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined FATAL: all hosts have already failed -- aborting
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined PLAY RECAP ********************************************************************
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined localhost : ok=4 changed=3 unreachable=0 failed=1
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined Traceback (most recent call last):
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined File "/var/lib/juju/agents/unit-elasticsearch-1/charm/hooks/client-relation-joined", line 42, in <module>
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined hooks.execute(sys.argv)
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined File "/var/lib/juju/agents/unit-elasticsearch-1/charm/hooks/charmhelpers/contrib/ansible/__init__.py", line 165, in execute
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined self.playbook_path, tags=[hook_name])
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined File "/var/lib/juju/agents/unit-elasticsearch-1/charm/hooks/charmhelpers/contrib/ansible/__init__.py", line 112, in apply_playbook
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined subprocess.check_call(call)
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined raise CalledProcessError(retcode, cmd)
unit-elasticsearch-1: 2014-10-28 10:56:34 INFO client-relation-joined subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'playbook.yaml', '--tags', 'client-relation-joined']' returned non-zero exit status 2
unit-elasticsearch-1: 2014-10-28 10:56:34 ERROR juju.worker.uniter uniter.go:486 hook failed: exit status 1
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined PLAY [localhost] **************************************************************
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined GATHERING FACTS ***************************************************************
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined ok: [localhost]
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined TASK: [Update ufw config to avoid error] **************************************
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined changed: [localhost]
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined TASK: [Reset firewall] ********************************************************
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined changed: [localhost]
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined TASK: [Turn on fire wall with logging.] ***************************************
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined changed: [localhost]
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined TASK: [Open the firewall for all clients] *************************************
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined skipping: [localhost] => (item={'value': {'private-address': 'ip-10-89-140-57.eu-west-1.compute.internal'}, 'key': 'elasticsearch/0'})
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined failed: [localhost] => (item={'value': {'private-address': 'ip-10-84-12-135.eu-west-1.compute.internal', '__unit__': 'kibana/0', '__relid__': 'client:68'}, 'key': 'kibana/0'}) => {"failed": true, "item": {"key": "kibana/0", "value": {"__relid__": "client:68", "__unit__": "kibana/0", "private-address": "ip-10-84-12-135.eu-west-1.compute.internal"}}}
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined msg: ERROR: Bad source address
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined FATAL: all hosts have already failed -- aborting
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined PLAY RECAP ********************************************************************
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined localhost : ok=4 changed=3 unreachable=0 failed=1
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined Traceback (most recent call last):
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined File "/var/lib/juju/agents/unit-elasticsearch-0/charm/hooks/client-relation-joined", line 42, in <module>
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined hooks.execute(sys.argv)
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined File "/var/lib/juju/agents/unit-elasticsearch-0/charm/hooks/charmhelpers/contrib/ansible/__init__.py", line 165, in execute
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined self.playbook_path, tags=[hook_name])
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined File "/var/lib/juju/agents/unit-elasticsearch-0/charm/hooks/charmhelpers/contrib/ansible/__init__.py", line 112, in apply_playbook
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined subprocess.check_call(call)
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined raise CalledProcessError(retcode, cmd)
unit-elasticsearch-0: 2014-10-28 10:56:37 INFO client-relation-joined subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'playbook.yaml', '--tags', 'client-relation-joined']' returned non-zero exit status 2
unit-elasticsearch-0: 2014-10-28 10:56:37 ERROR juju.worker.uniter uniter.go:486 hook failed: exit status 1
jcastro pointed out that this bug https:/ /code.launchpad .net/~s- matyukevich/ charms/ trusty/ elasticsearch/ elasticsearch- dns-bug- fix/+merge/ 239547
refers to a similar situation. Applying the proposed patch fixes the issue.
Marking as dup.