MariaDB installation problem 'mariadb.service: Failed with result 'timeout'.' - database

I'm trying to reinstall MariaDB and I can't figure why the installation fails. I had MySQL installed previously and wanted to get MariaDB for versioning problems so if you guys can help, thank you.
Here are some commands I did on my shell and the results.
Really sorry about my shell being in French, hope you guys can help me anyway.
Between, I have a Ubuntu 20.04tls OS.
> sudo apt autoremove --purge ~n^mysql-server
> sudo apt install mariadb-server
● mariadb.service - MariaDB 10.3.31 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: failed (Result: timeout) since Mon 2021-11-01 20:38:21 CET; 2min 1s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 979 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER > > $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 979 (code=exited, status=0/SUCCESS)
nov. 01 20:38:19 zemmouri-Inspiron-15-3567 mysqld[979]: 2021-11-01 20:38:19 0 [Note] Event Scheduler: Purging the queue. 0 events
nov. 01 20:38:19 zemmouri-Inspiron-15-3567 mysqld[979]: 2021-11-01 20:38:19 0 [Note] InnoDB: FTS optimize thread exiting.
nov. 01 20:38:19 zemmouri-Inspiron-15-3567 mysqld[979]: 2021-11-01 20:38:19 0 [Note] InnoDB: Starting shutdown...
nov. 01 20:38:19 zemmouri-Inspiron-15-3567 mysqld[979]: 2021-11-01 20:38:19 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buff>
nov. 01 20:38:19 zemmouri-Inspiron-15-3567 mysqld[979]: 2021-11-01 20:38:19 0 [Note] InnoDB: Buffer pool(s) dump completed at 211101 20:38:19
nov. 01 20:38:21 zemmouri-Inspiron-15-3567 mysqld[979]: 2021-11-01 20:38:21 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
nov. 01 20:38:21 zemmouri-Inspiron-15-3567 mysqld[979]: 2021-11-01 20:38:21 0 [Note] InnoDB: Shutdown completed; log sequence number 1625461;>
nov. 01 20:38:21 zemmouri-Inspiron-15-3567 mysqld[979]: 2021-11-01 20:38:21 0 [Note] /usr/sbin/mysqld: Shutdown complete
nov. 01 20:38:21 zemmouri-Inspiron-15-3567 systemd[1]: mariadb.service: Failed with result 'timeout'.
nov. 01 20:38:21 zemmouri-Inspiron-15-3567 systemd[1]: Failed to start MariaDB 10.3.31 database server.
And it fails on the installation menu:
on the installation menu waiting for like 2 or 3 minutes then it shows this:
Job for mariadb.service failed because a timeout was exceeded.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
Paramètre de mariadb-server (1:10.3.31-00ubuntu0.20.04.1)...
Traitement des actions différées (<< triggers >>) pour systemd (245.4-4ubuntu3.13)...
Traitement des actions différées (<< triggers >>) pour man-db (2.9.1-1)
Traitement des actions différées (<< triggers >>) pour libc-bin (2.31-0ubuntu9.2)...

After some reachers i had a problem with the Symlinks that has been created from mysql-server installation so:
I fixed the problem with running:
sudo systemctl disable mysql.service
Then:
sudo apt autoremove --purge mysql-server* mariadb-server*
and finnaly:
sudo apt update
and after that just run lamp installation with this command and worked perfectly:
sudo apt install apache2 php libapache2-mod-php mariadb-server php-mysql

Uninstall apparmor and, remove directory /etc/apparmor/ and /etc/apparmor.d/
Reboot
Install apparmor

Related

Error starting a tmuxinator session via systemd service on Ubuntu 18.04

