Relation's need config too

Sidnei da Silva sidnei.da.silva at canonical.com
Thu Jul 19 12:43:28 UTC 2012


On Thu, Jul 19, 2012 at 9:21 AM, Gustavo Niemeyer
<gustavo.niemeyer at canonical.com> wrote:
> On Thu, Jul 19, 2012 at 9:13 AM, Sidnei da Silva
> <sidnei.da.silva at canonical.com> wrote:
>> If I understand correctly, this could also help with adding multiple
>> relations to a service but uniquely identify what's the role of each
> (...)
>> juju deploy pgsql mydb1
>> juju deploy pgsql mydb2
>> juju deploy service1
>> juju deploy service2
>> juju add-relation mydb1 service1 shard_id=1
>> juju add-relation mydb2 service1 shard_id=2
>> juju add-relation mydb1 service2 shard_id=1
>> juju add-relation mydb2 service2 shard_id=2
>>
>> Sounds right?
>
> It's not entirely clear why that's necessary in this example. shard_id
> always matches the database service name in the example above.

True, but not intentionally. Also you already said that "The service
*name* shouldn't be used in the charm implementation."
(https://lists.ubuntu.com/archives/juju/2012-June/001708.html).

In staging for example, we have the same postgresql instance handling
all the shards, so there we'd have:

juju deploy pgsql staging-db
juju deploy service1
juju deploy service2
juju add-relation staging-db service1 shard_id=1
juju add-relation staging-db service1 shard_id=2
juju add-relation staging-db service2 shard_id=1
juju add-relation staging-db service2 shard_id=2

-- 
Sidnei

Make the most of Ubuntu with Ubuntu One
http://one.ubuntu.com



More information about the Juju mailing list