mariadb galera node stuck at WSREP state transfer ongoing - galera

I restarted mariadb galera cluster node, and now its taking ages to start, however I noticed
Status: "WSREP state transfer ongoing, current seqno: 9331 waited 510.000000 secs" and also noticed Memory: 71.3M memory usage is going up everytime I recheck mariadb service status
mariadb.service - MariaDB 10.1.47 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: activating (start) since Fri 2020-11-27 21:26:43 GMT; 8min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 19409 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, statu
Process: 19407 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
Process: 19497 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /u
Process: 19495 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status
Process: 19494 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=
Main PID: 19701 (mysqld)
Status: "WSREP state transfer ongoing, current seqno: 9331 waited 510.000000 secs"
Tasks: 14 (limit: 4573)
Memory: 71.3M
CPU: 49.181s
CGroup: /system.slice/mariadb.service
├─19701 /usr/sbin/mysqld --wsrep_start_position=5b96f94b-2dcb-11eb-8e8b-eff8238871c4:9331
├─19764 sh -c wsrep_sst_rsync --role 'joiner' --address '192.168.5.165' --datadir '/var/lib/mysql/'
├─19765 /bin/bash -ue /usr//bin/wsrep_sst_rsync --role joiner --address 192.168.5.165 --datadir /var
├─19824 rsync --daemon --no-detach --port 4444 --config /var/lib/mysql//rsync_sst.conf
├─19865 rsync --daemon --no-detach --port 4444 --config /var/lib/mysql//rsync_sst.conf
├─19884 rsync --daemon --no-detach --port 4444 --config /var/lib/mysql//rsync_sst.conf
└─23405 sleep 1
what should I do, what is the best possbile way to avoid this in the future ?

First of all support for MariaDB 10.1 has ended but you could increase the systemd timeout.

Related

Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service"

I am trying to install Devstack but it stopping in the middle
Currently trying to install openstack, but the long process of individual installation, so am using devstack, however i already install OSM release 5. I just need a vim to put the images. Anyway I am installing openstack using devstack. But it's stopping in the middle . This was the error i am getting,
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 644 /usr/lib/apache2/modules/mod_proxy_uwsgi.so
+lib/apache:install_apache_uwsgi:102 popd
~/devstack
+lib/apache:install_apache_uwsgi:104 sudo rm -rf /tmp/tmp.EgMQRfNaCS
+lib/apache:install_apache_uwsgi:106 is_ubuntu
+functions-common:is_ubuntu:466 [[ -z deb ]]
+functions-common:is_ubuntu:469 '[' deb = deb ']'
+lib/apache:install_apache_uwsgi:108 sudo a2enmod proxy
Module proxy already enabled
+lib/apache:install_apache_uwsgi:109 sudo a2enmod proxy_uwsgi
Considering dependency proxy for proxy_uwsgi:
Module proxy already enabled
Module proxy_uwsgi already enabled
+lib/apache:install_apache_uwsgi:115 restart_apache_server
+lib/apache:restart_apache_server:231 restart_service apache2
+functions-common:restart_service:2393 '[' -x /bin/systemctl ']'
+functions-common:restart_service:2394 sudo /bin/systemctl restart apache2
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
+functions-common:restart_service:1 exit_trap
+./stack.sh:exit_trap:521 local r=1
++./stack.sh:exit_trap:522 jobs -p
+./stack.sh:exit_trap:522 jobs=
+./stack.sh:exit_trap:525 [[ -n '' ]]
+./stack.sh:exit_trap:531 '[' -f '' ']'
+./stack.sh:exit_trap:536 kill_spinner
+./stack.sh:kill_spinner:417 '[' '!' -z '' ']'
+./stack.sh:exit_trap:538 [[ 1 -ne 0 ]]
+./stack.sh:exit_trap:539 echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:541 type -p generate-subunit
+./stack.sh:exit_trap:542 generate-subunit 1559639730 82 fail
+./stack.sh:exit_trap:544 [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:547 /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logs
World dumping... see /opt/stack/logs/worlddump-2019-06-04-091653.txt for details
+./stack.sh:exit_trap:556 exit 1
)
Upon running apache restart, its gives this.
stack#bozz-feedz:/etc/apache2$ sudo service apache2 restart
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for deta
So i tried to kill all pids then it's ok for once, after that it comes back up
stack#bozz-feedz:/etc/apache2$ systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since ti 2019-06-04 12:48:10 EEST; 3min 47s ago
Docs: man:systemd-sysv-generator(8)
Process: 2339 ExecStop=/etc/init.d/apache2 stop (code=exited, status=1/FAILURE)
Process: 2314 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
stack#bozz-feedz:/etc/apache2$ sudo service apache2 restart
stack#bozz-feedz:/etc/apache2$ sudo service apache2 restart
stack#bozz-feedz:/etc/apache2$ sudo service apache2 restart
stack#bozz-feedz:/etc/apache2$ sudo service apache2 restart
stack#bozz-feedz:/etc/apache2$ sudo service apache2 restart
stack#bozz-feedz:/etc/apache2$ systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: inactive (dead) since ti 2019-06-04 12:52:15 EEST; 1s ago
Docs: man:systemd-sysv-generator(8)
Process: 10597 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 10555 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
stack#bozz-feedz:/etc/apache2$ sudo service apache2 restart
Then after some seconds the error comes back. H
stack#bozz-feedz:/etc/apache2$ sudo service apache2 restart
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
stack#bozz-feedz:/etc/apache2$ systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since ti 2019-06-04 12:53:29 EEST; 10s ago
Docs: man:systemd-sysv-generator(8)
Process: 13707 ExecStop=/etc/init.d/apache2 stop (code=exited, status=1/FAILURE)
Process: 13680 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
stack#bozz-feedz:/etc/apache2$
$)
Except i kill the pids again. I don't understand why this is happening.
I expect the devstack to install completely. It's just tiring
Try to reinstall apache2.
It worked for me.
sudo apt-get reinstall apache2

