API GW MYSQL DB issues: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
search cancel

API GW MYSQL DB issues: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

book

Article ID: 273987

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

We are using gateway 10.1.00 running on linux appliances, we are unable to reach the gateway, db logs says mysql can't start.

[root@server1 ~]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@server1 ~]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

There are enough disk space:

[ssgadmin@####### ~]$ df -h
Filesystem                 Size  Used Avail Use% Mounted on
devtmpfs                    16G     0   16G   0% /dev
tmpfs                       16G     0   16G   0% /dev/shm
tmpfs                       16G  9.1M   16G   1% /run
tmpfs                       16G     0   16G   0% /sys/fs/####
/dev/mapper/vg00-lv_root    15G  3.1G   11G  23% /
/dev/sda1                  976M   76M  850M   9% /boot
/dev/mapper/vg00-lv_var    2.9G   94M  2.7G   4% /var
/dev/mapper/vg00-lv_home   5.8G  1.2G  4.4G  22% /home
/dev/mapper/vg00-lv_log    2.0G   44M  1.8G   3% /var/log
/dev/mapper/vg00-lv_db     100G   90G  5.8G  94% /var/lib/mysql
/dev/mapper/vg00-lv_opt    7.8G  1.8G  5.7G  24% /opt
/dev/mapper/vg00-lv_tmp    7.8G   19M  7.4G   1% /tmp
/dev/mapper/vg00-lv_audit  2.0G   37M  1.8G   2% /var/log/audit
tmpfs                      3.2G     0  3.2G   0% /run/user/1006
tmpfs                      3.2G     0  3.2G   0% /run/user/1001
tmpfs                      3.2G     0  3.2G   0% /run/user/1005
tmpfs                      3.2G     0  3.2G   0% /run/user/1008


Environment

Gateway 10.x, 11.x

Cause

User removed the ssg replication bin_log files to make disk space before the incident.  But the bin_log index file still point to the log files that have been removed and mysql quit when try to start and could not find the sync log files. 

Resolution

1. Remove all the log file names in the bin_log index file
2. Restart the MySQL service

The database could be out of sync if there were any changes or deployments when the other database was down. In that case, replication may need to be reestablished.

Reinitialization of replication can be done by using this KB:

https://knowledge.broadcom.com/external/article?articleNumber=44402