Is there a universal interface I can use?
Tilman Baumann
tilman.baumann at canonical.com
Fri Nov 24 14:19:32 UTC 2017
On 22.11.2017 18:51, Cory Johns wrote:
> However, I see that you also want to retrieve relation data that the
> cassandra charm provides using the "cassandra" interface protocol. Here
> it becomes important to note that whether a relation is subordinate or
> not is independent of the interface protocol the relation uses. Thus,
> you could mark the endpoint as "scope: container" and still use the
> "cassandra" interface protocol. You would then want to drop the
> "host-system" endpoint from your charm, mark the "database" endpoint as
> "interface: cassandra", and connect as you were trying to do. However,
> I seem to recall that Stuart (the maintainer of the cassandra charm)
> raised a possible issue with subordinates using relations that the other
> end doesn't expect to be subordinate, so there might be some concerns
> there.
Fascinatingly this works. I always thought the implicit juju-info
relation is something that is only implicit in the provides section.
Very useful.
So I tried this
requires:
database:
interface: cassandra
scope: container
And indeed cassandra:database connects with cassandra-backup:database
and creates a subordinate charm. Wonderful.
But it doesn't actually work. :/
$ juju run --unit cassandra-backup/7 -- relaton-ids database
/tmp/juju-exec940792089/script.sh: line 1: relaton-ids: command not found
$ juju run --unit cassandra-backup/7 -- relation-ids database
database:499
$ juju run --unit cassandra-backup/7 -- relation-list -r database:499
cassandra-analytics/4
$ juju run --unit cassandra-backup/7 -- relation-get -r database:499 -
cassandra-analytics/4
private-address: 100.107.66.2
There is basically nothing to read in that relation.
If I compare that with a properly connected relation to the same
cassandra instance:
$ juju run --unit contrail-analytics/1 -- relation-get -r cassandra:277
- cassandra-analytics/4
cluster_name: juju
datacenter: juju
host: XX.YY.0.119
native_transport_port: "9042"
password: XXXXXXXXXXXXXXXXXXXXXX
private-address: 100.107.66.2
rpc_port: "9160"
username: juju_contrail-analytics
So something, perhaps the scope, makes this not work.
More information about the Juju
mailing list