<div dir="ltr">I'm pretty sure that is the wrong fix, as the API servers need "clusterAdmin" role so they can set up the Replica Sets when users use "juju ensure-availability". The reconfiguring is done by the machine agent, not the user admin.<div><br></div><div>John</div><div>=:-></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Sep 9, 2014 at 2:12 PM, Ian Booth <span dir="ltr"><<a href="mailto:ian.booth@canonical.com" target="_blank">ian.booth@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Before I sent the original email I put up a PR to reduce the noise by<br>
eliminating the warnings. eg we only apply the cluster admin role to the admin<br>
database, not the presence or juju databases.<br>
<br>
<a href="https://github.com/juju/juju/pull/714" target="_blank">https://github.com/juju/juju/pull/714</a><br>
<br>
This cuts down on the warnings but we still get repetitive syslog entries for<br>
mongo authentication on the connections.<br>
<br>
I also put in logging to see if we were calling login over and over and it<br>
appears we are not. The agent is not bouncing. From what I can tell, Juju only<br>
calls Login a finite number of times when the agent starts. Everything is<br>
working as expected.<br>
<br>
We do call session.Copy() when we perform a db interaction, but that to my<br>
understanding just reuses the credentials from the original session. Maybe that<br>
also causes mongo to create these log entries?<br>
<br>
>From what I can see, this is a mongo logging issue that we have little control<br>
over. But I'd love to be wrong so we can fix it.<br>
<div><div class="h5"><br>
<br>
On 09/09/14 18:53, John Meinel wrote:<br>
> On Tue, Sep 9, 2014 at 12:27 PM, Andrew Wilkins <<br>
> <a href="mailto:andrew.wilkins@canonical.com">andrew.wilkins@canonical.com</a>> wrote:<br>
><br>
>> On Tue, Sep 9, 2014 at 4:14 PM, John Meinel <<a href="mailto:john@arbash-meinel.com">john@arbash-meinel.com</a>><br>
>> wrote:<br>
>><br>
>>> I don't think these are from authentication between mongo instances.<br>
>>><br>
>><br>
>> Agreed, looks like the machine-0 jujud connecting over and over again.<br>
>> Perhaps the agent is unhappy and is bouncing.<br>
>><br>
><br>
> It is possible, but its also possible that the new session copying means we<br>
> just have multiple connections (conn11) to the database, and each one is<br>
> going to be authenticated.<br>
><br>
><br>
>><br>
>><br>
>>> This looks more like a Mongo 2.4 vs 2.6 difference. We added stuff like<br>
>>> "clusterAdmin" to priviledges that we give because of 2.6 support (I<br>
>>> thought).. But if 2.4 doesn't know anything about "clusterAdmin" then<br>
>>> whenever we log in, it goes through the list of roles and noisily ignores<br>
>>> some of them.<br>
>>><br>
>><br>
>> clusterAdmin is for replica sets, and is applicable to 2.4. In particular,<br>
>> in grants replSetInitiate. I went through and removed the extraneous stuff<br>
>> when I did the 2.6 support updates.<br>
>> See <a href="http://docs.mongodb.org/v2.4/reference/user-privileges/" target="_blank">http://docs.mongodb.org/v2.4/reference/user-privileges/</a><br>
>><br>
><br>
> Digging into it a bit more, it is only complaining about not having those<br>
> roles on the "juju" and "presence" databases, they are probably present on<br>
> the "admin" database.<br>
><br>
> Looking at the code, the only place I see RoleClusterAdmin is while<br>
> connected to the Admin database.<br>
> "clusterAdmin<br>
</div></div>> <<a href="http://docs.mongodb.org/manual/reference/built-in-roles/#clusterAdmin" target="_blank">http://docs.mongodb.org/manual/reference/built-in-roles/#clusterAdmin</a>> is<br>
<div class="HOEnZb"><div class="h5">> only applicable on the admin database, and does not confer any access to<br>
> the local or config databases."<br>
><br>
> I wonder if this is either:<br>
> 1) Mongo just being overly verbose in warnings that aren't actually<br>
> warnings. (You logged in with a user that has clusterAdmin, but that<br>
> doesn't apply to this other database you are accessing.)<br>
> 2) We somehow created a User on the Juju/Presence databases and then also<br>
> gave it "clusterAdmin" rights there.<br>
><br>
> The only place I see any of this is via the mongo.SetAdminMongoPassword<br>
> call, though, and that does appear to forcibly only do the UpsertUser<br>
> rights on "admin".<br>
> So I'm *guessing* we are running into (1). We are connecting directly to<br>
> the "juju" database, and we are connecting as a user that has clusterAdmin<br>
> but it just doesn't do anything in this context and mongo warns about it.<br>
> An idea is that we always connect to "admin" and then switch databases once<br>
> connected? I think that's how I've done it for connecting when using<br>
> "mongo" the CLI client.<br>
><br>
> John<br>
> =:-><br>
><br>
><br>
><br>
><br>
>> Presumably the real fix is to only give roles that are 2.6 specific when<br>
>>> we know we're running against 2.6 ?<br>
>>><br>
>>> (I could be wrong on this, but I thought we had earlier bugs that we<br>
>>> couldn't do the cluster reconfiguration on 2.6 because we had to add the<br>
>>> "clusterAdmin" role.)<br>
>>><br>
>>> John<br>
>>> =:-><br>
>>><br>
>>><br>
>>> On Tue, Sep 9, 2014 at 11:22 AM, Ian Booth <<a href="mailto:ian.booth@canonical.com">ian.booth@canonical.com</a>><br>
>>> wrote:<br>
>>><br>
>>>> <a href="https://bugs.launchpad.net/juju-core/+bug/1365828" target="_blank">https://bugs.launchpad.net/juju-core/+bug/1365828</a><br>
>>>><br>
>>>> Hi mongo experts<br>
>>>><br>
>>>> Mongo is filling up syslog with lots of spam.<br>
>>>> eg, as reported by a customer, <a href="https://clbin.com/XZ63i" target="_blank">https://clbin.com/XZ63i</a><br>
>>>><br>
>>>> I have reduced this a little by tweaking the roles used to log in to the<br>
>>>> "juju"<br>
>>>> and "presence" databases, so the warnings are gone. But the spam remains.<br>
>>>><br>
>>>> It seems to me these Mongo bugs might be relevant:<br>
>>>><br>
>>>> <a href="https://jira.mongodb.org/browse/SERVER-5847" target="_blank">https://jira.mongodb.org/browse/SERVER-5847</a><br>
>>>> <a href="https://jira.mongodb.org/browse/SERVER-5952" target="_blank">https://jira.mongodb.org/browse/SERVER-5952</a><br>
>>>><br>
>>>> I can't see from a brief look what Juju might be doing to directly cause<br>
>>>> the<br>
>>>> spam, nor what we can do to remove it.<br>
>>>><br>
>>>> Does anyone with more Mongo knowledge have any insight as to what we can<br>
>>>> do to<br>
>>>> address this problem?<br>
>>>><br>
>>>><br>
>>>> --<br>
>>>> Juju-dev mailing list<br>
>>>> <a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.com</a><br>
>>>> Modify settings or unsubscribe at:<br>
>>>> <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
>>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Juju-dev mailing list<br>
>>> <a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.com</a><br>
>>> Modify settings or unsubscribe at:<br>
>>> <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
>>><br>
>>><br>
>><br>
><br>
</div></div></blockquote></div><br></div>