質問編集履歴
3
解決方法を移動
    
        title	
    CHANGED
    
    | 
            File without changes
         | 
    
        body	
    CHANGED
    
    | @@ -94,32 +94,4 @@ | |
| 94 94 | 
             
            200310 13:27:25 [Note] /usr/sbin/mysqld: Shutdown complete
         | 
| 95 95 |  | 
| 96 96 | 
             
            200310 13:27:25 mysqld_safe mysqld from pid file /var/lib/mysql/ip-XXX-XXX-XXX-XXX.pid ended
         | 
| 97 | 
            -
            ```
         | 
| 98 | 
            -
             | 
| 99 | 
            -
            ### 3/11解決
         | 
| 100 | 
            -
             | 
| 101 | 
            -
            /etc/monit.d/mysql.conf
         | 
| 102 | 
            -
            1行目のpidファイル設定を変更し、テストしたところ正常動作しました。
         | 
| 103 | 
            -
             | 
| 104 | 
            -
            ```CentOS6
         | 
| 105 | 
            -
            check process mysql with pidfile "/var/lib/mysql/ip-XXX-XXX-XXX-XXX.pid"
         | 
| 106 | 
            -
            start = "/etc/init.d/mysql start"
         | 
| 107 | 
            -
            stop = "/etc/init.d/mysql stop"
         | 
| 108 | 
            -
            if failed unixsocket /var/lib/mysql/mysql.sock with timeout 20 seconds then restart
         | 
| 109 | 
            -
            if 5 restarts within 5 cycles then timeout
         | 
| 110 | 
            -
            group mysql
         | 
| 111 | 
            -
            ```
         | 
| 112 | 
            -
             | 
| 113 | 
            -
            [monit(log)]
         | 
| 114 | 
            -
            ```
         | 
| 115 | 
            -
            [UTC Mar 11 03:46:25] info     : 'ip-XXX-XXX-XXX-XXX' monitor on user request
         | 
| 116 | 
            -
            [UTC Mar 11 03:46:25] info     : 'mysql' monitor on user request
         | 
| 117 | 
            -
            [UTC Mar 11 03:46:25] info     : Monit daemon with PID 3500 awakened
         | 
| 118 | 
            -
            [UTC Mar 11 03:46:25] info     : Awakened by User defined signal 1
         | 
| 119 | 
            -
            [UTC Mar 11 03:46:25] info     : 'mysql' monitor action done
         | 
| 120 | 
            -
            [UTC Mar 11 03:46:25] info     : 'ip-XXX-XXX-XXX-XXX' monitor action done
         | 
| 121 | 
            -
            [UTC Mar 11 03:46:25] error    : 'mysql' process is not running
         | 
| 122 | 
            -
            [UTC Mar 11 03:46:25] info     : 'mysql' trying to restart
         | 
| 123 | 
            -
            [UTC Mar 11 03:46:25] info     : 'mysql' start: '/etc/init.d/mysql start'
         | 
| 124 | 
            -
            [UTC Mar 11 03:47:31] info     : 'mysql' process is running with pid 3783
         | 
| 125 97 | 
             
            ```
         | 
2
結果追記
    
        title	
    CHANGED
    
    | 
            File without changes
         | 
    
        body	
    CHANGED
    
    | @@ -94,4 +94,32 @@ | |
| 94 94 | 
             
            200310 13:27:25 [Note] /usr/sbin/mysqld: Shutdown complete
         | 
| 95 95 |  | 
| 96 96 | 
             
            200310 13:27:25 mysqld_safe mysqld from pid file /var/lib/mysql/ip-XXX-XXX-XXX-XXX.pid ended
         | 
| 97 | 
            +
            ```
         | 
| 98 | 
            +
             | 
| 99 | 
            +
            ### 3/11解決
         | 
| 100 | 
            +
             | 
| 101 | 
            +
            /etc/monit.d/mysql.conf
         | 
| 102 | 
            +
            1行目のpidファイル設定を変更し、テストしたところ正常動作しました。
         | 
| 103 | 
            +
             | 
| 104 | 
            +
            ```CentOS6
         | 
| 105 | 
            +
            check process mysql with pidfile "/var/lib/mysql/ip-XXX-XXX-XXX-XXX.pid"
         | 
| 106 | 
            +
            start = "/etc/init.d/mysql start"
         | 
| 107 | 
            +
            stop = "/etc/init.d/mysql stop"
         | 
| 108 | 
            +
            if failed unixsocket /var/lib/mysql/mysql.sock with timeout 20 seconds then restart
         | 
| 109 | 
            +
            if 5 restarts within 5 cycles then timeout
         | 
| 110 | 
            +
            group mysql
         | 
| 111 | 
            +
            ```
         | 
| 112 | 
            +
             | 
| 113 | 
            +
            [monit(log)]
         | 
