Hello Louis,
I have restored /var/lib/mysql folder and executive command,errors show as below:
[root@localhost conf]# systemctl status packetfence-mariadb
● packetfence-mariadb.service - PacketFence MariaDB instance
Loaded: loaded (/usr/lib/systemd/system/packetfence-mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2017-07-27 10:23:13 CST; 22h ago
Process: 1145 ExecStartPre=/usr/local/pf/bin/pfcmd generatemariadbconfig (code=exited, status=0/SUCCESS)
Main PID: 2352 (pf-mariadb)
CGroup: /packetfence.slice/packetfence-base.slice/packetfence-mariadb.service
├─2352 pf-mariadb
├─2384 /bin/sh /usr/bin/mysqld_safe --defaults-file=/usr/local/pf/var/conf/mariadb.conf
└─2534 /usr/sbin/mysqld --defaults-file=/usr/local/pf/var/conf/mariadb.conf --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/lib/...
Jul 27 10:23:09 localhost.localdomain pfcmd[1145]: [1501122189.56294] Failed to connect to config service for namespace config::Pf, retrying
Jul 27 10:23:09 localhost.localdomain pfcmd[1145]: [1501122189.6636] Failed to connect to config service for namespace config::Pf, retrying
Jul 27 10:23:09 localhost.localdomain packetfence[1145]: ERROR pfcmd.pl(1145): [1501122189.6636] Failed to connect to config service for namespace config::Pf, retrying (pfcon...rom_socket)
Jul 27 10:23:09 localhost.localdomain packetfence[1145]: ERROR pfcmd.pl(1145): [1501122189.7642] Failed to connect to config service for namespace config::Pf, retrying (pfcon...rom_socket)
Jul 27 10:23:09 localhost.localdomain pfcmd[1145]: [1501122189.7642] Failed to connect to config service for namespace config::Pf, retrying
Jul 27 10:23:13 localhost.localdomain pfcmd[1145]: Connected to config service successfully for namespace config::Pf
Jul 27 10:23:13 localhost.localdomain systemd[1]: Started PacketFence MariaDB instance.
Jul 27 10:23:13 localhost.localdomain pf-mariadb[2352]: Starting MySQL with command: mysqld_safe --defaults-file=/usr/local/pf/var/conf/mariadb.conf
Jul 27 10:23:14 localhost.localdomain pf-mariadb[2352]: 170727 10:23:14 mysqld_safe Logging to '/var/lib/mysql/localhost.localdomain.err'.
Jul 27 10:23:14 localhost.localdomain pf-mariadb[2352]: 170727 10:23:14 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost conf]# journalctl -xe
Jul 28 08:58:17 localhost.localdomain packetfence[656]: FATAL -e(656): unable to connect to database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "C
(pf::db::db_connect)
Jul 28 08:58:18 localhost.localdomain packetfence[656]: FATAL -e(656): unable to connect to database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "C
(pf::db::db_connect)
Jul 28 08:58:19 localhost.localdomain packetfence[656]: FATAL -e(656): unable to connect to database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "C
(pf::db::db_connect)
------------------ 原始邮件 ------------------
发件人: "packetfence-users";<packe...@li...>;
发送时间: 2017年7月27日(星期四) 晚上9:10
收件人: "packetfence-users"<packe...@li...>;
抄送: "Louis Munro"<lm...@in...>;
主题: Re: [PacketFence-users] How to config database address
On Jul 26, 2017, at 20:51, 沧海云帆 <ln...@qq...> wrote:
Hello Louis,
I have change /var/lib/mysql to /var/lib/mysql-bak,when I run systemctl status mariadb and journalctl -xe, it show as below:
[root@localhost pf]# systemctl start mariadb
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
[root@localhost pf]# systemctl status mariadb
● 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: failed (Result: exit-code) since Thu 2017-07-27 08:52:58 CST; 3s ago
Process: 20457 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Process: 20445 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: 20443 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 20457 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
That's because the actual service is "packetfence-mariadb".
Try
#systemctl status packetfence-mariadb
and then perhaps
# systemctl start packetfence-mariadb
--
Louis Munro
lm...@in... :: www.inverse.ca
+1.514.447.4918 x125 :: +1 (866) 353-6153 x125
Inverse inc. :: Leaders behind SOGo (www.sogo.nu) and PacketFence (www.packetfence.org)