Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to deploy a sharded MongoDB cluster on Amazon EC2, using the directions at http://manage.jujucharms.com/charms/precise/mongodb.

However (and I have tried this three times), my mongos unit always fails, with agent-state-info:

hook failed: "mongos-relation-changed"

Here's the output of juju status:

environment: amazon
machines:
  "0":
    agent-state: started
    agent-version: 1.16.6
    dns-name: ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com
    instance-id: i-e36159c2
    instance-state: running
    series: precise
    hardware: arch=amd64 cpu-cores=1 cpu-power=100 mem=1740M root-disk=8192M
  "1":
    agent-state: started
    agent-version: 1.16.6
    dns-name: ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com
    instance-id: i-b7645c96
    instance-state: running
    series: precise
    hardware: arch=amd64 cpu-cores=1 cpu-power=100 mem=1740M root-disk=8192M
  "2":
    agent-state: started
    agent-version: 1.16.6
    dns-name: ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com
    instance-id: i-d5645cf4
    instance-state: running
    series: precise
    hardware: arch=amd64 cpu-cores=1 cpu-power=100 mem=1740M root-disk=8192M
  "3":
    agent-state: started
    agent-version: 1.16.6
    dns-name: ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com
    instance-id: i-98665eb9
    instance-state: running
    series: precise
    hardware: arch=amd64 cpu-cores=1 cpu-power=100 mem=1740M root-disk=8192M
  "4":
    agent-state: started
    agent-version: 1.16.6
    dns-name: ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com
    instance-id: i-fa645cdb
    instance-state: running
    series: precise
    hardware: arch=amd64 cpu-cores=1 cpu-power=100 mem=1740M root-disk=8192M
services:
  configsvr:
    charm: cs:precise/mongodb-26
    exposed: false
    relations:
      configsvr:
      - mongos
      replica-set:
      - configsvr
    units:
      configsvr/0:
        agent-state: started
        agent-version: 1.16.6
        machine: "1"
        open-ports:
        - 27017/tcp
        - 27019/tcp
        - 27021/tcp
        - 28017/tcp
        - 28019/tcp
        public-address: ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com
  mongos:
    charm: cs:precise/mongodb-26
    exposed: true
    relations:
      mongos:
      - shard1
      - shard2
      mongos-cfg:
      - configsvr
      replica-set:
      - mongos
    units:
      mongos/0:
        agent-state: error
        agent-state-info: 'hook failed: "mongos-relation-changed"'
        agent-version: 1.16.6
        machine: "2"
        open-ports:
        - 27017/tcp
        - 27019/tcp
        - 28017/tcp
        public-address: ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com
  shard1:
    charm: cs:precise/mongodb-26
    exposed: true
    relations:
      database:
      - mongos
      replica-set:
      - shard1
    units:
      shard1/0:
        agent-state: started
        agent-version: 1.16.6
        machine: "3"
        open-ports:
        - 27017/tcp
        - 27019/tcp
        - 27021/tcp
        - 28017/tcp
        public-address: ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com
  shard2:
    charm: cs:precise/mongodb-26
    exposed: true
    relations:
      database:
      - mongos
      replica-set:
      - shard2
    units:
      shard2/0:
        agent-state: started
        agent-version: 1.16.6
        machine: "4"
        open-ports:
        - 27017/tcp
        - 27019/tcp
        - 27021/tcp
        - 28017/tcp
        public-address: ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com

Here's the output from tail /var/log/juju/unit-mongos-0.log on mongos/0:

2014-03-05 19:59:44 INFO worker.uniter.jujuc server.go:108 running hook tool "juju-log" ["mongos_relation_change: undefined rel_type: None"]
2014-03-05 19:59:44 DEBUG worker.uniter.jujuc server.go:109 hook context id "mongos/0:mongos-cfg-relation-changed:7095643384867257998"; dir "/var/lib/juju/agents/unit-mongos-0/charm"
2014-03-05 19:59:44 INFO juju juju-log.go:66 mongos/0 mongos-cfg:5: mongos_relation_change: undefined rel_type: None
2014-03-05 19:59:45 ERROR juju.worker.uniter uniter.go:350 hook failed: exit status 1
2014-03-05 19:59:45 DEBUG juju.worker.uniter modes.go:423 ModeAbide exiting
2014-03-05 19:59:45 INFO juju.worker.uniter modes.go:421 ModeHookError starting
2014-03-05 19:59:45 DEBUG juju.worker.uniter.filter filter.go:418 want resolved event
2014-03-05 19:59:45 DEBUG juju.worker.uniter.filter filter.go:412 want forced upgrade true
2014-03-05 19:59:45 DEBUG juju.worker.uniter.filter filter.go:523 no new charm event
2014-03-05 20:06:32 DEBUG juju.worker.uniter.filter filter.go:338 got relations change

What's going on? How do I fix this?

A workaround is okay :)

share|improve this question
    
I think this is a bug, can you file one on lp:charms, assign me and I can start investigating? –  Jorge Castro Mar 5 at 20:05
    
Sure I can! I'll have to do that tomorrow, probably, since my day's actually a little packed today. Any guess how I might work around this? I don't have any particular preferences for how things are set up... –  Dylan McCall Mar 5 at 20:09
2  
Yes, juju deploy cs:mongodb-24 should deploy the older version –  Jorge Castro Mar 5 at 20:16
    
That's a good tip to keep handy, documented it here: askubuntu.com/questions/430029/… –  Jorge Castro Mar 5 at 20:59
add comment

1 Answer 1

The first start to debugging a failure like this is to take a look at the unit's logs. To do that:

juju ssh mongos/0

cd /var/log/juju

If the error/solution isn't obvious feel free to update your question with the unit's logs.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.