| 114 | 
            +
            ```
         | 
| 115 | 
            +
            [UTC Mar 11 03:46:25] info     : 'ip-XXX-XXX-XXX-XXX' monitor on user request
         | 
| 116 | 
            +
            [UTC Mar 11 03:46:25] info     : 'mysql' monitor on user request
         | 
| 117 | 
            +
            [UTC Mar 11 03:46:25] info     : Monit daemon with PID 3500 awakened
         | 
| 118 | 
            +
            [UTC Mar 11 03:46:25] info     : Awakened by User defined signal 1
         | 
| 119 | 
            +
            [UTC Mar 11 03:46:25] info     : 'mysql' monitor action done
         | 
| 120 | 
            +
            [UTC Mar 11 03:46:25] info     : 'ip-XXX-XXX-XXX-XXX' monitor action done
         | 
| 121 | 
            +
            [UTC Mar 11 03:46:25] error    : 'mysql' process is not running
         | 
| 122 | 
            +
            [UTC Mar 11 03:46:25] info     : 'mysql' trying to restart
         | 
| 123 | 
            +
            [UTC Mar 11 03:46:25] info     : 'mysql' start: '/etc/init.d/mysql start'
         | 
| 124 | 
            +
            [UTC Mar 11 03:47:31] info     : 'mysql' process is running with pid 3783
         | 
| 97 125 | 
             
            ```
         | 
1
mysqlエラーログを追加
    
        title	
    CHANGED
    
    | 
            File without changes
         | 
    
        body	
    CHANGED
    
    | @@ -15,6 +15,7 @@ | |
| 15 15 | 
             
            異なるのではないかと思い、ご存じの方がいらっしゃいましたら
         | 
| 16 16 | 
             
            よろしくお願いいたします。
         | 
| 17 17 |  | 
| 18 | 
            +
            [monit(log)]
         | 
| 18 19 | 
             
            ```
         | 
| 19 20 | 
             
            [UTC Mar 10 01:37:14] info     : Starting Monit 5.25.1 daemon with http interface at [localhost]:2812
         | 
| 20 21 | 
             
            [UTC Mar 10 01:37:14] info     : 'ip-XXX-XXX-XXX-XXX' Monit 5.25.1 started
         | 
| @@ -58,4 +59,39 @@ | |
| 58 59 |  | 
| 59 60 | 
             
            Zendframework version 1.12.3
         | 
| 60 61 | 
             
            PHP Version 5.4.11
         | 
| 61 | 
            -
            CentOS release 6.4 (Final)
         | 
| 62 | 
            +
            CentOS release 6.4 (Final)
         | 
| 63 | 
            +
             | 
| 64 | 
            +
            ### 3/11追記
         | 
| 65 | 
            +
             | 
| 66 | 
            +
            /var/run/mysql/mysql.pidは無かったためファイルだけ作成しました。
         | 
| 67 | 
            +
            [mysql.log]に表示されるように「/var/lib/mysql/ip-XXX-XXX-XXX-XXX.pid」に変更すべきでしょうか。
         | 
| 68 | 
            +
            ```CentOS6
         | 
| 69 | 
            +
            #touch mysql.pid
         | 
| 70 | 
            +
            ```
         | 
| 71 | 
            +
             | 
| 72 | 
            +
            [mysql.log]
         | 
| 73 | 
            +
            ```
         | 
| 74 | 
            +
            Version: '10.0.1-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
         | 
| 75 | 
            +
            200310 06:19:27 mysqld_safe A mysqld process already exists
         | 
| 76 | 
            +
            200310 06:20:56 mysqld_safe A mysqld process already exists
         | 
| 77 | 
            +
            200310 13:27:24 mysqld_safe Number of processes running now: 0
         | 
| 78 | 
            +
            200310 13:27:24 mysqld_safe mysqld restarted
         | 
| 79 | 
            +
            200310 13:27:25 InnoDB: The InnoDB memory heap is disabled
         | 
| 80 | 
            +
            200310 13:27:25 InnoDB: Mutexes and rw_locks use GCC atomic builtins
         | 
| 81 | 
            +
            200310 13:27:25 InnoDB: Compressed tables use zlib 1.2.3
         | 
| 82 | 
            +
            200310 13:27:25 InnoDB: Using Linux native AIO
         | 
| 83 | 
            +
            200310 13:27:25 InnoDB: CPU does not support crc32 instructions
         | 
| 84 | 
            +
            200310 13:27:25 InnoDB: Initializing buffer pool, size = 768.0M
         | 
| 85 | 
            +
            InnoDB: mmap(815923200 bytes) failed; errno 12
         | 
| 86 | 
            +
            200310 13:27:25 InnoDB: Completed initialization of buffer pool
         | 
| 87 | 
            +
            200310 13:27:25 InnoDB: Fatal error: cannot allocate memory for the buffer pool
         | 
| 88 | 
            +
            200310 13:27:25 [ERROR] Plugin 'InnoDB' init function returned error.
         | 
| 89 | 
            +
            200310 13:27:25 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
         | 
| 90 | 
            +
            200310 13:27:25 [Note] Plugin 'FEEDBACK' is disabled.
         | 
| 91 | 
            +
            200310 13:27:25 [ERROR] Unknown/unsupported storage engine: InnoDB
         | 
| 92 | 
            +
            200310 13:27:25 [ERROR] Aborting
         | 
| 93 | 
            +
             | 
| 94 | 
            +
            200310 13:27:25 [Note] /usr/sbin/mysqld: Shutdown complete
         | 
| 95 | 
            +
             | 
| 96 | 
            +
            200310 13:27:25 mysqld_safe mysqld from pid file /var/lib/mysql/ip-XXX-XXX-XXX-XXX.pid ended
         | 
| 97 | 
            +
            ```
         | 