cannot start galera cluster on centos 7

I am trying to install a new galera cluster on 3 nodes with centos 7.
When I try to start the cluster on the master node with gcomm:// nothing in starts successfully but I cannot start Mariadb on the other nodes.
systemctl status mariadb.service -l
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: activating (auto-restart) (Result: signal) since Wed 2019-03-06 13:50:12 EET; 720ms ago
Process: 20749 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 54893 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=killed, signal=ABRT)
Process: 54813 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 54811 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 54893 (code=killed, signal=ABRT)
CGroup: /system.slice/mariadb.service
├─54902 /bin/sh -ue /usr//bin/wsrep_sst_rsync --role joiner --address 10.1.0.172" --datadir /var/lib/mysql/ --parent 54893
├─54976 rsync --daemon --no-detach --port 4444 --config /var/lib/mysql//rsync_sst.conf
└─55027 sleep 0.5
Mar 06 13:50:12 tms-galeracl2 systemd[1]: mariadb.service: main process exited, code=killed, status=6/ABRT
Mar 06 13:50:12 tms-galeracl2 systemd[1]: Failed to start MariaDB database server.
Mar 06 13:50:12 tms-galeracl2 systemd[1]: Unit mariadb.service entered failed state.
Mar 06 13:50:12 tms-galeracl2 systemd[1]: mariadb.service failed.
and the servers.cnf config
# Mandatory settings
wsrep_on=ON
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://10.x.x.x,10.x.x.x,10.x.x.x"
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
#Cluster name
wsrep_cluster_name="galeracl"
#
# Allow server to accept connections on all interfaces.
#
bind-address=0.0.0.0
wsrep_node_address=”10.x.x.x"
wsrep_node_name=”galeracl2"
wsrep_sst_method=rsync
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0
You have the "wrong type" of quotes in your config -- in servers.cnf note the opening quote of the following lines:
wsrep_node_address=”10.x.x.x"
wsrep_node_name=”galeracl2"
Edit and replace with the same, plain quote that is used for closing (copy paste from your config above):
wsrep_node_address="10.x.x.x"
wsrep_node_name="galeracl2"
And you should be golden!

Start a service inside docker CentOS 7 container

