mysql 配置my.cnf文件加入 innodb 配置参数就无法重启

骷髅 发布于 2013/07/24 17:09
阅读 4K+
收藏 0

mysql 配置文件:

[mysqld]
character-set-server=utf8
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
basedir = /var/lib/mysql/
tmpdir = /var/lib/mysql/
port=3306
user=mysql
back_log = 500
key_buffer_size = 32M
innodb_use_sys_malloc =0
innodb_buffer_pool_size = 3G
innodb_additional_pool_size = 20M
innodb_log_file_size = 512M
innodb_log_buffer_size =16M
innodb_flush_logs_at_trx_commit = 2
max_allowed_packet = 4M
thread_stack = 256K
table_cache = 128K
sort_buffer_size = 6M
read_buffer_size = 4M
join_buffer_size = 8M
myisam_sort_buffer_size = 64M
table_cache = 512
thread_cache_size = 64
query_cache_size = 64M
tmp_table_size = 256M
max_connections = 1000
max_connect_errors = 100
wait_timeout = 10
thread_concurrency = 8


# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


mysql log :

  

130724 17:34:17 [Note] /usr/libexec/mysqld: Normal shutdown

130724 17:34:17 [Note] Event Scheduler: Purging the queue. 0 events
130724 17:34:17  InnoDB: Starting shutdown...
130724 17:34:18  InnoDB: Shutdown completed; log sequence number 1595675
130724 17:34:18 [Note] /usr/libexec/mysqld: Shutdown complete

130724 17:34:18 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130724 17:34:19 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130724 17:34:19 [Note] Plugin 'FEDERATED' is disabled.
130724 17:34:19 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130724 17:34:19 InnoDB: Compressed tables use zlib 1.2.3
130724 17:34:19 InnoDB: Using Linux native AIO
130724 17:34:19  InnoDB: Warning: io_setup() failed with EAGAIN. Will make 5 attempts before giving up.
InnoDB: Warning: io_setup() attempt 1 failed.
InnoDB: Warning: io_setup() attempt 2 failed.
InnoDB: Warning: io_setup() attempt 3 failed.
InnoDB: Warning: io_setup() attempt 4 failed.
InnoDB: Warning: io_setup() attempt 5 failed.
130724 17:34:21  InnoDB: Error: io_setup() failed with EAGAIN after 5 attempts.
InnoDB: You can disable Linux Native AIO by setting innodb_use_native_aio = 0 in my.cnf
130724 17:34:21 InnoDB: Warning: Linux Native AIO disabled.
130724 17:34:21 InnoDB: Initializing buffer pool, size = 3.0G
130724 17:34:21 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 536870912 bytes!
130724 17:34:21 [ERROR] Plugin 'InnoDB' init function returned error.
130724 17:34:21 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130724 17:34:21 [ERROR] /usr/libexec/mysqld: unknown variable 'innodb_additional_pool_size=20M'
130724 17:34:21 [ERROR] Aborting

130724 17:34:21 [Note] /usr/libexec/mysqld: Shutdown complete


加载中
0
LianyouCQ
LianyouCQ

这种最好附上你的操作系统的内存等大小。

# Set buffer pool size to 50-80% of your computer's memory,
# but make sure on Linux x86 total memory usage is < 2GB
而且日志也说了 

innodb_additional_pool_size
是没有的,倒是有一个
innodb_additional_mem_pool_size

官网上如此说:
Warning

On 32-bit GNU/Linux x86, be careful not to set memory usage too high. glibc may permit the process heap to grow over thread stacks, which crashes your server. It is a risk if the value of the following expression is close to or exceeds 2GB:

innodb_buffer_pool_size
+ key_buffer_size
+ max_connections*(sort_buffer_size+read_buffer_size+binlog_cache_size)
+ max_connections*2MB

Each thread uses a stack (often 2MB, but only 256KB in MySQL binaries provided by Oracle Corporation.) and in the worst case also uses sort_buffer_size + read_buffer_size additional memory.

http://dev.mysql.com/doc/refman/5.5/en/innodb-configuration.html


LianyouCQ
LianyouCQ
回复 @骷髅 : 问题还没解决? 同时innodb_use_sys_malloc参数也是容易出错的地方
骷髅
骷髅
内存大小为 16GB
0
骷髅
骷髅
内存大小为 16GB 
返回顶部
顶部