Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mongodb: couldn't connect to server controller:27017 at src/mongo/shell/mongo.js:147 #42

Closed
AJNOURI opened this issue Dec 12, 2016 · 1 comment

Comments

@AJNOURI
Copy link
Owner

AJNOURI commented Dec 12, 2016

When creating Ceilometer database:

mongo --host controller --eval '
db = db.getSiblingDB("ceilometer");
db.addUser({user: "ceilometer",
pwd: MONGODB_PASSWORD,
roles: [ "readWrite", "dbAdmin" ]})'

I got the error:

Error: couldn't connect to server controller:27017 at src/mongo/shell/mongo.js:147

The correct controller IP is configured in mongodb config file
/etc/mongodb.conf

bind_ip = 10.10.10.51

The databse service looks OK:
service mongodb status

mongodb start/running, process 3202

pinging the controller resolves to 127.0.0.1 ??!! A bit strange
ping controller

PING controller (127.0.1.1) 56(84) bytes of data.
64 bytes from controller (127.0.1.1): icmp_seq=1 ttl=64 time=0.045 ms
64 bytes from controller (127.0.1.1): icmp_seq=2 ttl=64 time=0.038 ms
64 bytes from controller (127.0.1.1): icmp_seq=3 ttl=64 time=0.049 ms

@AJNOURI
Copy link
Owner Author

AJNOURI commented Dec 12, 2016

Looking at the hosts file

cat /etc/hosts

127.0.0.1 localhost
127.0.1.1 controller

#controller
10.10.10.51 controller
192.168.100.51 controller-api
...

Removed the entry

127.0.1.1 controller

As specified at the documentation:
http://docs.openstack.org/liberty/install-guide-ubuntu/environment-networking-controller.html
screenshot - 121216 - 05 18 57

Now the database is created.

@AJNOURI AJNOURI closed this as completed Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant