I'm trying to run mongodb on my ubuntu :
calling sudo service mongodb start tells me that mongo is already running.
But when i run the command mongo or mongod i get the error :
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
Aborted (core dumped)
The weird thing is that I have a meteor application already using this mongoDB, and it is working correctly. My only problem is that i want to view/access the data from outside meteor and from a mongo client.
Thanks.
ps aux | grep mongo gives me :
mongodb 27835 1.0 1.4 204936 14644 ? Ssl 12:59 1:13 /usr/bin/mongod --config /etc/mongodb.conf
root 30838 0.0 0.0 4344 836 pts/0 S+ 14:53 0:00 grep --color=auto mongo
Looks like an old version of Boost was used to compile Mongo. Try executing
export LC_ALL=C
first before starting mongo shell
Related
Just upgraded to mongo 3.0, but mongoexport gives us a the following error: "Failed: read tcp 127.0.0.1:27020: i/o timeout" after outputting some documents (not always the same amount). mongoexport is connecting to a sharded cluster of 4 standalone mongod servers with 3 mongod config servers
[root#SRV]$ mongoexport --host
localhost:27022,localhost:27021,localhost:27020 --db horus
--collection users --type json --fields _id | wc -l
2015-03-09T12:41:19.198-0600 connected to:
localhost:27022,localhost:27021,localhost:27020
2015-03-09T12:41:22.570-0600 Failed: read tcp 127.0.0.1:27020: i/o
timeout
15322
The versions we are using are:
[root#MONGODB01-SRV]# mongo --version MongoDB shell version: 3.0.0
[root#SRV]$ mongoexport --version mongoexport version: 3.0.0 git
version: e35a2e87876251835fcb60f5eb0c29baca04bc5e
[root#SRV]$ mongos --version MongoS version 3.0.0 starting: pid=47359
port=27017 64-bit host=SRV (--help for usage) git version:
a841fd6394365954886924a35076691b4d149168 OpenSSL version: OpenSSL
1.0.1e-fips 11 Feb 2013 build sys info: Linux ip-10-181-61-91 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 BOOST_LIB_VERSION=1_49
Tried with a 2.6 mongoexport in another server against our mongod3.0 and mongos3.0 and works fine
This is an old question but I wanted to answer. Maybe this answer will help one of us. It might be caused by someone else trying to write to the collection you are writing. I had a smilar problem. After a long research I realised that a user with higher role was trying to write in the sametime and because his/her role is more important than mine ones request were done and mine are given IO exception.
Try closing the ports first: eg. killall -9 node
I'm getting a common Mac OSX error for Homebrew installations of Postgres,
No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
This is apparently due to there being multiple installs on the system. However, the usual steps are not resolving things.
I can successfully start Postgres and running:
ps auxw | grep post
returns ..
euanmillar 847 0.0 0.0 2432768 588 s000 R+ 11:19am 0:00.00 grep postgres
euanmillar 845 0.0 0.0 2439324 448 ?? Ss 11:19am 0:00.00 postgres:
stats collector process
euanmillar 844 0.0 0.0 2443176 1520 ?? Ss 11:19am 0:00.00 postgres:
autovacuum launcher process
euanmillar 843 0.0 0.0 2443044 544 ?? Ss 11:19am 0:00.00 postgres: wal writer process
euanmillar 842 0.0 0.0 2443044 584 ?? Ss 11:19am 0:00.00 postgres: writer process
euanmillar 841 0.0 0.0 2443044 596 ?? Ss 11:19am 0:00.00 postgres: checkpointer process
euanmillar 839 0.0 0.0 2443044 3616 s000 S 11:19am 0:00.02 /us
so it looks like postgres is running.
I have commented in the following lines in postgresql.conf
port = 5432
unix_socket_directory = '/var/pgsql_socket'
unix_socket_permissions = 0777
and in var/pgsql_socket/ I do have a hidden file .s.PGSQL.5432
I have tried solutions to many of the posts here. This one especially seems similar:
https://dba.stackexchange.com/questions/21587/postgresql-is-running-locally-but-i-cannot-connect-why
But the difference is that I do have a '/var/pgsql_socket' directory which is CHOWN-ed to everyone. I have used Homebrew to completely remove and re-install Postgres and still I have the same issue.
You need to remove the postmaster.pid, which should be in the following path:
/usr/local/var/postgres/postmaster.pid
For me, i removed postmaster.pid in /usr/local/var/postgres. fixed me right up.
A simpler solution is to locate where the socket actually is vs where it's expected to be. In my case, I ran:
$ locate PGSQL.5432
/private/var/pgsql_socket/.s.PGSQL.5432
/private/var/pgsql_socket/.s.PGSQL.5432.lock
Then just symlink the expected socket location to the actual socket location.
$ ln -s /private/var/pgsql_socket/.s.PGSQL.5432 /tmp/.s.PGSQL.5432
The system client is being used and not your brew version. The symlink approach only lasts until the next restart. This approach fixes the root issue I believe
sudo edit /etc/paths
Move the line containing /usr/local/bin to the top of the file. (Before /usr/bin)
Uninstall your postgres gem(s) (gem uninstall pg)
Start up new shell to load the new environment settings
bundle
That is not an OS X specific issue. You will need to clean up your postgres installation and then reinstall it again. I have faced this issue on my ubuntu 12.04. While cleaning your previous installation, you will need to remove all packages starting with postgres (postgresql, postgresql-common, postgresql-client etc), in other words, postgres*. I have not used brew, have used port on OS X Lion. I guess the equivalent command should be sudo brew remove postgres*. A sudo brew install postgresql should then do the trick.
Also, if you feel the server is already running, you can try sudo -u postgres createuser. If that fails, you will need to reinstall.
However, the output of your ps aux | grep post is actually the grep command itself. Not of the postgres server running.
EDIT: Looks like the following link could be of help https://dba.stackexchange.com/questions/21587/postgresql-is-running-locally-but-i-cannot-connect-why
If yes, then this question might be a duplicate.
I had the same problem on Mac Serria. In Mac Serria you can find postmaster.pid inside /Users/<user_name>/Library/Application Support/Postgres/var-9.6 if you used GUI installer rather than homebrew.
Once you delete this file then everything should work fine.
I just installed Arch Linux today. I'm setting up my development stack, and I'm stuck with mongodb.
I have followed this wiki when installing:
https://wiki.archlinux.org/index.php/MongoDB#Installing_MongoDB
When I try to get into mongo console, I get this:
jan#arch:~$ mongo
MongoDB shell version: 2.4.5
connecting to: test
Tue Jul 9 19:38:13.365 JavaScript execution failed: Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:L112
exception: connect failed
jan#arch:~$
What am I missing here?
EDIT: I figured out when I run mongod directly from terminal, it starts server fine. However the systemctl start mongodb doesn't start it.
Okay, I've figured it out by scanning journalctl output:
ul 09 19:49:33 arch mongod[1122]: all output going to: /var/log/mongodb/mongod.log Jul 09 19:49:33 arch mongod[1122]: can't open [/var/log/mongodb/mongod.log] for log file: errno:13 Permission denied Jul 09 19:49:33 arch mongod[1122]: Bad logpath value: "/var/log/mongodb/mongod.log"; terminating.
So I searched for user that might be utilized by mongodb:
jan#arch:~$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
...
mongodb:x:998:2::/var/lib/mongodb:/bin/bash
And chowned required folders:
jan#arch:~$ sudo chown -R mongodb:x /var/log/mongodb/
jan#arch:~$ sudo chown -R mongodb:x /var/lib/mongodb/
Started it again:
jan#arch:~$ sudo systemctl start mongodb
It works now.
jan#arch:~$ mongo
MongoDB shell version: 2.4.5
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
>
I have followed this after installing Mongo on Mac.
On php.ini shows mongo details.
mongo
MongoDB Support enabled
Version 1.0.11
Directive Local Value Master Value
mongo.allow_empty_keys 0 0
mongo.allow_persistent 1 1
mongo.auto_reconnect 1 1
mongo.chunk_size 262144 262144
mongo.cmd $ $
mongo.default_host localhost localhost
mongo.default_port 27017 27017
mongo.long_as_object 0 0
mongo.native_long 0 0
mongo.utf8 1 1
But when I type mongo on a terminal it displays the following error.
sokada-macbook:bin sokada$ mongo
MongoDB shell version: 2.0.6
connecting to: test
Thu Jun 14 21:54:47 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:84
exception: connect failed
I thank you in advance to solve this problem.
I needed to run the following in the terminal.
sudo mkdir -p /data/db
sudo chown `id -u` /data/db
Then I run mongo and give the following.
sokada-macbook:~ sokada$ mongo
MongoDB shell version: 2.0.6
connecting to: test
>
It looks like you have successfully installed the Mongo support for PHP, but haven't started the actual mongod server yet.
In the tutorial you followed, that would be Step 4. Create Startup Routines for MAMP.
I'm running Mongo DB as windows service and every second time I stop the service it reports "Error 109: The pipe has been ended". Here is the command line being used to run the service
"C:\Temp\mongodb\bin\mongod" --service --serviceUser --servicePassword --dbpath C:\temp\db --rest --logpath C:\temp\db\log\mongo.log --logappend --directoryperdb
This bug was fixed for version 2.1.0 ( https://jira.mongodb.org/browse/SERVER-2833 ) and then resurfaced ( https://jira.mongodb.org/browse/SERVER-6771 ). Hopefully it will be fixed again for version 2.2.0.