I want to start the httpd service on a CentOS 7 container. But the systemctl command doesn't work in containers. In CentOS 6 I can start httpd by simply using the /etc/init.d/apachectl -d command. But in CentOS 7 I can't find any apachectl file in /*/systemd/.
So how can I start httpd service in CentOS 7 container?
The best way is to make your own centos7 image where you install httpd
FROM centos:7
RUN yum -y install httpd; yum clean all; systemctl enable httpd.service
EXPOSE 80
Build your image with docker build -t my-centos:7 .
Systemd cannot run without SYS_ADMIN. That's why I set the following vars.
$ docker run -it -p 80:80 -e "container=docker" --privileged=true -d --security-opt seccomp:unconfined --cap-add=SYS_ADMIN -v /sys/fs/cgroup:/sys/fs/cgroup:ro my-centos:7 bash -c "/usr/sbin/init"
Verify container is running:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
967581bdf31a my-centos:7 "bash -c /usr/sbin/in" 1 seconds ago Up 1 seconds 0.0.0.0:80->80/tcp gigantic_stallman
Verifiy httpd is started
$ docker exec -it gigantic_stallman /bin/bash -c "systemctl status httpd"
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2016-12-28 11:44:04 UTC; 2min 20s ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 61 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /docker/967581bdf31a3b741a5e857720e199614d816b05a2132271f3adf910f0ed3207/system.slice/httpd.service
├─61 /usr/sbin/httpd -DFOREGROUND
├─66 /usr/sbin/httpd -DFOREGROUND
├─67 /usr/sbin/httpd -DFOREGROUND
├─68 /usr/sbin/httpd -DFOREGROUND
├─69 /usr/sbin/httpd -DFOREGROUND
└─70 /usr/sbin/httpd -DFOREGROUND
Dec 28 11:44:04 967581bdf31a systemd[1]: Starting The Apache HTTP Server...
Dec 28 11:44:04 967581bdf31a httpd[61]: AH00558: httpd: Could not reliably d...e
Dec 28 11:44:04 967581bdf31a systemd[1]: Started The Apache HTTP Server.
TL;DR: For short answer please see the other author's Answer.
My question was wrong here because it doesn't align with the containerization philosophy IMO. As these kinds of questions would be asked by new user I am going to explain a few things that's indirectly related to this question.
What is a container?
From OCI's runtime Specification, approximately,
A container contains the unit of a deliverable software.
A container will encapsulate a software component and it's dependencies.
A container should be portable and platform agnostic.
And one of the major component to achieve containerization is container runtime or in general linux container. Container runtime is a piece of software that is responsible for running containers.
Examples of a few container runtimes are, containerd, docker-engine, crio, mcr etc.
Why the question is wrong?
In general and by design, a linux container is an isolated process (these days virtual machines are also considered as containers). So in an ideal situation we should create a container just with one process which is our deliverable software.
In the question, I was thinking of using systemd to manage the process inside the container because I was neither aware about difference between a virtual machine and a container nor the principles of OCI's specification.
Also, systemd or systemV is system management daemon that is required to manage systems with hundreds or thousands of process. As the desired number of process in a container is only one so we do not need a process management daemon or any other unnecessary tools like ssh, htop, net-tools, firewalld etc.
How do we run the deliverable software?
The ideal way to run an application inside the container is to use it as the container's Entrypoint or CMD. That means, when we run the container, it will try to initiate the Entrypoint and it will start it with default command defined in the CMD. Either way, the first process (PID 1) should be our desired application/software.
So when we build the container image, we should define the entrypoint of that container. For example, I have an httpd and a redis container.
╰──➤ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
23789e2d0416 redis "docker-entrypoint.s…" 36 seconds ago Up 35 seconds 6379/tcp elegant_ganguly
9be725968ff3 httpd "httpd-foreground" 14 minutes ago Up 14 minutes 80/tcp app1
So let's check the first process of the both containers (cat /proc/1/cmdline),
╰──➤ for i in $(docker ps -q); do docker inspect $i --format 'ImageName: {{.Config.Image}}'; printf "First PID: "; docker exec -i $i sh -c "cat /proc/1/cmdline";echo; done
ImageName: redis
First PID: redis-server *:6379
ImageName: httpd
First PID: httpd-DFOREGROUND
Let's try to see the same thing with ps
╰──➤ for i in $(docker ps -q); do docker inspect $i --format 'ImageName: {{.Config.Image}}'; docker run -i --rm --pid container:$i ubuntu sh -c "ps aux | head -n2"; done
ImageName: redis
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
999 1 0.4 0.0 56024 7760 ? Ssl 14:58 0:08 redis-server *:6379
ImageName: httpd
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 7300 4380 ? Ss 14:44 0:00 httpd -DFOREGROUND
So if we are using these images; majority of the time we do not need to start it separately because it's probably already invoked by the entrypoint.
But if we want to create our own container image for our own software we can do that just by mentioning the entrypoint like the both of the httpd and redis image did here and here. You can also use CMD and Entrypoint from the command line when you run the container with the help of --entrypoint or provide the command after container name like the following (here I am using while true; do date; sleep 1; done as the default CMD),
╰──➤ docker run -d --rm ubuntu sh -c "while true; do date; sleep 1; done"
35c6352a55f25335e1bd0874493f2a31155ef752d008eb6718923d1f04ab2c14
Now let's check the first PID,
╰──➤ docker run -i --rm --pid container:35c6352a55f25 ubuntu sh -c "ps aux | head -n2"
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 2308 832 ? Ss 15:42 0:00 sh -c while true; do date; sleep 1; done
Run the docker pull command to download the Docker image, including Apache named httpd.
#docker pull httpd
Check the docker images using
#docker images
Now run the docker command to invoke the image you downloaded.
#docker run -d --name docker-apache -p 80:80 -d httpd
Mapping the local computer's port 80 to the container's port 80 (-p 80:80).
Try to verify whether the apache web server is working by accessing the server IP or hostname in the browser.


Apache not load php7 after pthreads install

I'm having issues trying to install php7 + pthreads + apache2 on ubuntu server 16.04. I have success on debian 8, but using php 5.6.24
Below the script that I used to install on ubuntu (same as to debian, but modified to php7)
apt-get update
apt-get install -y apache2 mysql-server
apt-get install -y build-essential apache2-mpm-prefork apache2-prefork-dev libcurl4-openssl-dev libsqlite3-dev sqlite3 mysql-server libmysqlclient-dev libreadline-dev libzip-dev libxslt1-dev libicu-dev libmcrypt-dev libmhash-dev libpcre3-dev libjpeg-dev libpng12-dev libfreetype6-dev libbz2-dev libxpm-dev
apt-get -y build-dep php7.0
wget http://cl1.php.net/get/php-7.0.9.tar.gz/from/this/mirror -O php-7.0.9.tar.gz
tar zxvf php-7.0.9.tar.gz
rm -rf ext/pthreads/
wget http://pecl.php.net/get/pthreads-3.1.6.tgz -O pthreads-3.1.6.tgz
tar zxvf pthreads-3.1.6.tgz
cp -a pthreads-3.1.6/. php-7.0.9/ext/pthreads/
cd php-7.0.9
rm -rf aclocal.m4
rm -rf autom4te.cache/
./buildconf --force
make distclean
#--enable-debug
./configure --disable-fileinfo --enable-maintainer-zts --enable-pthreads --prefix=/usr --with-config-file-path=/etc --with-curl --enable-cli --with-apxs2=/usr/bin/apxs2 \
--enable-mbstring \
--enable-mbregex \
--enable-phar \
--enable-posix \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-zip \
--enable-inline-optimization \
--enable-intl \
--with-icu-dir=/usr \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=shared,/usr \
--with-xpm-dir=/usr \
--with-freetype-dir=/usr \
--with-bz2=/usr \
--with-gettext \
--with-iconv-dir=/usr \
--with-mcrypt=/usr \
--with-mhash \
--with-zlib-dir=/usr \
--with-regex=php \
--with-pcre-regex \
--with-openssl \
--with-openssl-dir=/usr/bin \
--with-mysql-sock=/var/run/mysqld/mysqld.sock \
--with-mysqli=mysqlnd \
--with-sqlite3=/usr \
--with-pdo-mysql=mysqlnd \
--with-pdo-sqlite=/usr \
--enable-fpm \
--with-fpm-user=www-data \
--with-fpm-group=www-data \
--config-cache \
--localstatedir=/var \
--with-layout=GNU \
--disable-rpath
make clear
make
make install
cp php.ini-development /etc/php.ini
cp /etc/apache2/mods-available/php7.load /etc/apache2/mods-enabled/php7.load
echo "<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
" > /etc/apache2/mods-enabled/php7.conf
/etc/init.d/apache2 restart
cd ..
rm php-7.0.9.tar.gz
rm -rf php-7.0.9
rm -rf pthreads-3.1.6
rm pthreads-3.1.6.tgz
sed -i "s/^;date.timezone =$/date.timezone = \"America\/Sao_Paulo\"/" /etc/php.ini |grep "^timezone" /etc/php.ini
# change local-infile=1 on [mysql] and [mysqld]
# change document root on nano /etc/apache2/sites-enabled/000-default and restart apache
apt-get install -y ntp ntpdate
# nano /etc/ntp.conf and add server ntp.shoa.cl iburst
/etc/init.d/ntp stop
ntpdate ntp.shoa.cl
/etc/init.d/ntp start
date
#disable browse on apache nano nano /etc/apache2/sites-enabled/000-default remove INDEX
#disable banner
pthreads and php working fine on cli, but apache doesn't load anything and when I try to restart apache 2 service I see the message:
"Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details."
Finally, when I execute service apache2 status I see this:
service apache2 status
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Sun 2016-08-21 15:37:27 UTC; 1min 55s ago
Docs: man:systemd-sysv-generator(8)
Process: 3772 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)
Aug 21 15:37:07 ubuntu-512mb-nyc3-01 systemd[1]: Starting LSB: Apache2 web server...
Aug 21 15:37:07 ubuntu-512mb-nyc3-01 apache2[3772]: * Starting Apache httpd web server apache2
Aug 21 15:37:07 ubuntu-512mb-nyc3-01 apache2[3772]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to s
Aug 21 15:37:27 ubuntu-512mb-nyc3-01 apache2[3772]: *
Aug 21 15:37:27 ubuntu-512mb-nyc3-01 apache2[3772]: * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
Aug 21 15:37:27 ubuntu-512mb-nyc3-01 systemd[1]: apache2.service: Control process exited, code=exited status=1
Aug 21 15:37:27 ubuntu-512mb-nyc3-01 systemd[1]: Failed to start LSB: Apache2 web server.
Aug 21 15:37:27 ubuntu-512mb-nyc3-01 systemd[1]: apache2.service: Unit entered failed state.
Aug 21 15:37:27 ubuntu-512mb-nyc3-01 systemd[1]: apache2.service: Failed with result 'exit-code'.
I will really appreciate any help with this.
Here is how I made it, maybe can help someone. I created a script to make a fresh install of php7 with apache on ubuntu: https://github.com/ibrunotome/Install-php7-with-pthreads-on-ubuntu
When possible, I'll update the repo with the newest php version.

Redis - Monit does not start properly

Monit can not start redis-server properly.
Running Redis through init.d works correctly:
$ sudo su
$ /etc/init.d/redis_6379 start
$ #=> Starting Redis server...
$ ps aux | grep redis
$ #=> root 8980 0.0 0.0 42128 1964 ? Ssl 04:56 0:00 /etc/redis/src/redis-server *:6379
$ /etc/init.d/redis_6379 stop
$ #=> Stopping ...
$ #=> Redis stopped
$ #=> (ps aux| grep redis) There's no redis process.
Running Redis through Monit does not work correctly:
(I killed the Redis process and rm /var/run/redis_6379.pid)
$ sudo su
$ monit start redis
$ ps aux | grep redis
$ #=> root 9082 0.0 0.0 35076 1972 ? Ssl 05:08 0:00 /etc/redis/src/redis-server *:6379
monit.log:
[MSK Jan 6 05:08:14] info : 'redis' start on user request
[MSK Jan 6 05:08:14] info : monit daemon at 3947 awakened
[MSK Jan 6 05:08:14] info : Awakened by User defined signal 1
[MSK Jan 6 05:08:14] info : 'redis' start: /etc/init.d/redis_6379
[MSK Jan 6 05:08:44] error : 'redis' failed to start
[MSK Jan 6 05:08:44] info : 'redis' start action done
Stopping Redis through Monit does not works correclty also:
$ ps aux | grep redis
$ #=> root 9018 0.0 0.0 35076 1968 ? Ssl 05:02 0:00 /etc/redis/src/redis-server *:6379
$ monit stop redis
$ ps aux | grep redis
$ #=> root 9082 0.0 0.0 35076 1972 ? Ssl 05:08 0:00 /etc/redis/src/redis-server *:6379
monit.log
[MSK Jan 6 05:10:02] info : 'redis' stop on user request
[MSK Jan 6 05:10:02] info : monit daemon at 3947 awakened
[MSK Jan 6 05:10:02] info : Awakened by User defined signal 1
[MSK Jan 6 05:10:02] info : 'redis' stop action done
I have:
Ubuntu 12.04.3 LTS
redis-2.8.2
monit-5.3.2
redis instalation path /etc/redis
monit instalation path /etc/monit (installed from apt-get repo)
And following config files:
https://gist.github.com/itsNikolay/665112df34d2eae09330
I had the same problem, and there is no mutch talk about this situation around. I fixed it with another solution, it may concern someone else so I post it here.
in monit configuration file I had
start program = "/etc/init.d/redis start"
stop program = "/etc/init.d/redis stop"
Replacing by the following fixed the problem (with Ubuntu)
start program = "/usr/sbin/service redis start"
stop program = "/usr/sbin/service redis stop"
Just changes owner of /etc/redis dir
$ chown -R root /etc/redis
and restart monit
$ monit restart
The problem is gone. Strange. I wish it helps.