GluterFS not start mysql

Discussion in 'Installation/Configuration' started by andrercmeira, Aug 12, 2011.

  1. andrercmeira

    andrercmeira New Member

    Hi,

    I follow tuturial for install replicante server, step-by-step, master server is ok, all service is start, but in the slave server no start mysql.

    it only result on syslog

    Code:
    Aug 12 08:02:30 johan mysqld_safe: Starting mysqld daemon with databases from /var/lib/mysql
    Aug 12 08:02:30 johan mysqld: 110812  8:02:30 [Note] Plugin 'FEDERATED' is disabled.
    Aug 12 08:02:30 johan mysqld: 110812  8:02:30 [Note] Plugin 'InnoDB' is disabled.
    Aug 12 08:02:30 johan mysqld: /usr/sbin/mysqld: Incorrect file format 'plugin'
    Aug 12 08:02:30 johan mysqld: 110812  8:02:30 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    Aug 12 08:02:30 johan mysqld: 110812  8:02:30 [ERROR] Can't start server : Bind on unix socket: Permission denied
    Aug 12 08:02:30 johan mysqld: 110812  8:02:30 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
    Aug 12 08:02:30 johan mysqld: 110812  8:02:30 [ERROR] Aborting
    Aug 12 08:02:30 johan mysqld: 
    Aug 12 08:02:30 johan mysqld: 110812  8:02:30 [Note] /usr/sbin/mysqld: Shutdown complete
    Aug 12 08:02:30 johan mysqld: 
    Aug 12 08:02:30 johan mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended
    Aug 12 08:02:44 johan /etc/init.d/mysql[23534]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
    Aug 12 08:02:44 johan /etc/init.d/mysql[23534]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
    Aug 12 08:02:44 johan /etc/init.d/mysql[23534]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
    Aug 12 08:02:44 johan /etc/init.d/mysql[23534]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
    
    obs: in two server I running mysql 5.1.49 on debian 6.0.2.1.a
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post the output of:

    ls -la /var/lib/mysql

    from the slave server.
     
  3. andrercmeira

    andrercmeira New Member

    in the slave

    Code:
    drwxr-xr-x  7 ntp   ntp       4096 Ago 12 08:02 .
    drwxr-xr-x 43 root  root      4096 Ago 11 23:59 ..
    drwx------  2 mysql mysql     4096 Ago  9 15:32 cadmizaz_web
    drwx------  2 mysql mysql     4096 Ago 10 10:19 dbispconfig
    -rw-r--r--  1 root  root         0 Ago  6 12:07 debian-5.1.flag
    drwx------  2 mysql mysql     4096 Ago 10 14:54 gerencia_izaz
    -rw-rw----  1 mysql mysql 10485760 Ago 12 00:00 ibdata1
    -rw-rw----  1 mysql mysql  5242880 Ago 12 00:00 ib_logfile0
    -rw-rw----  1 mysql mysql  5242880 Ago  6 12:07 ib_logfile1
    drwx------  2 mysql root      4096 Ago  6 12:08 mysql
    -rw-------  1 root  root         6 Ago  6 12:08 mysql_upgrade_info
    
    in the master

    Code:
    drwxr-xr-x  6 ntp   ntp       4096 Ago 12 08:02 .
    drwxr-xr-x 52 root  root      4096 Ago 12 00:00 ..
    drwx------  2 mysql mysql     4096 Ago  9 15:32 cadmizaz_web
    drwx------  2 mysql mysql     4096 Ago 10 10:19 dbispconfig
    -rw-r--r--  1 root  root         0 Ago  6 12:07 debian-5.1.flag
    drwx------  2 mysql mysql     4096 Ago 10 14:54 gerencia_izaz
    -rw-rw----  1 mysql mysql 10485760 Ago 12 00:00 ibdata1
    -rw-rw----  1 mysql mysql  5242880 Ago 12 00:00 ib_logfile0
    -rw-rw----  1 mysql mysql  5242880 Ago  6 12:07 ib_logfile1
    drwx------  2 mysql root      4096 Ago  6 12:08 mysql
    -rw-------  1 root  root         6 Ago  6 12:08 mysql_upgrade_info
    
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Is it possible to start mysql on the slave when you stop mysql on the master?
     
  5. andrercmeira

    andrercmeira New Member

    yes, in the master

    Code:
    root@anna:/var/lib# /etc/init.d/mysql status
    /usr/bin/mysqladmin  Ver 8.42 Distrib 5.1.49, for debian-linux-gnu on i486
    Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL license
    
    Server version          5.1.49-3
    Protocol version        10
    Connection              Localhost via UNIX socket
    UNIX socket             /var/run/mysqld/mysqld.sock
    Uptime:                 7 hours 16 min 53 sec
    
    Threads: 2  Questions: 14345  Slow queries: 0  Opens: 1001  Flush tables: 1  Open tables: 64  Queries per second avg: 0.547.
    
    after restart:

    Code:
    root@anna:/var/lib# /etc/init.d/mysql stop
    Stopping MySQL database server: mysqld.
    root@anna:/var/lib# /etc/init.d/mysql start
    Starting MySQL database server: mysqld.
    Checking for corrupt, not cleanly closed and upgrade needing tables..
    
    Code:
    root@anna:/var/lib# /etc/init.d/mysql status
    /usr/bin/mysqladmin  Ver 8.42 Distrib 5.1.49, for debian-linux-gnu on i486
    Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL license
    
    Server version          5.1.49-3
    Protocol version        10
    Connection              Localhost via UNIX socket
    UNIX socket             /var/run/mysqld/mysqld.sock
    Uptime:                 1 min 9 sec
    
    Threads: 1  Questions: 512  Slow queries: 0  Opens: 958  Flush tables: 1  Open tables: 64  Queries per second avg: 7.420.
    
     
  6. andrercmeira

    andrercmeira New Member

    I see a little differ in passwd file...

    in master is one number for mysql user, in slave is other

    in the master:
    Code:
    root:x:0:0:root:/root:/bin/bash
    daemon:x:1:1:daemon:/usr/sbin:/bin/sh
    bin:x:2:2:bin:/bin:/bin/sh
    sys:x:3:3:sys:/dev:/bin/sh
    sync:x:4:65534:sync:/bin:/bin/sync
    games:x:5:60:games:/usr/games:/bin/sh
    man:x:6:12:man:/var/cache/man:/bin/sh
    lp:x:7:7:lp:/var/spool/lpd:/bin/sh
    mail:x:8:8:mail:/var/mail:/bin/sh
    news:x:9:9:news:/var/spool/news:/bin/sh
    uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
    proxy:x:13:13:proxy:/bin:/bin/sh
    www-data:x:33:33:www-data:/var/www:/bin/sh
    backup:x:34:34:backup:/var/backups:/bin/sh
    list:x:38:38:Mailing List Manager:/var/list:/bin/sh
    irc:x:39:39:ircd:/var/run/ircd:/bin/sh
    gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
    nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
    libuuid:x:100:101::/var/lib/libuuid:/bin/sh
    Debian-exim:x:101:103::/var/spool/exim4:/bin/false
    statd:x:102:65534::/var/lib/nfs:/bin/false
    sshd:x:103:65534::/var/run/sshd:/usr/sbin/nologin
    izaz:x:1000:1000:izaz,,,:/home/izaz:/bin/bash
    ntp:x:104:106::/home/ntp:/bin/false
    postfix:x:105:108::/var/spool/postfix:/bin/false
    mysql:x:106:110:MySQL Server,,,:/var/lib/mysql:/bin/false
    clamav:x:107:111::/var/lib/clamav:/bin/false
    amavis:x:108:112:AMaViS system user,,,:/var/lib/amavis:/bin/sh
    messagebus:x:109:113::/var/run/dbus:/bin/false
    bind:x:110:114::/var/cache/bind:/bin/false
    vmail:x:5000:5000::/var/vmail:/bin/sh
    getmail:x:5001:5001::/etc/getmail:/bin/sh
    ispapps:x:5002:5003::/var/www/apps:/bin/sh
    ispconfig:x:5003:5004::/usr/local/ispconfig:/bin/sh
    web1:x:5004:5005::/var/www/clients/client1/web1/./home/web1:/bin/false
    admizaz_izaz:x:5004:5005::/var/www/clients/client1/web1/./home/admizaz_izaz:/usr/sbin/jk_chrootsh
    web2:x:5005:5006::/var/www/clients/client2/web2/./home/web2:/bin/false
    gerenciaizaz:x:5004:5005::/var/www/clients/client1/web1/./home/gerenciaizaz:/usr/sbin/jk_chrootsh
    web3:x:5006:5006::/var/www/clients/client2/web3:/bin/false
    
    in the slave

    Code:
    root:x:0:0:root:/root:/bin/bash
    daemon:x:1:1:daemon:/usr/sbin:/bin/sh
    bin:x:2:2:bin:/bin:/bin/sh
    sys:x:3:3:sys:/dev:/bin/sh
    sync:x:4:65534:sync:/bin:/bin/sync
    games:x:5:60:games:/usr/games:/bin/sh
    man:x:6:12:man:/var/cache/man:/bin/sh
    lp:x:7:7:lp:/var/spool/lpd:/bin/sh
    mail:x:8:8:mail:/var/mail:/bin/sh
    news:x:9:9:news:/var/spool/news:/bin/sh
    uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
    proxy:x:13:13:proxy:/bin:/bin/sh
    www-data:x:33:33:www-data:/var/www:/bin/sh
    backup:x:34:34:backup:/var/backups:/bin/sh
    list:x:38:38:Mailing List Manager:/var/list:/bin/sh
    irc:x:39:39:ircd:/var/run/ircd:/bin/sh
    gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
    nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
    libuuid:x:100:101::/var/lib/libuuid:/bin/sh
    Debian-exim:x:101:103::/var/spool/exim4:/bin/false
    sshd:x:103:65534::/var/run/sshd:/usr/sbin/nologin
    izaz:x:1000:1000:izaz,,,:/home/izaz:/bin/bash
    ntp:x:104:105::/home/ntp:/bin/false
    mysql:x:106:106:MySQL Server,,,:/var/lib/mysql:/bin/false
    postfix:x:105:108::/var/spool/postfix:/bin/false
    clamav:x:107:110::/var/lib/clamav:/bin/false
    amavis:x:108:111:AMaViS system user,,,:/var/lib/amavis:/bin/sh
    messagebus:x:109:112::/var/run/dbus:/bin/false
    bind:x:110:113::/var/cache/bind:/bin/false
    vmail:x:5000:5000::/var/vmail:/bin/sh
    getmail:x:5001:5001::/etc/getmail:/bin/sh
    ispapps:x:5002:5003::/var/www/apps:/bin/sh
    ispconfig:x:5003:5004::/usr/local/ispconfig:/bin/sh
    
    but if edit this file rest of system not is functional, if i restart machine user id change for original
     
    Last edited: Aug 12, 2011
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    This is most likely the reason for the problem. What is the ID of the mysql group on master and slave.
     
  8. andrercmeira

    andrercmeira New Member

    in master original id is 106 in slave original id is 104
     
  9. AlexGer83

    AlexGer83 New Member

    MySQL Server won't start (Multiserver-Setup -> Slave Server))

    Hi and thank's for this howto: Installing A Web, Email And MySQL Database Cluster (Mirror) On Debian 5.0 With ISPConfig 3.

    I have a Problem where i have to start the Slave-server's MySQL Server!

    I've modified the /etc/mysql/debian.cnf file on the Slave-Server
    -> replaced the original Content with the Master-Server's content


    Code:
    Now start the services again:
    /etc/init.d/mysql start
    ...
    Code:
    root@L-SRV-2:/tmp# /etc/init.d/mysql start
    Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
    nano /var/log/syslog says:
    Code:
    Sep 15 23:03:40 L-SRV-2 mysqld_safe: Starting mysqld daemon with databases from /var/lib/mysql
    Sep 15 23:03:40 L-SRV-2 mysqld: 110915 23:03:40 [Note] Plugin 'FEDERATED' is disabled.
    Sep 15 23:03:40 L-SRV-2 mysqld: 110915 23:03:40 [Note] Plugin 'InnoDB' is disabled.
    Sep 15 23:03:40 L-SRV-2 mysqld: /usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
    Sep 15 23:03:40 L-SRV-2 mysqld: 110915 23:03:40 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    Sep 15 23:03:40 L-SRV-2 mysqld: 110915 23:03:40 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
    Sep 15 23:03:40 L-SRV-2 mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended
    Sep 15 23:03:54 L-SRV-2 /etc/init.d/mysql[27916]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
    Sep 15 23:03:54 L-SRV-2 /etc/init.d/mysql[27916]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
    Sep 15 23:03:54 L-SRV-2 /etc/init.d/mysql[27916]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
    Sep 15 23:03:54 L-SRV-2 /etc/init.d/mysql[27916]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

    Where is the Problem?
    I googled around and couldn't find any helping posts.

    Thank's for help Y'all.
    AlexGer83
     
    Last edited: Sep 16, 2011
  10. falko

    falko Super Moderator Howtoforge Staff

    Can you set a new password in debian.cnf and then try this post?
    http://www.howtoforge.com/reset-forgotten-mysql-root-password

    But in the update statement please use debian-sys-maint instead of root:

    Code:
    update user set Password=PASSWORD('new-password') where user='[COLOR="Red"]debian-sys-maint[/COLOR]';
    flush privileges;
    exit;
     
  11. AlexGer83

    AlexGer83 New Member

    Hey Falko,
    thanks for your reply but:


    Code:
    root@L-SRV-2:~# mysqld_safe --skip-grant-tables
    110916 07:50:54 mysqld_safe Logging to syslog.
    110916 07:50:54 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    can't enter anything

    Thanks
    Alex

    EDIT:
    I started the sqlserver on the slave:
    Code:
    /usr/bin/mysqld_safe --skip-grant-tables &
    [1] 4611
    ...
    Code:
    root@L-SRV-2:~# mysql --user=root mysql
    ERROR 1049 (42000): Unknown database 'mysql'
     
    Last edited: Sep 16, 2011
  12. Mark_NL

    Mark_NL Member

    Code:
    Sep 15 23:03:40 L-SRV-2 mysqld: 110915 23:03:40 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    ?
     
  13. AlexGer83

    AlexGer83 New Member

    Hey Mark_NL,
    tried that already:

    Code:
    root@L-SRV-2:~# mysql_upgrade --force
    Looking for 'mysql' as: mysql
    Looking for 'mysqlcheck' as: mysqlcheck
    Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run                                                                                                                                                             /mysqld/mysqld.sock'
    Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run                                                                                                                                                             /mysqld/mysqld.sock'
    mysql.columns_priv                                 OK
    mysql.db                                           OK
    mysql.event                                        OK
    mysql.func                                         OK
    mysql.general_log
    Error    : File './mysql/general_log.CSM' not found (Errcode: 13)
    Error    : You can't use locks with log tables.
    status   : OK
    mysql.help_category                                OK
    mysql.help_keyword                                 OK
    mysql.help_relation                                OK
    mysql.help_topic                                   OK
    mysql.host                                         OK
    mysql.ndb_binlog_index                             OK
    mysql.plugin                                       OK
    mysql.proc                                         OK
    mysql.procs_priv                                   OK
    mysql.servers                                      OK
    mysql.slow_log
    Error    : File './mysql/slow_log.CSM' not found (Errcode: 13)
    Error    : You can't use locks with log tables.
    status   : OK
    mysql.tables_priv                                  OK
    mysql.time_zone                                    OK
    mysql.time_zone_leap_second                        OK
    mysql.time_zone_name                               OK
    mysql.time_zone_transition                         OK
    mysql.time_zone_transition_type                    OK
    mysql.user                                         OK
    Running 'mysql_fix_privilege_tables'...
    ERROR 1036 (HY000) at line 102: Table 'user' is read only
    ERROR 1036 (HY000) at line 108: Table 'user' is read only
    ERROR 1036 (HY000) at line 109: Table 'host' is read only
    ERROR 1036 (HY000) at line 110: Table 'db' is read only
    ERROR 1036 (HY000) at line 113: Table 'user' is read only
    ERROR 1036 (HY000) at line 114: Table 'db' is read only
    ERROR 1036 (HY000) at line 115: Table 'host' is read only
    ERROR 1036 (HY000) at line 121: Table 'user' is read only
    ERROR 1036 (HY000) at line 126: Table 'user' is read only
    ...
    Alex
     
  14. AlexGer83

    AlexGer83 New Member

    OK I coppied the Databases from mysql_bak to mysql
    changed the debian.cnf to an other password (test123)
    changed also in the mysql to test123

    finaly i can start the mysql with:
    /etc/init.d/mysql start

    what is the next step?
    Shall i continue with the tutorial?
    or should i change the passwort again to the original i have setup on the master?

    Thanks so far!
    Alex
     
  15. falko

    falko Super Moderator Howtoforge Staff

    I think you can now continue with the tutorial.
     
  16. AlexGer83

    AlexGer83 New Member

    Solved

    Hello again :)

    Everything is working now!
    Thank's for all helping answers!

    I've got still one question...
    How are the files being synchronised?
    Is the sync from server1 to server2 secure?
    If not, how can i make it secure?

    Thank's
    Alex
     
  17. falko

    falko Super Moderator Howtoforge Staff

    AFAIK this is all handled by GlusterFS.
     

Share This Page