我的网站是在一个VPS与1 GN和一些原因,它有时会自动崩溃。我可以error.log,但不能理解错误意味着什么,以及什么可能是真正的原因。下面是mysql服务器上次崩溃时生成的日志。
[Warning] Changed limits: max_open_files: 1024 (requested 5000)
[Warning] Changed limits: table_open_cache: 431 (requested 2000)
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
[Note] /usr/sbin/mysqld (mysqld 5.7.18-0ubuntu0.16.04.1) starting as process 27819 ...
[Note] InnoDB: PUNCH HOLE support available
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
[Note] InnoDB: Uses event mutexes
[Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
[Note] InnoDB: Compressed tables use zlib 1.2.8
[Note] InnoDB: Using Linux native AIO
[Note] InnoDB: Number of pools: 1
[Note] InnoDB: Using CPU crc32 instructions
[Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
[Note] InnoDB: Completed initialization of buffer pool
[Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
[Note] InnoDB: Highest supported file format is Barracuda.
[Note] InnoDB: Log scan progressed past the checkpoint lsn 599964175
[Note] InnoDB: Doing recovery: scanned up to log sequence number 599964380
[Note] InnoDB: Doing recovery: scanned up to log sequence number 599964380
[Note] InnoDB: Database was not shutdown normally!
[Note] InnoDB: Starting crash recovery.
[Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
[Note] InnoDB: Apply batch completed
[Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
[Note] InnoDB: Creating shared tablespace for temporary tables
[Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
[Note] InnoDB: File './ibtmp1' size is now 12 MB.
[Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
[Note] InnoDB: 32 non-redo rollback segment(s) are active.
[Note] InnoDB: Waiting for purge to start
[Note] InnoDB: 5.7.18 started; log sequence number 599964380
[Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
[Note] Plugin 'FEDERATED' is disabled.
[Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
[Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
[Note] - '127.0.0.1' resolves to '127.0.0.1';
[Note] Server socket created on IP: '127.0.0.1'.
[Note] InnoDB: Buffer pool(s) load completed at 170609 9:13:52
[Note] Event Scheduler: Loaded 0 events
[Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.18-0ubuntu0.16.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)
[Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check
[Note] Beginning of list of non-natively partitioned tables
[Note] End of list of non-natively partitioned tables
[Note] Access denied for user 'root'@'localhost' (using password: NO)
[ERROR] /usr/sbin/mysqld: Table './table_name/wp_posts' is marked as crashed and should be repaired
[Warning] Checking table: './table_name/wp_posts'
[ERROR] /usr/sbin/mysqld: Table './table_name/wp_postmeta' is marked as crashed and should be repaired
[Warning] Checking table: './table_name/wp_postmeta'
[ERROR] /usr/sbin/mysqld: Table './table_name/wp_comments' is marked as crashed and should be repaired
[Warning] Checking table: './table_name/wp_comments'
[ERROR] /usr/sbin/mysqld: Table './table_name/wp_commentmeta' is marked as crashed and should be repaired
[Warning] Checking table: './table_name/wp_commentmeta'
[ERROR] /usr/sbin/mysqld: Table './table_name/wp_options' is marked as crashed and should be repaired
[Warning] Checking table: './table_name/wp_options'
[ERROR] /usr/sbin/mysqld: Table './table_name/wp_term_taxonomy' is marked as crashed and should be repaired
[Warning] Checking table: './table_name/wp_term_taxonomy'
[ERROR] /usr/sbin/mysqld: Table './table_name/wp_term_relationships' is marked as crashed and should be repaired
[Warning] Checking table: './table_name/wp_term_relationships'
[ERROR] /usr/sbin/mysqld: Table './table_name/wp_termmeta' is marked as crashed and should be repaired
[Warning] Checking table: './table_name/wp_termmeta'
[ERROR] /usr/sbin/mysqld: Table './table_name/wp_users' is marked as crashed and should be repaired
[Warning] Checking table: './table_name/wp_users'
[ERROR] /usr/sbin/mysqld: Table './table_name/wp_usermeta' is marked as crashed and should be repaired
[Warning] Checking table: './table_name/wp_usermeta'
[ERROR] /usr/sbin/mysqld: Table './table_name/wp_woocommerce_order_items' is marked as crashed and should be repaired
[Warning] Checking table: './table_name/wp_woocommerce_order_items'
[ERROR] /usr/sbin/mysqld: Table './table_name/wp_woocommerce_order_itemmeta' is marked as crashed and should be repaired
[Warning] Checking table: './table_name/wp_woocommerce_order_itemmeta'
[ERROR] /usr/sbin/mysqld: Table './table_name/wp_woocommerce_sessions' is marked as crashed and should be repaired
[Warning] Checking table: './table_name/wp_woocommerce_sessions'你能帮我破译这些日志并指导我找到解决方案吗?谢谢!!
发布于 2017-06-10 11:43:29
也许MySQL服务器是被OOM杀手杀死的。看看dmesg | grep -i memory来检查OOM的干预情况。
发布于 2017-06-10 15:23:28
我同意肖丹舒克的观点。你的MySQL被OOM杀手杀了。如果您没有在VPS上启用交换和使用Apache,它可能占用所有内存并调用OOM杀手,有时它会杀死MySQL。要检查它,可以运行cat /var/log/syslog | grep kill
发布于 2017-06-10 15:45:03
请检查MySQL中最大的数据库。您可以在MySQL数据目录中使用du命令。并尝试从生产服务器禁用数据库。很可能是造成这种情况的最大数据库之一。每当有人试图使用特定DB时,都会造成这种情况。此外,您还可以跟踪DB中可能损坏或包含无效数据的任何特定表。
https://serverfault.com/questions/855016
复制相似问题