These are chat archives for sedouard/azure-mongodb-ubuntu

6th
Mar 2015
Guido Vilariño
@gvilarino
Mar 06 2015 08:25
Hey
for some reason my cluster wasn't behaving properly so I killed it
I took the chance to try the new script
now, it's not working properly for me, at least
after the creation of the 1st VM
I'm betting some weird logs when creating the other 2
as if there's some error with the init-command getting to the VM
specifically:
console.log('Creating vm ' + vmNames[args[0]]);
if(err){
  return callback(err);
}
scripty.invoke(args[1], function (err) {

  if (err) {
    return callback(err);
  }
oh
I think I just found the error
:D
thanks to gitter's syntax highlight
Guido Vilariño
@gvilarino
Mar 06 2015 08:30
oh, no, I didn't
(I'm burnt, as you can see)
Steven Edouard
@sedouard
Mar 06 2015 18:35
whoops gitter never sent me an email
just posted to your PR - thanks for the cleanup work. yeah theres something going on with that Unexpected Number output but it still works even on my new machine that I just pulled the repo on today.
gonna look into whats causing that output but i suspect that async is calling my callback more than what is expected for some reason.
you sent that PR quite late last night lol
Guido Vilariño
@gvilarino
Mar 06 2015 18:40
heh yeah
getting close to demo-day, not much sleep
I'll try it now again and double check the logs
also, I did confirm that exports weren't being set into .profile files
maybe because the user that runs the script isn't the same as the one defined as node admin?
Steven Edouard
@sedouard
Mar 06 2015 18:42
it's not gonna be
it doesn't run as the same user
precisely
not sure what cloud-init runs as
Guido Vilariño
@gvilarino
Mar 06 2015 18:42
then how do you get to run mongo client?
when you ssh
Steven Edouard
@sedouard
Mar 06 2015 18:42
i just run mongo :-)
Guido Vilariño
@gvilarino
Mar 06 2015 18:42
it didn't work for me
BadLocale and shit
Steven Edouard
@sedouard
Mar 06 2015 18:42
really?
Guido Vilariño
@gvilarino
Mar 06 2015 18:42
yup
Steven Edouard
@sedouard
Mar 06 2015 18:43
is your mac from argentina?
Guido Vilariño
@gvilarino
Mar 06 2015 18:43
nope
I only got the date settings in 'argentine'
Steven Edouard
@sedouard
Mar 06 2015 18:43
ok then we'll have to add an extra note
that might have something to do with it (maybe)
Guido Vilariño
@gvilarino
Mar 06 2015 18:43
but language and stuff it's all english
Steven Edouard
@sedouard
Mar 06 2015 18:43
so in the README
i'
i'll just note you may have to add those to your .profile
Guido Vilariño
@gvilarino
Mar 06 2015 18:44
ok
quick question:
Steven Edouard
@sedouard
Mar 06 2015 18:44
but still shouldn't impact automation - i'm curious what your logs said
Guido Vilariño
@gvilarino
Mar 06 2015 18:44
if you reset a node
does it auto-join the RS later?
Steven Edouard
@sedouard
Mar 06 2015 18:44
mongo runs as a service so it would restart
Guido Vilariño
@gvilarino
Mar 06 2015 18:44
(I'm running the script now)
Steven Edouard
@sedouard
Mar 06 2015 18:45
but let me restart one of my nodes and see if it stays on the RS
it would be really shitty if it didn't lol
Guido Vilariño
@gvilarino
Mar 06 2015 18:46
Also, I added the password trace to the script output
since it wasn't clear that you had to ssh into a node and get it from there
I gues the goal is for the script to never require you to ssh into the nodes
Steven Edouard
@sedouard
Mar 06 2015 18:47
you mean the RS password?
or the admin password*
for mongo
yeah probably a good idea to put it in the traces
however in the generated scripts
setupMongoNode-<node_name>.sh it has the password in there
Guido Vilariño
@gvilarino
Mar 06 2015 18:49
yeah
Steven Edouard
@sedouard
Mar 06 2015 18:49
FYI it does rejoin the RS after reboot
Guido Vilariño
@gvilarino
Mar 06 2015 18:49
nice
I just added the trace
IMPORTANT STUFF lol
Steven Edouard
@sedouard
Mar 06 2015 18:50
lmfao
Guido Vilariño
@gvilarino
Mar 06 2015 19:05
ok checking the logs
ok
if I log into a VM
and do mongo
I get the locale error
I get
If I fix that and do mongo
Guido Vilariño
@gvilarino
Mar 06 2015 19:10
rs0:PRIMARY> rs.status()
{
    "ok" : 0,
    "errmsg" : "not authorized on admin to execute command { replSetGetStatus: 1.0 }",
    "code" : 13
}
I mean
the default user has no privileges
and if I do
mongo -u clusteradmin -p >myPass<
(inside the node)
I get
o no
forget it
I had to do
mongo -u clusteradmin -p >pass< --authenticationDatabase admin
Guido Vilariño
@gvilarino
Mar 06 2015 19:17
just fixed another typo
Steven Edouard
@sedouard
Mar 06 2015 19:19
??
hmmm
Guido Vilariño
@gvilarino
Mar 06 2015 19:19
yea, it's mongod.log not mongodb.log
:)
Steven Edouard
@sedouard
Mar 06 2015 19:19
lol
if you login as mongo admin you shouldn't get that error message eright
Guido Vilariño
@gvilarino
Mar 06 2015 19:20
I do
I have to specify the authenticationDB
if not I get an error
Steven Edouard
@sedouard
Mar 06 2015 19:22
hmm
i'm getting a auth failed
Guido Vilariño
@gvilarino
Mar 06 2015 19:22
weird
Steven Edouard
@sedouard
Mar 06 2015 19:22
oh nvm i copied a pasted the pword wrong
nice ok so a doc fix there
ok just added a quick note
Guido Vilariño
@gvilarino
Mar 06 2015 19:26
awesome
are you able to connect yo your RS from your own machine?
like
mongo -u clusteradmin -p >pass< --authenticationDatabase admin rs0/dosmongodb.cloudapp.net:27017,dosmongodb.cloudapp.net:27018,dosmongodb.cloudapp.net:27019
Guido Vilariño
@gvilarino
Mar 06 2015 19:32
I get
MongoDB shell version: 2.6.7
connecting to: rs0/dosmongodb.cloudapp.net:27017,dosmongodb.cloudapp.net:27018,dosmongodb.cloudapp.net:27019
2015-03-06T11:29:38.035-0800 getaddrinfo("rs0") failed: nodename nor servname provided, or not known
2015-03-06T11:29:38.037-0800 Error: couldn't connect to server rs0:27017 (0.0.0.0), address resolved to 0.0.0.0 at src/mongo/shell/mongo.js:148
exception: connect failed
Steven Edouard
@sedouard
Mar 06 2015 19:32
you're doing for local?
from*
Guido Vilariño
@gvilarino
Mar 06 2015 19:32
from my laptop
Steven Edouard
@sedouard
Mar 06 2015 19:33
should you load balance that endpoint?
Guido Vilariño
@gvilarino
Mar 06 2015 19:33
what do you mean?
Steven Edouard
@sedouard
Mar 06 2015 19:34
well you gotta open up 27017 as an endpoint on the service
since its a real set
repl* set
i imagine that you want clients to go to other nodes if the primary goes down?
so does that mean you should load balance 27017 so that connections are randomly assigned to 1 of the 3 nodes?
Guido Vilariño
@gvilarino
Mar 06 2015 19:35
Aren't they open?
I mean
the script used to open them
I assumed they would be open lol
Steven Edouard
@sedouard
Mar 06 2015 19:43
nope
they aren't
the script doesn't open 27017
Guido Vilariño
@gvilarino
Mar 06 2015 19:44
the old script did :smile:
Steven Edouard
@sedouard
Mar 06 2015 19:44
i though the intention would be to add your other services to the same Vnet
then use internal ip addressing to get the mongodb service
Guido Vilariño
@gvilarino
Mar 06 2015 19:44
oh
created the endpoints but still not working :(
Steven Edouard
@sedouard
Mar 06 2015 19:48
trying myself
doing a load balanced set
just mongo works
let me try the admin access
admins-MacBook-Pro:simpletranapp steve$ mongo mongosedouard.cloudapp.net:27017 -u clusteradmin -p c0807aaa-ba88-4291-b634-ca6dc68ba540 --authenticationDatabase admin
MongoDB shell version: 2.4.12
connecting to: mongosedouard.cloudapp.net:27017/test
rs0:PRIMARY>
works just fine
if you load balance it
you'll randomly get one of the 3 nodes
so sometimes you may or may not get the primary
Guido Vilariño
@gvilarino
Mar 06 2015 19:52
ok
Steven Edouard
@sedouard
Mar 06 2015 19:56
gonna grab some food. lmk if it still doesn't work should be no reason it wouldn't
Guido Vilariño
@gvilarino
Mar 06 2015 19:56
ok
thanks
still we're hiring a hosted solution
so we don't have to go crazy about this
but will keep the cluster for testing purposes
and stress-testing the cloud
after all, credits <3
Steven Edouard
@sedouard
Mar 06 2015 19:57
i would do the same if i were you guys
Guido Vilariño
@gvilarino
Mar 06 2015 19:57
yep
Steven Edouard
@sedouard
Mar 06 2015 19:57
this shit is too annoying lol
Guido Vilariño
@gvilarino
Mar 06 2015 19:57
hahaha
Steven Edouard
@sedouard
Mar 06 2015 19:57
who you going with mongohq or mongoldb?
Guido Vilariño
@gvilarino
Mar 06 2015 20:06
monhohq
I got 60 days for free
then it's 18$/mo per GB
of storage
our storages are pretty small
so I guess we'll fit a lot into a single GB
Guido Vilariño
@gvilarino
Mar 06 2015 20:26
hey, on another note
I'm gonna do the SSL/TLS thing on deis now
I need to get a cert first
any idea for doing this on the Deis nodes?
I never did this before
Steven Edouard
@sedouard
Mar 06 2015 20:34
i'm doing it on dokku
not deis
has something to do with placing your cert in the applications tis folder
Guido Vilariño
@gvilarino
Mar 06 2015 20:35
ok
Steven Edouard
@sedouard
Mar 06 2015 20:35
it uses nginx
Guido Vilariño
@gvilarino
Mar 06 2015 20:35
it should be similar tho
Steven Edouard
@sedouard
Mar 06 2015 20:35
yeah
Guido Vilariño
@gvilarino
Mar 06 2015 20:35
any suggestion on how to generate the CSR?
Steven Edouard
@sedouard
Mar 06 2015 20:35
but then again i just tried this yesterday... and then my site went down lol
yeah
i was just on a web page
let me see if i can find it
thats if you don't want to spend $200 bucks on like a trusted certificate authority cert
otherwise you'll probably want to go to a trusted authority (verisign etc) and get a cert from them
Guido Vilariño
@gvilarino
Mar 06 2015 20:40
yea, I was thinking of buying a digicert one
it's the one with the best reviews
self-signed certs won't work for prod
Guido Vilariño
@gvilarino
Mar 06 2015 20:50
dumb question:
If I generate a CSR in my laptop
would it work?
It's like all docs say "generate a CSR from your server or for your server configuration"
I be like: "dude, it's a container"
Steven Edouard
@sedouard
Mar 06 2015 21:04
lolol
i don't think it matters where you make the cert
but maybe thats why mine didn't work
it would be dumb though
because that would mean you have to gen it for each box...
Guido Vilariño
@gvilarino
Mar 06 2015 21:14
I just created an openssl based cert
it should work
since ngnix and deis both rely on openssl
Steven Edouard
@sedouard
Mar 06 2015 21:17
yeah it should