Mongodb failing to start on RHEL.
Here is the output from service restart: any idea?
2011-06-17 18:44:06,387
[INFO][Dummy-3] initialize() #
connection.py:48 - Attempting Database
connection with seeds = localhost
2011-06-17 18:44:06,389
[CRITICAL][Dummy-3] initialize() #
connection.py:55 - Database
initialization failed
It is best to look at the mongod server logs to find the issue. It is most likely because the lock file was not cleaned up because you had an unclean shutdown.
Related
we have an artifactory (5.6.2) running on docker with a postgres (9.6.6-alpine) also on docker.
We realized that artifactory performed very badly so i looked at the containers and saw that postgres was taking all cpu it could get.
So tried to restart the postgres but it did fail:
23.2.2018 11:28:12PANIC: could not locate a valid checkpoint record
23.2.2018 11:28:12LOG: startup process (PID 20) was terminated by signal 6
23.2.2018 11:28:12LOG: aborting startup due to startup process failure
23.2.2018 11:28:12LOG: database system is shut down
I then restored the whole DB Folder from Backup and tried to restart the DB again. The Postgres DB came up but as i started artifactory its waiting at the point:
23.2.2018 15:03:392018-02-23 15:03:39,537 [localhost-startStop-1] [JFrog-Access] [INFO ] (o.j.a.s.AccessServerBootstrapImpl:91) - [ACCESS BOOTSTRAP] Starting JFrog Access bootstrap...
23.2.2018 15:03:392018-02-23 15:03:39,576 [localhost-startStop-1] [JFrog-Access] [INFO ] (o.j.a.s.AccessServerBootstrapImpl:164) - [ACCESS BOOTSTRAP] Updating server ....
So Artifactory communicates with the DB and the DB again eats up all CPU.
Is this normal ? This situation is running for an hour or so, can somebody tell me if this ever stops successfully.
Do i have any other options besides waiting or has someone a tip for me how i can get my artifactory up and running again.
Every help is welcome.
thanks
I am getting this error instead of my shell prompt (running Ubuntu 16.04LTS).
I'm pretty new to MongoDB. I had to downgrade from version 3.4 to 3.2:
https://docs.mongodb.com/manual/release-notes/3.4-downgrade-standalone/
I followed those instructions (I thought) pretty faithfully, but now can't access the shell to confirm, etc.
scorpian555#scorpo:~$ mongo
MongoDB shell version: 3.2.15
connecting to: test
2017-07-13T14:41:31.434-0400 W NETWORK [thread1] Failed to connect to
127.0.0.1:27017, in(checking socket for error after poll), reason:
errno:111 Connection refused
2017-07-13T14:41:31.434-0400 E QUERY [thread1] Error: couldn't
connect to server 127.0.0.1:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:229:14
#(connect):1:6
exception: connect failed
There was a socket file that the error seems to be referencing at /tmp/mongodb-27017.sock
Per these, I ended up removing that socket file, then tried to reboot the mongod daemon:
'Failed to unlink socket file" error in MongoDB 3.0
MongoDB - Permission denied for socket: /tmp/mongodb-27017.sock
service mongod restart
service mongod status
scorpian555#scorpo:~$ service mongod status
● mongod.service - High-performance, schema-free document-oriented
database
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor
preset: enabled)
Active: active (running) since Thu 2017-07-13 14:58:08 EDT; 4s ago
Docs: https://docs.mongodb.org/manual
Main PID: 4763 (mongod)
CGroup: /system.slice/mongod.service
└─4763 /usr/bin/mongod --quiet --config /etc/mongod.conf
Jul 13 14:58:08 scorpo systemd[1]: Started High-performance, schema-
free document-oriented database.
Per those, I removed the socket file and ran:
scorpian555#scorpo:~$ ls -ld /tmp
drwxrwxrwt 17 root root 20480 Jul 13 14:58 /tmp
I think I'm a little lost here, I was under the impression that, upon restart of the daemon, it would recreate this temporary file, at which point I would check the permissions.
I can't find the link at the moment, but had found elsewhere instructions to make sure the owner of the mongod.sock file was mongod (not root) and I would have to chown it if it wasn't mongod.
I'm pretty new to MongoDB, like I said. I found this as another possible issue, but wanted to see if I should dive down this rabbit hole or whether I might be looking in the wrong place?
Connection refused to MongoDB errno 111
Thanks.
My issue was that, while I started the mongod service, I did not actually run the daemon with sudo as needed.
I'm trying to connect to a remote mlab database. Everything works fine, except for some times I simply can’t connect to the database. It might have something to do with my computer since my test server can connect to it without any problems. Nevertheless I can’t figure out what the problem might be. I went through their connection troubleshooting guide but already got stuck at the first step
nc -w 3 -v ds119568.mlab.com 19568
gives the following error:
nc: connectx to ds119568.mlab.com port 19568 (tcp) failed: Operation timed out
Trying to connect via mongo shell gives this error:
MongoDB shell version v3.4.3
connecting to: mongodb://ds119568.mlab.com:19568/ba
2017-07-08T15:05:04.528+0200 W NETWORK [thread1] Failed to connect to
54.73.159.50:19568 after 5000ms milliseconds, giving up.
2017-07-08T15:05:04.533+0200 E QUERY [thread1] Error: couldn't
connect to server ds119568.mlab.com:19568, connection attempt failed :
connect#src/mongo/shell/mongo.js:237:13
#(connect):1:6
exception: connect failed
Advice what on what could be the problem here? Does it have something to do with the firewall of my computer?
This worked for me (Ubuntu 16.04) :
sudo systemctl start mongod
Doesn't give output. Check the status to verify that the service has started properly.
sudo systemctl status mongod
Output should be something like:
● mongod.service - High-performance, schema-free document-oriented database
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: active (running) since Fri 2017-02-17 18:57:26 UTC; 17min ago
Docs: https://docs.mongodb.org/manual
Main PID: 2811 (mongod)
Tasks: 17
Memory: 56.8M
CPU: 7.294s
CGroup: /system.slice/mongod.service
└─2811 /usr/bin/mongod --quiet --config /etc/mongod.conf
Verify that its running:
sudo systemctl enable mongod
Output should be:
Created symlink from /etc/systemd/system/multi-user.target.wants/mongod.service
to /lib/systemd/system/mongod.service.
Then you should be able to connect to mongo shell.
mongo
For more refer to this link: https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-mongodb-on-ubuntu-16-04
I've installed postgres as database and then iRODS in Ubuntu 14.04. Then I start its configuration
sudo /var/lib/irods/packaging/setup_irods.sh
After the configuration phase, when iRODS starts the updtating, the first 4 steps go well
Stopping iRODS server...
-----------------------------
Running irods_setup.pl...
Step 1 of 4: Configuring database user...
Updating user's .pgpass...
Skipped. File already uptodate.
Step 2 of 4: Creating database and tables...
Checking whether iCAT database exists...
[mydb] on [localhost] found.
Updating user's .odbc.ini...
Creating iCAT tables...
Skipped. Tables already created.
Testing database communications...
Step 3 of 4: Configuring iRODS server...
Updating /etc/irods/server_config.json...
Updating /etc/irods/database_config.json...
Step 4 of 4: Configuring iRODS user and starting server...
Updating iRODS user's ~/.irods/irods_environment.json...
Starting iRODS server...
but at the end I get this error
Could not start iRODS server.
Starting iRODS server...
Traceback (most recent call last):
File "/var/lib/irods/iRODS/scripts/python/get_db_schema_version.py", line 77, in <module>
current_schema_version = get_current_schema_version(cfg)
File "/var/lib/irods/iRODS/scripts/python/get_db_schema_version.py", line 61, in get_current_schema_version
'get_current_schema_version: failed to find result line for schema_version\n\n{}'.format(format_cmd_result(result)))
RuntimeError: get_current_schema_version: failed to find result line for schema_version
return code: [0]
stdout:
stderr:
ERROR: relation "r_grid_configuration" does not exist
LINE 1: ...option_value from R_GRID_CON...
^
Confirming catalog_schema_version... Success
Validating [/var/lib/irods/.irods/irods_environment.json]... Success
Validating [/etc/irods/server_config.json]... Success
Validating [/etc/irods/hosts_config.json]... Success
Validating [/etc/irods/host_access_control_config.json]... Success
Validating [/etc/irods/database_config.json]... Success
(1) Waiting for process bound to port 5432 ... [-]
(2) Waiting for process bound to port 5432 ... [-]
(4) Waiting for process bound to port 5432 ... [-]
Port 5432 In Use ... Not Starting iRODS Server
Install problem:
Cannot start iRODS server.
Found 0 processes:
There are no iRODS servers running.
Abort.
Have you any ideas on what went wrong?
Because I don't have enough reputation to comment:
Which version of iRODS are you using?
This portion of the output:
Creating iCAT tables...
Skipped. Tables already created.
combined with this portion:
ERROR: relation "r_grid_configuration" does not exist
suggests that the setup ran before, but only partially completed, leaving the system in a broken state. I would recommend reinstallating from scratch, which includes:
Uninstalling the iRODS icat and db plugin packages:
sudo dpkg -P irods-icat irods-database-plugin-postgres
note: make sure to use the -P, so that the configuration files are removed from dpkg's database.
Dropping and remaking the database
Deleting the following directories:
sudo rm -rf /tmp/irods /etc/irods /var/lib/irods
Reinstalling the packages and running sudo /var/lib/irods/packaging/setup_irods.sh
This portion of the output:
(1) Waiting for process bound to port 5432 ... [-]
(2) Waiting for process bound to port 5432 ... [-]
(4) Waiting for process bound to port 5432 ... [-]
Port 5432 In Use ... Not Starting iRODS Server
suggests that you are using port 5432 as your iRODS server port. This will conflict with the default Postgres port. I recommend using the default iRODS server port of 1247. This value was queried during setup as:
iRODS server's port [1247]:
and is recorded in /etc/irods/server_config.json under the zone_port entry.
iRODS-Chat:
It may be easier to continue this on the iRODS-Chat google group. Repairing installs can require back-and-forth communication, which may not be inline with standard stackoverflow usage.
Mongodb stops whenever I try to make a connection.
When I run
sudo service mongod start
I get a message that mongodb is running.
But then when I try to make a connection using PyMongo I get an error that says
Autoreconnect: connection closed
I check my mongodb status:
sudo service mongod status
And it says that my mongodb instance is stopped/waiting.
My mongo log file reports the following:
2015-09-17T18:19:46.816+0000 I NETWORK [initandlisten] waiting for connections on port 7000
2015-09-17T18:19:58.813+0000 I NETWORK [initandlisten] connection accepted from 54.152.111.120:51387 #1 (1 connection now open)
2015-09-17T18:19:58.816+0000 I STORAGE [conn1] _getOpenFile() invalid file index requested 4
2015-09-17T18:19:58.816+0000 I - [conn1] Invariant failure false src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp 201
2015-09-17T18:19:58.837+0000 I CONTROL [conn1]
This is followed by a lengthy backtrace that I can't decipher, then closes with:
2015-09-17T18:19:58.837+0000 I - [conn1]
***aborting after invariant() failure
I've looked around SO, particularly trying the top two answers here, but haven't been able to figure out how to solve the problem.
I'll also note that last time I tried to connect last week, it was working fine.