Postgres not responding after reboot - needs /usr/lib/postgresql/12/bin/pg_ctl restart -D /var/lib/postgresql/12/main - linux

I'm having problems with PostgreSQL on Ubuntu 20.04. After server is rebooted, the database doesn't work and I need to switch the user to postgres and call /usr/lib/postgresql/12/bin/pg_ctl restart -D /var/lib/postgresql/12/main to restart it.
EDIT
So it looks like that the night this started, these upgrades have been automatically installed:
tart-Date: 2021-11-12 06:35:51
Commandline: /usr/bin/unattended-upgrade
Upgrade: libtdb1:amd64 (1.4.2-3build1, 1.4.3-0ubuntu0.20.04.1)
End-Date: 2021-11-12 06:35:51
Start-Date: 2021-11-12 06:35:59
Commandline: /usr/bin/unattended-upgrade
Upgrade: libpq5:amd64 (12.8-0ubuntu0.20.04.1, 12.9-0ubuntu0.20.04.1), libpq-dev:amd64 (12.8-0ubuntu0.20.04.1, 12.9-0ubuntu0.20.04.1)
End-Date: 2021-11-12 06:35:59
Start-Date: 2021-11-12 06:36:07
Commandline: /usr/bin/unattended-upgrade
Upgrade: postgresql-client-12:amd64 (12.8-0ubuntu0.20.04.1, 12.9-0ubuntu0.20.04.1)
End-Date: 2021-11-12 06:36:08
Start-Date: 2021-11-12 06:36:16
Commandline: /usr/bin/unattended-upgrade
Upgrade: postgresql-12:amd64 (12.8-0ubuntu0.20.04.1, 12.9-0ubuntu0.20.04.1)
End-Date: 2021-11-12 06:36:19
----------------------------------------------------------------------------------------------------------
I absolutely don't know where the problem is, can you take a look at it? These are steps:
(Step 4 - postgresql not working, step 8 - it works)
*1 REBOOT
*2
master#myproject-ubuntu:~$ sudo service postgresql status
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Tue 2021-11-16 15:16:22 CST; 29s ago
Process: 713 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 713 (code=exited, status=0/SUCCESS)
Nov 16 15:16:22 myproject-ubuntu systemd[1]: Starting PostgreSQL RDBMS...
Nov 16 15:16:22 myproject-ubuntu systemd[1]: Finished PostgreSQL RDBMS.
*3
sudo grep "postgres" /var/log/syslog
Nov 16 15:16:22 myproject-ubuntu kernel: [ 3.939501] systemd[1]: Created slice system-postgresql.slice.
Nov 16 15:16:22 myproject-ubuntu postgresql#12-main[712]: Error: Could not open logfile /var/log/postgresql/postgresql-12-main.log
Nov 16 15:16:22 myproject-ubuntu postgresql#12-main[638]: Error: /usr/lib/postgresql/12/bin/pg_ctl /usr/lib/postgresql/12/bin/pg_ctl start -D /var/lib/postgresql/12/main -l /var/log/postgresql/postgresql-12-main.log -s -o -c config_file="/etc/postgresql/12/main/postgresql.conf" exited with status 1:
Nov 16 15:16:22 myproject-ubuntu systemd[1]: postgresql#12-main.service: Can't open PID file /run/postgresql/12-main.pid (yet?) after start: Operation not permitted
Nov 16 15:16:22 myproject-ubuntu systemd[1]: postgresql#12-main.service: Failed with result 'protocol'.
Nov 16 15:16:49 myproject-ubuntu gunicorn[984]: File "/home/master/.virtualenvs/arcounty_django/lib/python3.8/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
*4
pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
12 main 5432 down <unknown> /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
*5
CMD: sudo service postgresql restart
CMD: pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
12 main 5432 down <unknown> /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
*6
CMD: sudo su - postgres
CMD: /usr/lib/postgresql/12/bin/pg_ctl restart -D /var/lib/postgresql/12/main
pg_ctl: PID file "/var/lib/postgresql/12/main/postmaster.pid" does not exist
Is server running?
trying to start server anyway
waiting for server to start....2021-11-16 21:21:55.805 UTC [1158] LOG: starting PostgreSQL 12.9 (Ubuntu 12.9-0ubuntu0.20.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit
2021-11-16 21:21:55.806 UTC [1158] LOG: listening on IPv4 address "127.0.0.1", port 5432
2021-11-16 21:21:55.808 UTC [1158] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-11-16 21:21:55.847 UTC [1163] LOG: database system was shut down at 2021-11-16 21:13:45 UTC
2021-11-16 21:21:55.865 UTC [1158] LOG: database system is ready to accept connections
done
server started
*7 exit
*8 (as normal user)
`CMD:pg_lsclusters`
Ver Cluster Port Status Owner Data directory Log file 12 main 5432 online <unknown> /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
EDIT:
permissions & ownerships after reboot (when it's not working)
sudo ls -la /var/lib/postgresql/12/main/
master#myproject-ubuntu:~$ sudo ls -la /var/lib/postgresql/12/main/
[sudo] password for master:
total 88
drwx------ 19 postgres postgres 4096 Nov 16 15:39 .
drwx------ 3 postgres postgres 4096 Oct 6 2020 ..
-rwx------ 1 postgres postgres 3 Oct 6 2020 PG_VERSION
drwx------ 7 postgres postgres 4096 Jan 12 2021 base
drwx------ 2 postgres postgres 4096 Nov 16 15:22 global
drwx------ 2 postgres postgres 4096 Oct 6 2020 pg_commit_ts
drwx------ 2 postgres postgres 4096 Oct 6 2020 pg_dynshmem
drwx------ 4 postgres postgres 4096 Nov 16 15:39 pg_logical
drwx------ 4 postgres postgres 4096 Oct 6 2020 pg_multixact
drwx------ 2 postgres postgres 4096 Nov 16 15:21 pg_notify
drwx------ 2 postgres postgres 4096 Oct 6 2020 pg_replslot
drwx------ 2 postgres postgres 4096 Oct 6 2020 pg_serial
drwx------ 2 postgres postgres 4096 Oct 6 2020 pg_snapshots
drwx------ 2 postgres postgres 4096 Nov 16 15:39 pg_stat
drwx------ 2 postgres postgres 4096 Oct 6 2020 pg_stat_tmp
drwx------ 2 postgres postgres 4096 Nov 1 14:55 pg_subtrans
drwx------ 2 postgres postgres 4096 Oct 6 2020 pg_tblspc
drwx------ 2 postgres postgres 4096 Oct 6 2020 pg_twophase
drwx------ 3 postgres postgres 4096 Nov 11 22:20 pg_wal
drwx------ 2 postgres postgres 4096 Oct 27 09:13 pg_xact
-rwx------ 1 postgres postgres 88 Oct 6 2020 postgresql.auto.conf
-rwx------ 1 postgres postgres 130 Nov 16 15:21 postmaster.opts
sudo ls -la /var/lib/postgresql/12/
master#myproject-ubuntu:~$ sudo ls -la /var/lib/postgresql/12/
total 12
drwx------ 3 postgres postgres 4096 Oct 6 2020 .
drwxr-xr-x 3 postgres postgres 4096 Dec 22 2020 ..
drwx------ 19 postgres postgres 4096 Nov 16 15:39 main
sudo cat etc/postgresql/12/main/start.conf
# Automatic startup configuration
# auto: automatically start the cluster
# manual: manual startup with pg_ctlcluster/postgresql#.service only
# disabled: refuse to start cluster
# See pg_createcluster(1) for details. When running from systemd,
# invoke 'systemctl daemon-reload' after editing this file.
auto
cat /var/log/apt/history.log
Start-Date: 2021-11-09 06:34:56
Commandline: apt-get -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold -qq install -y --only-upgrade do-agent
Upgrade: do-agent:amd64 (3.11.0, 3.12.0)
End-Date: 2021-11-09 06:34:57
Start-Date: 2021-11-10 06:49:20
Commandline: /usr/bin/unattended-upgrade
Install: linux-image-5.4.0-90-generic:amd64 (5.4.0-90.101, automatic), linux-headers-5.4.0-90-generic:amd64 (5.4.0-90.101, automatic), linux-headers-5.4.0-90:amd64 (5.4.0-90.101, automatic), linux-modules-5.4.0-90-generic:amd64 (5.4.0-90.101, automatic)
Upgrade: linux-headers-generic:amd64 (5.4.0.89.93, 5.4.0.90.94), linux-virtual:amd64 (5.4.0.89.93, 5.4.0.90.94), linux-headers-virtual:amd64 (5.4.0.89.93, 5.4.0.90.94), linux-image-virtual:amd64 (5.4.0.89.93, 5.4.0.90.94)
End-Date: 2021-11-10 06:49:40
Start-Date: 2021-11-10 06:49:48
Commandline: /usr/bin/unattended-upgrade
Upgrade: linux-libc-dev:amd64 (5.4.0-89.100, 5.4.0-90.101)
End-Date: 2021-11-10 06:49:49
Start-Date: 2021-11-11 06:44:31
Commandline: /usr/bin/unattended-upgrade
Remove: linux-headers-5.4.0-88-generic:amd64 (5.4.0-88.99), linux-headers-5.4.0-88:amd64 (5.4.0-88.99)
End-Date: 2021-11-11 06:44:34
Start-Date: 2021-11-11 06:44:41
Commandline: /usr/bin/unattended-upgrade
Remove: linux-image-5.4.0-88-generic:amd64 (5.4.0-88.99)
End-Date: 2021-11-11 06:44:43
Start-Date: 2021-11-11 06:44:50
Commandline: /usr/bin/unattended-upgrade
Remove: linux-modules-5.4.0-88-generic:amd64 (5.4.0-88.99)
End-Date: 2021-11-11 06:44:50
Start-Date: 2021-11-12 06:35:51
Commandline: /usr/bin/unattended-upgrade
Upgrade: libtdb1:amd64 (1.4.2-3build1, 1.4.3-0ubuntu0.20.04.1)
End-Date: 2021-11-12 06:35:51
Start-Date: 2021-11-12 06:35:59
Commandline: /usr/bin/unattended-upgrade
Upgrade: libpq5:amd64 (12.8-0ubuntu0.20.04.1, 12.9-0ubuntu0.20.04.1), libpq-dev:amd64 (12.8-0ubuntu0.20.04.1, 12.9-0ubuntu0.20.04.1)
End-Date: 2021-11-12 06:35:59
Start-Date: 2021-11-12 06:36:07
Commandline: /usr/bin/unattended-upgrade
Upgrade: postgresql-client-12:amd64 (12.8-0ubuntu0.20.04.1, 12.9-0ubuntu0.20.04.1)
End-Date: 2021-11-12 06:36:08
Start-Date: 2021-11-12 06:36:16
Commandline: /usr/bin/unattended-upgrade
Upgrade: postgresql-12:amd64 (12.8-0ubuntu0.20.04.1, 12.9-0ubuntu0.20.04.1)
End-Date: 2021-11-12 06:36:19
Start-Date: 2021-11-16 06:29:53
Commandline: /usr/bin/unattended-upgrade
Upgrade: xxd:amd64 (2:8.1.2269-1ubuntu5.3, 2:8.1.2269-1ubuntu5.4)
End-Date: 2021-11-16 06:29:54
Start-Date: 2021-11-16 06:30:01
Commandline: /usr/bin/unattended-upgrade
Upgrade: vim-common:amd64 (2:8.1.2269-1ubuntu5.3, 2:8.1.2269-1ubuntu5.4), vim-runtime:amd64 (2:8.1.2269-1ubuntu5.3, 2:8.1.2269-1ubuntu5.4), vim:amd64 (2:8.1.2269-1ubuntu5.3, 2:8.1.2269-1ubuntu5.4), vim-tiny:amd64 (2:8.1.2269-1ubuntu5.3, 2:8.1.2269-1ubuntu5.4)
End-Date: 2021-11-16 06:30:05
Start-Date: 2021-11-17 06:57:29
Commandline: /usr/bin/unattended-upgrade
Upgrade: accountsservice:amd64 (0.6.55-0ubuntu12~20.04.4, 0.6.55-0ubuntu12~20.04.5), libaccountsservice0:amd64 (0.6.55-0ubuntu12~20.04.4, 0.6.55-0ubuntu12~20.04.5)
End-Date: 2021-11-17 06:57:30
Start-Date: 2021-11-17 07:07:27
Commandline: apt-get purge --auto-remove redis-server
Requested-By: master (1000)
Purge: lua-bitop:amd64 (1.0.2-5), libhiredis0.14:amd64 (0.14.0-6), lua-cjson:amd64 (2.1.0+dfsg-2.1), redis:amd64 (5:5.0.7-2), redis-tools:amd64 (5:5.0.7-2), liblua5.1-0:amd64 (5.1.5-8.1build4), libjemalloc2:amd64 (5.2.1-1ubuntu1), redis-server:amd64 (5:5.0.7-2)
End-Date: 2021-11-17 07:07:30
Start-Date: 2021-11-17 07:07:49
Commandline: apt-get install redis-server
Requested-By: master (1000)
Install: lua-bitop:amd64 (1.0.2-5, automatic), libhiredis0.14:amd64 (0.14.0-6, automatic), lua-cjson:amd64 (2.1.0+dfsg-2.1, automatic), redis-tools:amd64 (5:5.0.7-2, automatic), liblua5.1-0:amd64 (5.1.5-8.1build4, automatic), libjemalloc2:amd64 (5.2.1-1ubuntu1, automatic), redis-server:amd64 (5:5.0.7-2)
End-Date: 2021-11-17 07:07:52

Related

Postgresql12.3 wont start on boot, systemd

I installed Postgres 12.3 from source code with steps(according to this):
./configure --with-openssl --with-systemd
make
sudo make install
If I start with pg_ctl from postgres user all works fine:
pg_ctl -D $PGDATA -l /path/to/logfile
Then I try to create a systemd service, as described here.
Steps:
Create file /etc/systemd/system/postgresql.service with content:
[Unit]
Description=PostgreSQL database server
Documentation=man:postgres(1)
[Service]
Type=notify
User=postgres
ExecStart=/usr/local/pgsql/bin/postgres -D /path/to/pgdata
ExecReload=/bin/kill -HUP $MAINPID
KillMode=mixed
KillSignal=SIGINT
TimeoutSec=0
[Install]
WantedBy=multi-user.target
sudo systemctl enable postgresql.service
Then I reboot my machine.
After restart Postgres unavaliable. Some logs:
sudo systemctl status postgresql.service
postgresql.service - PostgreSQL database server
Loaded: loaded (/etc/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2020-06-05 03:23:32 MSK; 37s ago
Docs: man:postgres(1)
Process: 724 ExecStart=/usr/local/pgsql/bin/postgres -D /path/to/pgdata (code=exited, status=1/FAILURE)
Main PID: 724 (code=exited, status=1/FAILURE)
Jun 05 03:23:31 ctsvc systemd[1]: Starting PostgreSQL database server...
Jun 05 03:23:32 ctsvc systemd[1]: postgresql.service: Main process exited, code=exited, status=1/FAILURE
Jun 05 03:23:32 ctsvc systemd[1]: Failed to start PostgreSQL database server.
Jun 05 03:23:32 ctsvc systemd[1]: postgresql.service: Unit entered failed state.
Jun 05 03:23:32 ctsvc systemd[1]: postgresql.service: Failed with result 'exit-code'.
journalctl -xe | grep postgres
-- Subject: Unit postgresql.service has begun start-up
-- Unit postgresql.service has begun starting up.
Jun 05 03:23:32 ctsvc postgres[724]: 2020-06-05 03:23:32.209 MSK [724] LOG: starting PostgreSQL 12.3 on armv7l-unknown-linux-gnueabihf, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 32-bit
Jun 05 03:23:32 ctsvc postgres[724]: 2020-06-05 03:23:32.211 MSK [724] LOG: could not bind IPv4 address "172.17.17.42": Cannot assign requested address
Jun 05 03:23:32 ctsvc postgres[724]: 2020-06-05 03:23:32.211 MSK [724] HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
Jun 05 03:23:32 ctsvc postgres[724]: 2020-06-05 03:23:32.211 MSK [724] WARNING: could not create listen socket for "172.17.17.42"
Jun 05 03:23:32 ctsvc postgres[724]: 2020-06-05 03:23:32.211 MSK [724] FATAL: could not create any TCP/IP sockets
Jun 05 03:23:32 ctsvc postgres[724]: 2020-06-05 03:23:32.212 MSK [724] LOG: database system is shut down
Jun 05 03:23:32 ctsvc systemd[1]: postgresql.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit postgresql.service has failed
-- Unit postgresql.service has failed.
Jun 05 03:23:32 ctsvc systemd[1]: postgresql.service: Unit entered failed state.
Jun 05 03:23:32 ctsvc systemd[1]: postgresql.service: Failed with result 'exit-code'.
Jun 05 03:24:09 ctsvc sudo[1602]: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/systemctl status postgresql.service
netstat -tnl | grep "5432" - shows nothing.
After that I can manualy run this service:
sudo systemctl status postgresql.service
● postgresql.service - PostgreSQL database server
Loaded: loaded (/etc/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-06-05 03:30:57 MSK; 8s ago
Docs: man:postgres(1)
Main PID: 1681 (postgres)
Tasks: 8 (limit: 4915)
CGroup: /system.slice/postgresql.service
├─1681 /usr/local/pgsql/bin/postgres -D /path/to/pgdata
├─1683 postgres: checkpointer
├─1684 postgres: background writer
├─1685 postgres: walwriter
├─1686 postgres: autovacuum launcher
├─1687 postgres: stats collector
├─1688 postgres: logical replication launcher
└─1693 postgres: postgres postgres 172.17.17.40(53600) idle
Jun 05 03:30:56 ctsvc systemd[1]: Starting PostgreSQL database server...
Jun 05 03:30:57 ctsvc postgres[1681]: 2020-06-05 03:30:57.006 MSK [1681] LOG: starting PostgreSQL 12.3 on armv7l-unknown-linux-gnueabihf, compiled b
Jun 05 03:30:57 ctsvc postgres[1681]: 2020-06-05 03:30:57.007 MSK [1681] LOG: listening on IPv4 address "172.17.17.42", port 5432
Jun 05 03:30:57 ctsvc postgres[1681]: 2020-06-05 03:30:57.032 MSK [1681] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
Jun 05 03:30:57 ctsvc postgres[1681]: 2020-06-05 03:30:57.424 MSK [1682] LOG: database system was shut down at 2020-06-05 02:59:03 MSK
Jun 05 03:30:57 ctsvc postgres[1681]: 2020-06-05 03:30:57.725 MSK [1681] LOG: database system is ready to accept connections
Jun 05 03:30:57 ctsvc systemd[1]: Started PostgreSQL database server.
netstat -tnl | grep '5432'
tcp 0 0 172.17.17.42:5432 0.0.0.0:* LISTEN
In my postgresql.conf I have following:
# - Connection Settings -
listen_addresses = '172.17.17.42'
port = 5432
max_connections = 100
If it helps: Postgres runs on Cubietruck with Armbian.
uname -a
Linux ctsvc 4.19.62-sunxi #5.92 SMP Wed Jul 31 22:07:23 CEST 2019 armv7l GNU/Linux
In my system there are no more processes that try to bind this port at boot time. As far as I understand, with the service itself and Postgresql everything is fine. However, something strange happens during the launch, but I can’t understand how to find out the reason of this behavior.
Thanks in advance.
Finally my file /etc/systemd/system/postgresql.service looks like this:
[Unit]
Description=PostgreSQL database server
Documentation=man:postgres(1)
Wants=network-online.target
After=network.target network-online.target
[Service]
Type=notify
User=postgres
ExecStart=/usr/local/pgsql/bin/postgres -D /path/to/pgdata
ExecReload=/bin/kill -HUP $MAINPID
KillMode=mixed
KillSignal=SIGINT
TimeoutSec=0
[Install]
WantedBy=multi-user.target
Thanks to Laurenz Albe comment, I added following in Unit section:
Wants=network-online.target
After=network.target network-online.target
to make sure that network fully operational before PG start. After this PG running correctly after reboot.

RabbitMQ installation Error

I am installing rabbitMQ on ubuntu16.04. But I am getting below error. I tries searching for it but not able to resolve it.
Adding group `rabbitmq' (GID 131) ...
Done.
Adding system user `rabbitmq' (UID 123) ...
Adding new user `rabbitmq' (UID 123) with group `rabbitmq' ...
Not creating home directory `/var/lib/rabbitmq'.
Job for rabbitmq-server.service failed because the control process exited with error code. See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details.
invoke-rc.d: initscript rabbitmq-server, action "start" failed.
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2018-07-05 12:21:02 IST; 3ms ago
Process: 9259 ExecStop=/bin/sh -c while ps -p $MAINPID >/dev/null 2>&1; do sleep 1; done (code=exited, status=0/SUCCESS)
Process: 9107 ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop (code=exited, status=0/SUCCESS)
Process: 8788 ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server (code=exited, status=1/FAILURE)
Main PID: 8788 (code=exited, status=1/FAILURE)
Jul 05 12:21:02 sumit-precision-7520 systemd[1]: Failed to start RabbitMQ broker.
Jul 05 12:21:02 sumit-precision-7520 systemd[1]: rabbitmq-server.service: Unit entered failed state.
Jul 05 12:21:02 sumit-precision-7520 systemd[1]: rabbitmq-server.service: Failed with result 'exit-code'.
dpkg: error processing package rabbitmq-server (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for systemd (229-4ubuntu21.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
rabbitmq-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
When I run following command.
systemctl status rabbitmq-server.service
Output:
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2018-07-05 12:21:26 IST; 8s ago
Process: 10278 ExecStop=/bin/sh -c while ps -p $MAINPID >/dev/null 2>&1; do sleep 1; done (code=exited, status=0/SUCCESS)
Process: 10127 ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop (code=exited, status=0/SUCCESS)
Process: 9805 ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server (code=exited, status=1/FAILURE)
Main PID: 9805 (code=exited, status=1/FAILURE)
Jul 05 12:21:26 sumit-precision-7520 systemd[1]: Failed to start RabbitMQ broker.
Jul 05 12:21:26 sumit-precision-7520 systemd[1]: rabbitmq-server.service: Unit entered failed state.
Jul 05 12:21:26 sumit-precision-7520 systemd[1]: rabbitmq-server.service: Failed with result 'exit-code'.
My host entries are :
127.0.0.1 localhost
127.0.1.1 sumit-precision-7520
Also when I checked this /var/log/rabbitmq/ Path, there is no file in it.
Why I am getting this output. How can I resolve it.
Edit
Output of following commands
CMD: journalctl -xe
-- Unit rabbitmq-server.service has begun starting up.
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: BOOT FAILED
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: ===========
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: Error description:
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: noproc
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: Log files (may contain more information):
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: /var/log/rabbitmq/rabbit#sumit-precision-7520.log
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: /var/log/rabbitmq/rabbit#sumit-precision-7520-sasl.log
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: Stack trace:
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: [{gen,do_for_proc,2,[{file,"gen.erl"},{line,228}]},
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: {gen_event,rpc,2,[{file,"gen_event.erl"},{line,239}]},
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: {rabbit,ensure_working_log_handlers,0,
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: [{file,"src/rabbit.erl"},{line,856}]},
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: {rabbit,'-boot/0-fun-0-',0,[{file,"src/rabbit.erl"},{line,288}]},
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: {rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,424}]},
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: {init,start_em,1,[]},
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: {init,do_boot,3,[]}]
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: =INFO REPORT==== 10-Jul-2018::11:29:58.597458 ===
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: Error description:
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: noproc
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: Log files (may contain more information):
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: /var/log/rabbitmq/rabbit#sumit-precision-7520.log
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: /var/log/rabbitmq/rabbit#sumit-precision-7520-sasl.log
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: Stack trace:
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: [{gen,do_for_proc,2,[{file,"gen.erl"},{line,228}]},
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: {gen_event,rpc,2,[{file,"gen_event.erl"},{line,239}]},
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: {rabbit,ensure_working_log_handlers,0,
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: [{file,"src/rabbit.erl"},{line,856}]},
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: {rabbit,'-boot/0-fun-0-',0,[{file,"src/rabbit.erl"},{line,288}]},
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: {rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,424}]},
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: {init,start_em,1,[]},
Jul 10 11:29:58 sumit-precision-7520 rabbitmq-server[29523]: {init,do_boot,3,[]}]
Jul 10 11:29:59 sumit-precision-7520 rabbitmq-server[29523]: {"init terminating in do_boot",noproc}
Jul 10 11:29:59 sumit-precision-7520 rabbitmq-server[29523]: init terminating in do_boot (noproc)
Jul 10 11:29:59 sumit-precision-7520 rabbitmq-server[29523]: [1B blob data]
Jul 10 11:29:59 sumit-precision-7520 rabbitmq-server[29523]: Crash dump is being written to: erl_crash.dump...done
Jul 10 11:29:59 sumit-precision-7520 systemd[1]: rabbitmq-server.service: Main process exited, code=exited, status=1/FAILURE
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: Stopping and halting node 'rabbit#sumit-precision-7520'
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: Error: unable to connect to node 'rabbit#sumit-precision-7520': nodedown
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: DIAGNOSTICS
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: ===========
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: attempted to contact: ['rabbit#sumit-precision-7520']
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: rabbit#sumit-precision-7520:
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: * connected to epmd (port 4369) on sumit-precision-7520
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: * epmd reports: node 'rabbit' not running at all
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: no other nodes on sumit-precision-7520
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: * suggestion: start the node
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: current node details:
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: - node name: 'rabbitmq-cli-19#sumit-precision-7520'
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: - home dir: /var/lib/rabbitmq
Jul 10 11:30:00 sumit-precision-7520 rabbitmqctl[29847]: - cookie hash: Yz59fP8Pd/2GV5iaJa/Xng==
Jul 10 11:30:00 sumit-precision-7520 systemd[1]: Failed to start RabbitMQ broker.
-- Subject: Unit rabbitmq-server.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit rabbitmq-server.service has failed.
--
-- The result is failed.
Jul 10 11:30:00 sumit-precision-7520 systemd[1]: rabbitmq-server.service: Unit entered failed state.
Jul 10 11:30:00 sumit-precision-7520 systemd[1]: rabbitmq-server.service: Failed with result 'exit-code'.
CMD: /usr/sbin/rabbitmq-server as root
BOOT FAILED
===========
Error description:
noproc
Log files (may contain more information):
/var/log/rabbitmq/rabbit#sumit-precision-7520.log
/var/log/rabbitmq/rabbit#sumit-precision-7520-sasl.log
Stack trace:
[{gen,do_for_proc,2,[{file,"gen.erl"},{line,228}]},
{gen_event,rpc,2,[{file,"gen_event.erl"},{line,239}]},
{rabbit,ensure_working_log_handlers,0,
[{file,"src/rabbit.erl"},{line,856}]},
{rabbit,'-boot/0-fun-0-',0,[{file,"src/rabbit.erl"},{line,288}]},
{rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,424}]},
{init,start_em,1,[]},
{init,do_boot,3,[]}]
=INFO REPORT==== 10-Jul-2018::11:33:14.902211 ===
Error description:
noproc
Log files (may contain more information):
/var/log/rabbitmq/rabbit#sumit-precision-7520.log
/var/log/rabbitmq/rabbit#sumit-precision-7520-sasl.log
Stack trace:
[{gen,do_for_proc,2,[{file,"gen.erl"},{line,228}]},
{gen_event,rpc,2,[{file,"gen_event.erl"},{line,239}]},
{rabbit,ensure_working_log_handlers,0,
[{file,"src/rabbit.erl"},{line,856}]},
{rabbit,'-boot/0-fun-0-',0,[{file,"src/rabbit.erl"},{line,288}]},
{rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,424}]},
{init,start_em,1,[]},
{init,do_boot,3,[]}]
{"init terminating in do_boot",noproc}
init terminating in do_boot (noproc)
Crash dump is being written to: erl_crash.dump...done
I have also checked for the log file at location /var/log/rabbitmq/rabbit#sumit-precision-7520.log
but no log file is generated.
Edit 2
Installation procedure:
$ wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
$ sudo dpkg -i erlang-solutions_1.0_all.deb
$ sudo apt-get update
$ sudo apt-get install esl-erlang
$ echo "deb http://www.rabbitmq.com/debian/ testing main" | sudo tee /etc/apt/sources.list.d/rabbitmq.list > /dev/null
$ sudo wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
$ sudo apt-key add rabbitmq-signing-key-public.asc
$ sudo apt-get update
$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 6B73A36E6026DFCA
$ sudo apt-get update
$ sudo apt-get install rabbitmq-server
Before installing erlang and rabbitmq-server, I have installed LAMP(Apache, Mysql and PHP7.0) and node.js.
I have install the same before and it was working fine. I don't understand what I am missing here.
You should install RabbitMQ with version that is compatible with version of installed Erlang.
RabbitMQ Erlang version requirements you can find here: https://www.rabbitmq.com/which-erlang.html#compatibility-matrix
To get Erlang version type in Terminal:
erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
Remove previous RabbitMQ installed:
$ sudo apt-get purge rabbitmq-server
$ sudo rm -fr /var/lib/rabbitmq/
To install appropriate version of RabbitMQ you should do it from repo:
https://www.rabbitmq.com/install-debian.html#manual-installation
In my case (Erlang v21) required version of RabbitMQ is 3.7.17:
$ sudo apt-get -y install socat logrotate init-system-helpers adduser
$ cd /opt/tools/
$ sudo wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.17/rabbitmq-server_3.7.17-1_all.deb
$ sudo dpkg -i rabbitmq-server_3.7.17-1_all.deb
$ sudo rm rabbitmq-server_3.7.17-1_all.deb
I had exactly the same problem when installed from the repository. Resolved by installing both Erlang and RabbitMQ from the .deb files, according to the manual on the official site:
https://www.rabbitmq.com/install-debian.html
Here is a Vagrantfile that is guaranteed to work - I just tested it:
https://gist.github.com/lukebakken/44f2fe3770d43dd12acfe6dfbc1818d3
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.
I have also met with the same error while trying to start service after finishing install using apt-get install method. Followed the documentation in the below url.
I could understand that the debain9 installs has the same issue.
https://tecadmin.net/install-rabbitmq-server-debian/
root#rabbitmq:/var/log/rabbitmq# cat startup_log
BOOT FAILED
===========
Error description:
noproc
Log files (may contain more information):
/var/log/rabbitmq/rabbit#rabbitmq.log
/var/log/rabbitmq/rabbit#rabbitmq-sasl.log
I have managed to resolve the case by following dpkg -i installation steps, Below are the steps I have followed.
apt-get purge rabbitmq-server
apt-get purge erlang
apt-get autoremove
reboot
installation via dpkg method which solved the problem
Dependencies that need to be fixed before dpkg method.
apt-get -y install socat logrotate init-system-helpers adduser
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.15/rabbitmq-server_3.7.15-1_all.deb
/etc/init.d/rabbitmq-server start
And service has started good.
PS:This is probably stale by now but let me just add it for someone who is currently facing this issue.
Ensure that there is no process running on port 5672. This error can be common when you are trying to run multiple message brokers on the same JVM. In my case I had to modify activemq ports and let rabbitmq utilize the default port.

postgresql service not running on RHEL 7

We have an application that is running on RHEL6/32 bit and RHEL6/64 bit. This application uses postgresql 8.4 from the beginning. Now, we want to provide support for this application on RHEL7/64 bit. RHEL7 comes with default postgresql 9.2 in its yum list and this is getting installed and its related services are running properly as well. But after installing postgresql 8.4 on RHEL7, it seems like the services are never running. Please find below the logs:
[root#linpubn218 postgres]# service postgresql status
postgresql.service - SYSV: PostgreSQL database server.
Loaded: loaded (/etc/rc.d/init.d/postgresql)
Active: failed (Result: resources) since Mon 2016-07-25 12:40:28 IST; 2h 0min ago
Docs: man:systemd-sysv-generator(8)
Jul 25 12:40:26 linpubn218.gl.avaya.com systemd[1]: Starting SYSV: PostgreSQL database server....
Jul 25 12:40:28 linpubn218.gl.avaya.com postgresql[26957]: Starting postgresql service: [ OK ]
Jul 25 12:40:28 linpubn218.gl.avaya.com systemd[1]: PID file /var/run/postmaster-8.4.pid not readable (yet?) after start.
Jul 25 12:40:28 linpubn218.gl.avaya.com systemd[1]: Failed to start SYSV: PostgreSQL database server..
Jul 25 12:40:28 linpubn218.gl.avaya.com systemd[1]: Unit postgresql.service entered failed state.
Jul 25 12:40:28 linpubn218.gl.avaya.com systemd[1]: postgresql.service failed.
Jul 25 14:33:45 linpubn218.gl.avaya.com systemd[1]: Unit postgresql.service cannot be reloaded because it is inactive.
Jul 25 14:33:45 linpubn218.gl.avaya.com systemd[1]: Unit postgresql.service cannot be reloaded because it is inactive.
After looking at the logs in journalctl -xe
[root#linpubn218 postgres]# journalctl -xe
Jul 25 14:39:21 linpubn218.gl.avaya.com yum[29260]: Installed: postgresql84-libs-8.4.17-1PGDG.rhel6.x86_64
Jul 25 14:39:45 linpubn218.gl.avaya.com yum[29275]: Installed: postgresql84-8.4.17-1PGDG.rhel6.x86_64
Jul 25 14:40:01 linpubn218.gl.avaya.com useradd[29316]: failed adding user 'postgres', exit code: 9
Jul 25 14:40:02 linpubn218.gl.avaya.com CROND[29320]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Jul 25 14:40:02 linpubn218.gl.avaya.com systemd[1]: Reloading.
Jul 25 14:40:03 linpubn218.gl.avaya.com systemd[1]: Configuration file /usr/lib/systemd/system/auditd.service is marked world-inaccessible. This has no effect as config
Jul 25 14:40:03 linpubn218.gl.avaya.com yum[29309]: Installed: postgresql84-server-8.4.17-1PGDG.rhel6.x86_64
Jul 25 14:42:05 linpubn218.gl.avaya.com polkitd[819]: Registered Authentication Agent for unix-process:29459:43987285 (system bus name :1.292 [/usr/bin/pkttyagent --not
Jul 25 14:42:05 linpubn218.gl.avaya.com systemd[1]: Starting SYSV: PostgreSQL database server....
Jul 25 14:42:06 linpubn218.gl.avaya.com runuser[29473]: pam_unix(runuser-l:session): session closed for user postgres
Jul 25 14:42:08 linpubn218.gl.avaya.com postgresql[29464]: Starting postgresql service: [ OK ]
Jul 25 14:42:08 linpubn218.gl.avaya.com systemd[1]: PID file /var/run/postmaster-8.4.pid not readable (yet?) after start.
Jul 25 14:42:08 linpubn218.gl.avaya.com systemd[1]: Failed to start SYSV: PostgreSQL database server..
Can postgresql 8.4 be installed on RHEL7, which is a systemd based OS? If yes, then what should I do to remove the above error?
I noticed that in /etc/init.d/postgresql-8.4 there is a declared variable:
pidfile="/var/run/postmaster-${PGMAJORVERSION}.${PGPORT}.pid"
But in systemctl, PIDfile is not the same:
# systemctl show postgresql-8.4.service -p PIDFile
PIDFile=/var/run/postmaster-8.4.pid
So, to fix the problem edit /etc/init.d/postgresql-8.4 and replace
pidfile="/var/run/postmaster-${PGMAJORVERSION}.${PGPORT}.pid"
with
pidfile="/var/run/postmaster-${PGMAJORVERSION}.pid"
then reload systemctl:
# systemctl daemon-reload
#/etc/init.d/postgresql-8.4 start
Starting postgresql-8.4 (via systemctl): [ OK ]
Generally permissions caused this type of error
su - postgres
After that:
chmod 700 -R <data_directory>
And you should check SELinux as well.

Can't start newly installed PostgreSQL on Fedora

I just installed PostgreSQL (9.3) on my Linux Fedora (21) - Shown below
yum installer returns 'already installed' as this is the second time I run it, to get a screengrab for you.
systemctl enable postgresq, seems to work. At least it returns no errors.
systemctl start postgresql fails. The log says "data directory "/ConfigDir" does not exist" So I guess that's the key.
But the /ConfigDir do exis. It's /usr/local/pgsql/data as is default on a Fedora PostgreSQL instalation. It is tough owned by user:postgres
I guess that the start of the postgres server service fails because it somehow can't see the directory, likely because it's not trying as user:postgres.
But I don't know how to check this, nor how to mend it.
[martin#helium ~]$ sudo yum install postgresql-server postgresql-contrib
[sudo] password for martin:
Loaded plugins: langpacks
Package postgresql-server-9.3.9-1.fc21.x86_64 already installed and latest version
Package postgresql-contrib-9.3.9-1.fc21.x86_64 already installed and latest version
Nothing to do
[martin#helium ~]$ sudo systemctl enable postgresql
[martin#helium ~]$ sudo systemctl start postgresql
Job for postgresql.service failed. See "systemctl status postgresql.service" and "journalctl -xe" for details.
[martin#helium ~]$ journalctl -xn
-- Logs begin at Fri 2014-12-26 16:16:25 CET, end at Sun 2016-02-07 14:35:11 CET. --
Feb 07 14:35:06 helium.hvidberg.net sudo[3466]: martin : TTY=pts/0 ; PWD=/home/martin ; USER=root ; COMMAND=/bin/systemctl start postgresql
Feb 07 14:35:06 helium.hvidberg.net sudo[3466]: pam_unix(sudo:session): session opened for user root by martin(uid=0)
Feb 07 14:35:06 helium.hvidberg.net pg_ctl[3476]: FATAL: data directory "/ConfigDir" does not exist
Feb 07 14:35:11 helium.hvidberg.net pg_ctl[3476]: pg_ctl: could not start server
Feb 07 14:35:11 helium.hvidberg.net pg_ctl[3476]: Examine the log output.
Feb 07 14:35:11 helium.hvidberg.net systemd[1]: postgresql.service: control process exited, code=exited status=1
Feb 07 14:35:11 helium.hvidberg.net systemd[1]: Failed to start PostgreSQL database server.
-- Subject: Unit postgresql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql.service has failed.
--
-- The result is failed.
Feb 07 14:35:11 helium.hvidberg.net systemd[1]: Unit postgresql.service entered failed state.
Feb 07 14:35:11 helium.hvidberg.net systemd[1]: postgresql.service failed.
Feb 07 14:35:11 helium.hvidberg.net sudo[3466]: pam_unix(sudo:session): session closed for user root
[martin#helium ~]$
Change to root to be able to see the postgresql data directory
[root#helium data]# pwd
/usr/local/pgsql/data
[root#helium data]# ls -l
total 100
drwx------. 5 postgres postgres 4096 Feb 6 19:00 base
drwx------. 2 postgres postgres 4096 Feb 6 19:03 global
drwx------. 2 postgres postgres 4096 Feb 6 19:00 pg_clog
-rw-------. 1 postgres postgres 4476 Feb 6 19:00 pg_hba.conf
-rw-------. 1 postgres postgres 1636 Feb 6 19:00 pg_ident.conf
drwx------. 2 postgres postgres 4096 Feb 6 19:03 pg_log
drwx------. 4 postgres postgres 4096 Feb 6 19:00 pg_multixact
drwx------. 2 postgres postgres 4096 Feb 6 19:03 pg_notify
drwx------. 2 postgres postgres 4096 Feb 6 19:00 pg_serial
drwx------. 2 postgres postgres 4096 Feb 6 19:00 pg_snapshots
drwx------. 2 postgres postgres 4096 Feb 6 19:05 pg_stat
drwx------. 2 postgres postgres 4096 Feb 6 19:05 pg_stat_tmp
drwx------. 2 postgres postgres 4096 Feb 6 19:00 pg_subtrans
drwx------. 2 postgres postgres 4096 Feb 6 19:00 pg_tblspc
drwx------. 2 postgres postgres 4096 Feb 6 19:00 pg_twophase
-rw-------. 1 postgres postgres 4 Feb 6 19:00 PG_VERSION
drwx------. 3 postgres postgres 4096 Feb 6 19:00 pg_xlog
-rw-------. 1 postgres postgres 20733 Feb 7 10:26 postgresql.conf
-rw-------. 1 postgres postgres 47 Feb 6 19:03 postmaster.opts
[root#helium data]#

Mongodb: why is my mongo server using two PID's?

I started my mongo with the following command:
[lucas#ecoinstance]~/node/nodetest2$ sudo mongod --dbpath /home/lucas/node/nodetest2/data
2014-06-07T08:46:30.507+0000 [initandlisten] MongoDB starting : pid=6409 port=27017 dbpat
h=/home/lucas/node/nodetest2/data 64-bit host=ecoinstance
2014-06-07T08:46:30.508+0000 [initandlisten] db version v2.6.1
2014-06-07T08:46:30.508+0000 [initandlisten] git version: 4b95b086d2374bdcfcdf2249272fb55
2c9c726e8
2014-06-07T08:46:30.508+0000 [initandlisten] build info: Linux build14.nj1.10gen.cc 2.6.3
2-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2014-06-07T08:46:30.509+0000 [initandlisten] allocator: tcmalloc
2014-06-07T08:46:30.509+0000 [initandlisten] options: { storage: { dbPath: "/home/lucas/n
ode/nodetest2/data" } }
2014-06-07T08:46:30.520+0000 [initandlisten] journal dir=/home/lucas/node/nodetest2/data/
journal
2014-06-07T08:46:30.520+0000 [initandlisten] recover : no journal files present, no recov
ery needed
2014-06-07T08:46:30.527+0000 [initandlisten] waiting for connections on port 27017
It appears to be working, as I can execute mongo and access the server. However, here are the process running mongo:
[lucas#ecoinstance]~/node/testSite$ ps aux | grep mongo
root 6540 0.0 0.2 33424 1664 pts/3 S+ 08:52 0:00 sudo mongod --dbpath /ho
me/lucas/node/nodetest2/data
root 6541 0.6 8.6 522140 52512 pts/3 Sl+ 08:52 0:00 mongod --dbpath /home/lu
cas/node/nodetest2/data
lucas 6554 0.0 0.1 7836 876 pts/4 S+ 08:52 0:00 grep mongo
As you can see, there are two PID's for mongo. Before I ran sudo mongod --dbpath /home/lucas/node/nodetest2/data, there were none (besides the grep of course). How did my command spawn two PID's, and should I be concerned? Any suggestions or tips would be great.
Additional Info
In addition, I may have other issues that might suggest a cause. I tried running mongo with --fork --logpath /home/lucas..., but it did not work. More information below:
[lucas#ecoinstance]~/node/nodetest2$ sudo mongod --dbpath /home/lucas/node/nodetest2/data
--fork --logpath /home/lucas/node/nodetest2/data/
about to fork child process, waiting until server is ready for connections.
forked process: 6578
ERROR: child process failed, exited with error number 1
[lucas#ecoinstance]~/node/nodetest2$ ls -l data/
total 163852
drwxr-xr-x 2 mongodb nogroup 4096 Jun 7 08:54 journal
-rw------- 1 mongodb nogroup 67108864 Jun 7 08:52 local.0
-rw------- 1 mongodb nogroup 16777216 Jun 7 08:52 local.ns
-rwxr-xr-x 1 mongodb nogroup 0 Jun 7 08:54 mongod.lock
-rw------- 1 mongodb nogroup 67108864 Jun 7 02:08 nodetest1.0
-rw------- 1 mongodb nogroup 16777216 Jun 7 02:08 nodetest1.ns
Also, my db path folder is not the original location. It was originally created under the default /var/lib/mongodb/ and moved to my local data folder. This was done after shutting down the server via /etc/init.d/mongod stop.
I have a Debian Wheezy server, if it matters.
Regarding the 2 processes with the mongod in them after using sudo to run mongod, that is normal. That is how sudo runs. The actual mongod process that is running the database and that you are connecting to with mongo is
root 6541 0.6 8.6 522140 52512 pts/3 Sl+ 08:52 0:00
mongod --dbpath /home/lu cas/node/nodetest2/data
You can always check this by looking at the mongod.lock file in your dbpath - in your case it should be in
/home/lucas/node/nodetest2/data
Regarding your attempt to fork and use a logpath, you are setting up logpath incorrectly. It needs to be a file name, not a directory. Something like:
--logpath /var/log/mongodb/mongo.log

Resources