Page 2 of 2
Re: db repair failed
Posted: Mon Jan 21, 2019 8:27 am
by rtsupport
we are using below sequence while restarting full nagios.
OS version we are using -- RHEL 7
sudo service nagios stop
sudo service httpd stop
sudo service npcd stop
sudo service ndo2db stop
sudo service mysqld stop
sudo service mariadb stop
sudo service postgresql stop
sudo service gearmand stop
sudo service gearmand start
sudo service postgresql start
sudo service mariadb start
sudo service mysqld start
sudo service ndo2db start
sudo service npcd start
sudo service httpd start
sudo service nagios start
Re: db repair failed
Posted: Mon Jan 21, 2019 4:14 pm
by scottwilkerson
In RHEL 7 this would be the preferred calls
Code: Select all
sudo systemctl stop nagios
sudo systemctl stop httpd
sudo systemctl stop npcd
sudo systemctl stop ndo2db
sudo systemctl stop mysqld
sudo systemctl stop mariadb
sudo systemctl stop postgresql
sudo systemctl stop gearmand
sudo systemctl start gearmand
sudo systemctl start postgresql
sudo systemctl start mariadb
sudo systemctl start mysqld
sudo systemctl start ndo2db
sudo systemctl start npcd
sudo systemctl start httpd
sudo systemctl start nagios
Re: db repair failed
Posted: Mon Jan 21, 2019 10:13 pm
by rtsupport
yehh i know that and if we do service start nagios then it will be also redirecting to systemctl start nagios and i don't think so this will be in issue. however next weekend we have scheduled to restart this server and at this time we will stop and start the service using systemctl and will let you know the status accordingly.
Re: db repair failed
Posted: Tue Jan 22, 2019 7:43 am
by scottwilkerson
rtsupport wrote:however next weekend we have scheduled to restart this server and at this time we will stop and start the service using systemctl and will let you know the status accordingly.
Sounds good.
Re: db repair failed
Posted: Wed Jan 23, 2019 7:56 am
by rtsupport
today we restarted the server, We stopped all service before restart the server but we observed that all service in start status when server reboot.
is this fine or do we need to change something so that whenever server reboot we will start the service manually with correct sequence?
Also found below error while restarting gearmand service where "gearmand" folder was deleted automatically during reboot process. after creating the gearmand folder under /var/run service restarted.
Code: Select all
bash-4.2$ sudo systemctl status gearmand
● gearmand.service - LSB: start and stop the Gearman server
Loaded: loaded (/etc/rc.d/init.d/gearmand; bad; vendor preset: disabled)
Active: failed (Result: timeout) since Wed 2019-01-23 07:32:37 EST; 2min 37s ago
Docs: man:systemd-sysv-generator(8)
Process: 9673 ExecStart=/etc/rc.d/init.d/gearmand start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/gearmand.service
└─9745 /usr/sbin/gearmand -d --worker-wakeup=10 --retention-file=/tmp/gearmand.retention -q retention --log-file=/var/log/gea...
Jan 23 07:27:37 usa0300lv1126 systemd[1]: Starting LSB: start and stop the Gearman server...
Jan 23 07:27:38 usa0300lv1126 runuser[9709]: pam_unix(runuser:session): session opened for user gearmand by (uid=0)
Jan 23 07:27:38 usa0300lv1126 gearmand[9673]: Starting gearmand: [ OK ]
Jan 23 07:27:38 usa0300lv1126 gearmand[9673]: /etc/rc.d/init.d/gearmand: line 43: /var/run/gearmand/gearmand.pid: No such file or directory
Jan 23 07:27:38 usa0300lv1126 systemd[1]: PID file /var/run/gearmand/gearmand.pid not readable (yet?) after start.
Jan 23 07:32:37 usa0300lv1126 systemd[1]: gearmand.service start operation timed out. Terminating.
Jan 23 07:32:37 usa0300lv1126 systemd[1]: Failed to start LSB: start and stop the Gearman server.
Jan 23 07:32:37 usa0300lv1126 systemd[1]: Unit gearmand.service entered failed state.
Jan 23 07:32:37 usa0300lv1126 systemd[1]: gearmand.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
Re: db repair failed
Posted: Wed Jan 23, 2019 8:19 am
by scottwilkerson
This all sounds fine except the gearman problem
You may want to edit
/etc/rc.d/init.d/gearmand to add the following above line 43
Re: db repair failed
Posted: Wed Jan 23, 2019 8:38 am
by rtsupport
is that fine?
FROM
Code: Select all
gearmand=/usr/sbin/gearmand
prog=gearmand
RETVAL=0
start() {
echo -n $"Starting $prog: "
daemon --pidfile=$pidfile --user=gearmand $gearmand -d $OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && (touch $lockfile; pgrep -f $gearmand > $pidfile)
return $RETVAL
TO
Code: Select all
gearmand=/usr/sbin/gearmand
prog=gearmand
RETVAL=0
start() {
echo -n $"Starting $prog: "
daemon --pidfile=$pidfile --user=gearmand $gearmand -d $OPTIONS
RETVAL=$?
echo
mkdir -p /var/run/gearmand
[ $RETVAL = 0 ] && (touch $lockfile; pgrep -f $gearmand > $pidfile)
return $RETVAL
Re: db repair failed
Posted: Wed Jan 23, 2019 8:49 am
by scottwilkerson
that should do it
Re: db repair failed
Posted: Wed Jan 23, 2019 9:01 am
by rtsupport
ok, thank you! i will make the changes, and as we are good as of now you may close the thread now/
Thank you! again Scott, for your advise.
Re: db repair failed
Posted: Wed Jan 23, 2019 9:05 am
by scottwilkerson
rtsupport wrote:ok, thank you! i will make the changes, and as we are good as of now you may close the thread now/
Thank you! again Scott, for your advise.
Great!
Locking thread