/srv/irclogs.ubuntu.com/2018/06/12/#juju.txt

TheAbsentOneAnyone has a ready-to-use redis/mongo/cassandra example by any chance on how to use the charms/interfaces. It would save me some time. Also is it possible for 2 charms to have 2 relations? Let's say charm A and mysql can I use both mysql-root interface and ordinary mysql interface?08:03
TheAbsentOneRoot for root user and ordinary mysql for a db request08:03
stubTheAbsentOne: https://git.launchpad.net/cqlsh-charm/tree/ is the only Cassandra example in existence as far as I'm aware. Its published at cs:~cassandra-charmers/cqlsh08:13
stubTheAbsentOne: Yes, you should be able to use both mysql-root and mysql relations at the same time.08:17
stub(I did trip over an Amulet bug the other day though that I need to follow through on, where it never actually adds the second relation)08:18
TheAbsentOneI've never used cassandra before though but what does 'write_cqlshrc('root')' and ubuntu actually do stub? As far as I could understand I need a host of cassandra, a port and a keyspace name to properly connect to it right?08:18
TheAbsentOneI see, well tbf I think it's not a good practice, but I fail to properly create a database with the mysql-root interface so kinda an issue08:19
stubTheAbsentOne: The write_cqlshrc helper is specific to writing the .cqlshrc file, which is probably not used except by the cqlsh tool.08:19
TheAbsentOneahn I see08:19
stub(I just put it in the interface as I expect people may want their clients to include cqlsh for reasons)08:19
TheAbsentOneso in the example there isn't actually a request for a db08:20
stubTheAbsentOne: You want ep.details to get the raw connection details.08:21
stubCassandra doesn't have databases, it has keyspaces08:21
TheAbsentOneeuh yeah i meant keyspaces my bad08:21
stubAnd the interface doesn't support asking the Cassandra charm to create it. There are too many options08:21
stub(choosing replication factors, compaction strategies.... Cassandra is... Cassandra)08:22
TheAbsentOneso let's say I have a charm and I install some sort of third party python library for cassandra (will need to google for that), with that I would be able to create a keyspace right?08:23
stubYes. You might need to do it over the database-admin relation rather than the database one (I don't recall)08:24
TheAbsentOne"        >>> ep = reactive.endpoint_from_flag('endpoint.mydb.available')         >>> first_details = ep.details[0] if ep.details else None" <-- what does the ep.details[0] return in this case?08:24
stubYou probably want a handler that waits until you have 3 Cassandra units ready, then issue a CREATE KEYSPACE command specifying the keyspace name and replication strategy08:25
TheAbsentOneI see, well I start of with fixing my mysql then redis and mongo and maybe I'll try cassandra but I doubt I will succeed x)08:26
TheAbsentOneYou know what I'm gonna put some repo's online with minimal working examples so you guys can better help me and hotfix where needed x) I'll get to it asap and I think it might be a nice collection of examples for newcommers too08:26
TheAbsentOnethanks for the info stub08:26
stubTheAbsentOne: That returns a the CassandraDetails instance for the first unit, or None if there are no nits ready08:26
stubSorry, that is wrong08:26
TheAbsentOneit's a list with all these attrubites probably08:27
stubThat returns the CassandraDetails instance for the first relation found, or None if there are no units ready08:27
TheAbsentOneahn right08:27
stub(you can relate a charm multiple times to different Cassandra deployments, if you are into really, really big data ;) )08:27
TheAbsentOneright right that's good stuff but way over my head right now xD just a stupid student over here08:28
TheAbsentOnebut it's there that I would get my connection detail info ^^08:28
TheAbsentOnegreat!08:28
stubYes08:28
stubI should create a shortcut for that, because it is what almost all charms will need to do, but don't know what to call it.08:28
TheAbsentOneconnectiondetails is clear and pretty universal08:32
TheAbsentOneI do think it would be usefull if a requesting charm could simply get that like how the standard mysql renders config file. With ep.host(), ep.port() etc but that's probably me wanting it to easy x)08:34
stickupkidhml: code review done13:44
kwmonroeTheAbsentOne: regarding mysql:db vs mysql:db-admin, yes, a single charm can relate to both.  i've updated the readme at https://github.com/juju-solutions/interface-mysql-root showing what the -root interface does.  i do not believe you can specify an admin vs non-admin user for a single charm, so charm A will only have 1 set of user creds passed over the db and db-admin relations.15:32
kwmonroein hindsight, it feels like the mysql interface should be able to handle an admin as well as non-admin request.  maybe that can be refactored to make the mysql-root interface obsolete.15:33
kwmonroeeven if the interface doesn't do it, maybe it would fit better as an action on mysql/mariadb charms.  juju run-action mysql grant-admin.15:34
stubkwmonroe: I just changed that in the Cassandra charm, so the database and database-admin relations both use the 'cassandra' interface. I don't think anything cares about the interface name apart from charms.reactive, so it seemed just legacy cruft from how it used to be.15:44
stubMight be too late for mysql if the interfaces are already published15:45
TheAbsentOnehi kwmonroe I wanted to talk to you about it actually. I really miss the feature to name a database on the mysql interface (mysql-shared has this) and I need a way to have a user that can access the db from another host/charm/whatever then the "requesting charm" and right now it seems only mysql-root interface can do this (kinda). Imo it should all be possible on mysql interface and it would make way more sense too but that's just15:48
TheAbsentOnetalking here15:48
TheAbsentOnebecause in my use case I don't really need an administrator per se, I need the user as provided by the mysql-shared (or mysql) interface but he needs to be able to access the db from other (known) hosts as well15:49
TheAbsentOneand I can't figure it out how to properly do that :P15:50
rick_h_zeestrat: :P I was just typing that out. You beat me!17:29
zeestratrick_h_: Had to do a quick check myself if anyone had me beat before I hit send ;)19:53
zeestratrick_h_: As a note, is that documented anywhere on docs.jujucharms? My quick search doesn't turn up with anything.19:59
=== k3nt__ is now known as k3nt
rick_h_zeestrat: no, but it came up around more developer related docs and the teams' getting a discourse instance soon that we'll move stuff like that to20:36

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!