I have a tmuxinator (note not tmux, tmuxinator) project running on Ubuntu 18.04 (running in headless/server mode). My tmuxinator project file is located in the default directory of /home/karsh/.tmuxinator/testProject.yml. When I am SSH'ed into the system and just run tmuxinator start testProject via the terminal, everything runs normally and a new Tmux session gets launched with my project configurations.
My goal is to run this command automatically when the computer boots up. My approach was to create a systemd service file located at /etc/systemd/system/testProject.service with the following settings:
[Unit]
Description=Test Project
[Service]
Type=forking
ExecStart=/usr/bin/tmuxinator start testProject
[Install]
WantedBy=multi-user.target
However, when I start this service via sudo systemctl start testProject.service, it crashes. Upon checking status using sudo systemctl status testProject.service, I get the following errors:
● testProject.service - Test Project
Loaded: loaded (/etc/systemd/system/testProject.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2022-04-08 06:08:43 CST; 8s ago
Process: 3298 ExecStart=/usr/bin/tmuxinator start testProject (code=exited, status=1/FAILURE)
Main PID: 32756 (code=exited, status=1/FAILURE)
4月 08 06:08:43 nvidia-desktop systemd[1]: Starting Test Project
4月 08 06:08:43 nvidia-desktop tmuxinator[3298]: Project testProject doesn't exist.
4月 08 06:08:43 nvidia-desktop systemd[1]: testProject.service: Control process exited, code=exited status=1
4月 08 06:08:43 nvidia-desktop systemd[1]: testProject.service: Failed with result 'exit-code'.
4月 08 06:08:43 nvidia-desktop systemd[1]: Failed to start Test Project.
It seems that when running via systemd, tmuxinator is not able to locate /home/karsh/.tmuxinator/testProject.yml file and says that the project does not exist.
How can I give systemd access to the /home/<user>/ directories, assuming that's the problem?

pgbouncer fails to start when configured to dockerized postgres

I am trying to configuer pgbouncer for the first time.
My postgres DB is running as a container (with port 5011)
My OS is debian 10.
I used apt-install to install pgbouncer:
sudo apt-get install pgbouncer
and then could see that pgbouncer status was OK:
# sudo systemctl status pgbouncer
● pgbouncer.service - LSB: start pgbouncer
Loaded: loaded (/etc/init.d/pgbouncer; generated)
Active: active (running) since Wed 2021-05-26 16:15:49 IDT; 11min ago
Docs: man:systemd-sysv-generator(8)
Tasks: 2 (limit: 4915)
Memory: 2.4M
CGroup: /system.slice/pgbouncer.service
└─4392 /usr/sbin/pgbouncer -d /etc/pgbouncer/pgbouncer.ini
my database name is mydb, postgres container is running on port 5011, so I configured /etc/pgbouncer/pgbouncer.ini like this:
[databases]
octopus-bouncer = host=10.1.1.1 port=5011 user=dbauser dbname=mydb
;; Configuration section
[pgbouncer]
auth_file = userlist.txt
; IP address or * which means all IPs
listen_addr = *
listen_port = 6432
; any, trust, plain, crypt, md5, cert, hba, pam
auth_type = md5
auth_file = /etc/pgbouncer/userlist.txt
; total number of clients that can connect
max_client_conn = 100
; default pool size. 20 is good number when transaction pooling
; is in use, in session pooling it needs to be the number of
; max clients you want to handle at any moment
default_pool_size = 20
I finally put my user to /etc/pgbouncer/userlist.txt:
"dbauser" "mypassword"
Then I restarted pgbouncer - but failed:
# sudo systemctl restart pgbouncer
Job for pgbouncer.service failed because the control process exited with error code.
See "systemctl status pgbouncer.service" and "journalctl -xe" for details.
status shows only this:
# sudo systemctl status pgbouncer
● pgbouncer.service - LSB: start pgbouncer
Loaded: loaded (/etc/init.d/pgbouncer; generated)
Active: failed (Result: exit-code) since Wed 2021-05-26 17:04:00 IDT; 2min 3s ago
Docs: man:systemd-sysv-generator(8)
Process: 28111 ExecStart=/etc/init.d/pgbouncer start (code=exited, status=1/FAILURE)
May 26 17:04:00 Octopus systemd[1]: Starting LSB: start pgbouncer...
May 26 17:04:00 Octopus pgbouncer[28111]: Starting PgBouncer: pgbouncer failed!
May 26 17:04:00 Octopus systemd[1]: pgbouncer.service: Control process exited, code=exited, status=1/FAILURE
May 26 17:04:00 Octopus systemd[1]: pgbouncer.service: Failed with result 'exit-code'.
May 26 17:04:00 Octopus systemd[1]: Failed to start LSB: start pgbouncer.
Am I missing something?
How can I debug the problem?
You can add KillSignal=SIGINT to service unit file:
cat /usr/lib/systemd/system/pgbouncer.service
[Unit]
Description=A lightweight connection pooler for PostgreSQL
Documentation=man:pgbouncer(1)
After=syslog.target network.target
[Service]
RemainAfterExit=yes
User=postgres
Group=postgres
# Path to the init file
Environment=BOUNCERCONF=/etc/pgbouncer/pgbouncer.ini
#Environment=SYSTEMD_LOG_LEVEL=debug
ExecStart=/usr/bin/pgbouncer -q ${BOUNCERCONF}
ExecReload=/usr/bin/pgbouncer -R -q ${BOUNCERCONF}
KillSignal=SIGINT
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
[Install]
WantedBy=multi-user.target
from pgbouncer man:
Signals
SIGHUP Reload config. Same as issuing the command RELOAD on the console.
SIGINT Safe shutdown. Same as issuing PAUSE and SHUTDOWN on the console.

Trying a quick cluster deployment with Docker:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I found that DolphinDB now supports a quick cluster deployment with docker containers and I followed the guide on github: https://github.com/dolphindb/Tutorials_CN/blob/master/docker_deployment.md to deploy a cluster with DolphinDB Docker package. But I encountered a problem. I looked at any other questions but can't find my own solution.
Here is the problem:
xllu#xllu-OptiPlex-7060:~/DolphinDB-Docker-Compose/Dockerbuild$ docker -v
Docker version 18.09.3, build 774a1f4
xllu#xllu-OptiPlex-7060:~/DolphinDB-Docker-Compose/Dockerbuild$ docker-compose --version
docker-compose version 1.24.0, build 0aa59064
xllu#xllu-OptiPlex-7060:~/DolphinDB-Docker-Compose/Dockerbuild$ docker build -t ddb:latest ./
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I tried restarting docker:
xllu#xllu-OptiPlex-7060:~/DolphinDB-Docker-Compose/Dockerbuild$ sudo service docker restart
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
Then I checked this :
xllu#xllu-OptiPlex-7060:~/DolphinDB-Docker-Compose/Dockerbuild$ systemctl status docker.service
● docker.service - LSB: Create lightweight, portable, self-sufficient containers.
Loaded: loaded (/etc/init.d/docker; generated)
Active: failed (Result: exit-code) since Fri 2019-05-31 15:16:01 CST; 16s ago
Docs: man:systemd-sysv-generator(8)
Process: 29234 ExecStart=/etc/init.d/docker start (code=exited, status=1/FAILURE)
Main PID: 2596 (code=exited, status=0/SUCCESS)
5月 31 15:16:01 xllu-OptiPlex-7060 systemd[1]: Starting LSB: Create lightweight, portable, self-sufficient containers....
5月 31 15:16:01 xllu-OptiPlex-7060 docker[29234]: * /usr/bin/dockerd not present or not executable
5月 31 15:16:01 xllu-OptiPlex-7060 systemd[1]: docker.service: Control process exited, code=exited status=1
5月 31 15:16:01 xllu-OptiPlex-7060 systemd[1]: docker.service: Failed with result 'exit-code'.
5月 31 15:16:01 xllu-OptiPlex-7060 systemd[1]: Failed to start LSB: Create lightweight, portable, self-sufficient containers..
Can you try removing /var/lib/docker with sudo rm -rf /var/lib/docker and try restarting the docker?
You will lose the images stored.

I can not start the mariadb.service as soon as I have installed

I have installed mariadb in my CentOS7, "systemctl start mariadb" command does not work. Console out is this --> "Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details."
[root#centos ~]# journalctl -xe
1월 21 00:31:34 centos systemd[1]: mariadb.service failed.
1월 21 00:31:34 centos polkitd[828]: Unregistered Authentication Agent for unix-process:3046:129841 (system bus name :1
1월 21 00:31:53 centos fprintd[3001]: No devices in use, exit
1월 21 00:32:07 centos polkitd[828]: Registered Authentication Agent for unix-process:3087:133140 (system bus name :1.1
1월 21 00:32:07 centos systemd[1]: Starting MariaDB 10.1.30 database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has begun starting up.
1월 21 00:32:07 centos mysqld[3110]: /usr/sbin/mysqld: error while loading shared libraries: libjemalloc.so.1: cannot o
1월 21 00:32:07 centos systemd[1]: mariadb.service: main process exited, code=exited, status=127/n/a
1월 21 00:32:07 centos systemd[1]: Failed to start MariaDB 10.1.30 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has failed.
--
-- The result is failed.
1월 21 00:32:07 centos systemd[1]: Unit mariadb.service entered failed state.
1월 21 00:32:07 centos systemd[1]: mariadb.service failed.
1월 21 00:32:07 centos polkitd[828]: Unregistered Authentication Agent for unix-process:3087:133140 (system bus name :1
lines 3201-3223/3223 (END)
I search long time to solve this problem, i can't find proper solution.
And /var/log/mariadb directory does not exist.
How can i fix this issue? please help me!
(Update)
[root#kyun2centos ~]# journalctl -xe|grep 'error'
1월 23 16:47:12 kyun2centos gnome-settings-[2077]: g_task_return_error: assertion 'error != NULL' failed
1월 23 20:30:53 kyun2centos mysqld[3754]: /usr/sbin/mysqld: error while loading shared libraries: libjemalloc.so.1: cannot open shared object file: No such file or directory
1월 23 20:33:11 kyun2centos mysqld[3841]: 2018-01-23 20:33:11 140616961231104 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
1월 23 20:33:32 kyun2centos mysqld[3964]: 2018-01-23 20:33:32 139707756554496 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
1월 23 20:42:37 kyun2centos mysqld[4274]: 2018-01-23 20:42:37 140639461787904 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
1월 23 20:43:12 kyun2centos mysqld[4365]: 2018-01-23 20:43:12 140563394230528 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
1월 23 20:48:04 kyun2centos mysqld[4553]: 2018-01-23 20:48:04 139807531911424 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
1월 23 20:50:04 kyun2centos mysqld[4654]: 2018-01-23 20:50:04 140253162838272 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
1월 23 20:57:30 kyun2centos mysqld[4901]: 2018-01-23 20:57:30 140003728230656 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
It indicate lack library.So run
yum install libaio
yum would help you install and configure it or you can access the website to download the latest rpm package and install it manually.
Solution by OP.
I solve this problem through follow series of commands:
yum -y remove mariadb-libs
yum -y remove mariadb mariadb-server
cd /var/lib/ && rm -rfv mysql
yum -y install mariadb mariadb-server

Installing Solr 5 on Debian 8

I followed the instructions on https://ctors.net/2015/07/14/solr5_java8_debian8.
As the root
First I installed Java 8:
mkdir -p /opt/java
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz"
tar xvf jdk-8u45-linux-x64.tar.gz -C /opt/java
update-alternatives --install /usr/bin/java java /opt/java/jdk1.8.0_45/bin/java 1
update-alternatives --set java /opt/java/jdk1.8.0_45/bin/java
Then I installed Solr:
wget http://apache.belnet.be/lucene/solr/5.2.1/solr-5.2.1.tgz
tar xvf solr-5.2.1.tgz
./solr-5.2.1/bin/install_solr_service.sh solr-5.2.1.tgz
But the installation ends up with the following error message:
solr.service - LSB: Controls Apache Solr as a Service
Loaded: loaded (/etc/init.d/solr)
Active: failed (Result: exit-code) since Wed 2015-11-18 02:29:36 TMT; 5s ago
Process: 1679 ExecStart=/etc/init.d/solr start (code=exited, status=1/FAILURE)
Nov 18 02:29:36 solrhost su[1681]: Successful su for solr by root
Nov 18 02:29:36 solrhost su[1681]: + ??? root:solr
Nov 18 02:29:36 solrhost su[1681]: pam_unix(su:session): session opened for user solr by (uid=0)
Nov 1`enter code here`8 02:29:36 solruser solr[1679]: This script requires extracting a WAR file with either the jar or unzip utility, please install these utilities or con...assistance.
Nov 18 02:29:36 solrhost su[1681]: pam_unix(su:session): session closed for user solr
Nov 18 02:29:36 solrhost systemd[1]: solr.service: control process exited, code=exited status=1
Nov 18 02:29:36 solrhost systemd[1]: Failed to start LSB: Controls Apache Solr as a Service.
Nov 18 02:29:36 solrhost systemd[1]: Unit solr.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
Service solr installed.
Does anyone have any idea what is going on?
solr needs unzip to work. Install unzip if it isn't available on the system.
apt-get install unzip
It should fix the problem.
I got my colleague to have a look at the issue. He found two causes of error:
1) Insufficient memory (my box had 512 MB RAM memory). Additional memory resolved the issue.
2) Wrong jdk package, that is, wrong architecture choice. For different JDK packages look here: http://www.oracle.com/technetwork/java/javase/downloads/java-se-6u24-download-338091.html.
Hope someday this will save someone else's time and nerves.
As for Debian and Solr developers, it would be great if you could come up with simple receipt about how to install Solr 5 under Debian 8. For example, https://www.digitalocean.com/community/tutorials/how-to-install-solr-5-2-1-on-ubuntu-14-04.

Resources