0

I have mongodb 3.0.4 installed on my Ubuntu 14.04 machine, and after I did a reboot I noticed that the hostname changed to mongodb.
Indeed I see myuser@mongodb instead of myuser@myhostname as it was before the reboot.
Again by running cat /etc/hostname I get mongodb.
And if I try to change it back again by running sudo hostname myhostname it shows this error sudo: unable to resolve host mongodb. This error shows up whenever I run sudo [anything]. I tried another reboot but this didn't fix the problem.
How to fix this? And why did this occur in the first place?

BTW the reboot was done after chaning default ulimit fildes number.

1
  • how did you install mongodb (the version is 2.4.9 in the repos so what source did you use etc)
    – Wilf
    Jul 15, 2015 at 18:42

1 Answer 1

0

I think there are 2 places where the hostname values is set, you can edit them both manually with

sudo nano /etc/hostname
sudo nano /etc/hosts

That shouldn't give you any errors, then reboot

3
  • But why did this happen in the first place? Jul 15, 2015 at 17:37
  • I don't know why it happened.
    – bistoco
    Jul 15, 2015 at 17:40
  • editing mongodb in /etc/hostname to myhostname + rebooting worked, thanks. But why this happened remains a mistery... Jul 15, 2015 at 17:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .