web-dev-qa-db-ja.com

mysql 5.6は、redhat 6.4サーバーの起動時に自動的に起動しませんが、「servicemysqlstart」を手動で実行すると起動します。

Mysqlを自動的に開始するように設定しようとしています(RHEL6.4のmysql 5.6)サーバー(redhat)の再起動後に「service--status-all」を実行すると、常に「MySQLは実行されていませんが、ファイルをロックします/var/lock/subsys/mysqld[FAILED]

手動で実行する場合はservice mysql restart\start動作します。

次のようにmysqlをchkconfigに追加しました:chkconfig --add mysql chkconfig mysql on

[root@istahuins09 ~]# chkconfig mysql --list
mysql           0:off   1:off   2:on    3:on    4:on    5:on    6:off

また、-del chkconfig --delmysqlを使用してchkconfigを削除して再度追加しようとしました

service mysql status

表示:MySQLは実行されていませんが、ファイルをロックしています(/ var/lock/subsys/mysql [FAILED]

ゼロから(redhatとmysql)、クリーンインストール後に再インストールしようとしました:

  1. サービスmysqlは(手動および自動で)機能しませんでした。
  2. /etc/init.d/mysqlをmysql.serverへのリンクとして再作成すると、サービスが手動で開始される可能性があります。
  3. サーバーの起動後もサービスの開始を拒否します。

my.cnf:#パフォーマンス構成[クライアント]
default-character-set = utf8 socket = /fs0/mysql/instance/1/run/mysql.sock

[mysql]                                  
default-character-set                   = utf8 
socket                                  = /fs0/mysql/instance/1/run/mysql.sock

[mysqld]                                 
user                                    = mysql

port                                    = 3306
default_storage_engine                  = InnoDB


# FILE LOCATION #                        
#basedir                                 = /usr
datadir                                 = /fs0/mysql/instance/1/data
tmpdir                                  = /fs0/mysql/instance/1/tmp
socket                                  = /fs0/mysql/instance/1/run/mysql.sock
pid-file                                = /fs0/mysql/instance/1/run/mysql.pid

log-error                               = /fs0/mysql/instance/1/log/mysql.log

slow_query_log_file                     = /fs0/mysql/instance/1/log/slow_queries.log

log_bin                                 = /fs0/mysql/instance/1/binlog/binlog
log_bin_index                           = /fs0/mysql/instance/1/binlog/binlog.index
relay-log                               = /fs0/mysql/instance/1/relay/relay.log
relay-log-index                         = /fs0/mysql/instance/1/relay/relay.index
relay-log-info-file                     = /fs0/mysql/instance/1/relay/relay.info
master-info-file                        = /fs0/mysql/instance/1/relay/master.info

innodb_data_home_dir                    = /fs0/mysql/instance/1/data
innodb_log_group_home_dir               = /fs0/mysql/instance/1/binlog

# MyISAM #                               
key_buffer_size                         = 32M
myisam_recover                          = FORCE,BACKUP


# SAFETY #                               
max_allowed_packet                      = 16M
max_connect_errors                      = 1000000
sysdate_is_now                          = 1
innodb                                  = FORCE
innodb_strict_mode                      = 1

# TUNING #                               
tmp_table_size                          = 128M
max_heap_table_size                     = 128M
query_cache_type                        = 1
query_cache_size                        = 64M
query_cache_limit                       = 4M
max_connections                         = 5000
thread_cache_size                       = 128
open-files-limit                        = 25000
table_definition_cache                  = 2048
table_open_cache                        = 5000
wait_timeout                            = 330
back_log                                = 50
binlog_cache_size                       = 1M
max_binlog_size                         = 50M

sort_buffer_size                        = 4M
join_buffer_size                        = 4M
read_buffer_size                        = 2M
read_rnd_buffer_size                    = 1M


thread_stack                            = 256K




# INNODB #                               
innodb_flush_method                     = O_DIRECT
innodb_buffer_pool_size                 = 3G
innodb_buffer_pool_instances        = 10
innodb_file_per_table                   = 1
innodb_flush_log_at_trx_commit          = 2
innodb_log_file_size                    = 128M
innodb_log_files_in_group               = 2
innodb_status_file                      = 1
innodb_thread_concurrency               = 10
innodb_lock_wait_timeout                = 90
innodb_log_buffer_size                  = 32M
innodb_max_dirty_pages_pct              = 75
innodb_additional_mem_pool_size         = 512M
innodb_autoextend_increment             = 32
innodb_purge_threads            = 1
innodb_open_files           = 5000


# LOGGING #                              
log-queries-not-using-indexes           = 1
slow-query-log                          = 1
long_query_time                         = 3
log-warnings                            = 2



log-slave-updates                        

# GENERAL #                              

lower_case_table_names                  = 1
skip_external_locking                   = 1
character-set-server                    = utf8
collation-server                        = utf8_unicode_ci
log_bin_trust_function_creators     = TRUE

# PERFROMANCE SCHEMA                     
performance_schema                      = ON

mysql.log:

140507 10:49:11 mysqld_safe Starting mysqld daemon with databases from /fs0/mysql/instance/1/data
2014-05-07 10:49:15 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-05-07 10:49:16 11401 [Note] Plugin 'FEDERATED' is disabled.
2014-05-07 10:49:16 7f669f48a720 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2014-05-07 10:49:16 11401 [Note] InnoDB: The InnoDB memory heap is disabled
2014-05-07 10:49:16 11401 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-05-07 10:49:16 11401 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-05-07 10:49:16 11401 [Note] InnoDB: Using Linux native AIO
2014-05-07 10:49:16 11401 [Note] InnoDB: Using CPU crc32 instructions
2014-05-07 10:49:16 11401 [Note] InnoDB: Initializing buffer pool, size = 3.0G
2014-05-07 10:49:17 11401 [Note] InnoDB: Completed initialization of buffer pool
2014-05-07 10:49:17 11401 [Note] InnoDB: Highest supported file format is Barracuda.
2014-05-07 10:49:17 11401 [Note] InnoDB: 128 rollback segment(s) are active.
2014-05-07 10:49:17 11401 [Note] InnoDB: Waiting for purge to start
2014-05-07 10:49:17 11401 [Note] InnoDB: 5.6.12 started; log sequence number 1626143
2014-05-07 10:49:17 11401 [Note] Server hostname (bind-address): '*'; port: 3306
2014-05-07 10:49:17 11401 [Note] IPv6 is available.
2014-05-07 10:49:17 11401 [Note]   - '::' resolves to '::';
2014-05-07 10:49:17 11401 [Note] Server socket created on IP: '::'.
2014-05-07 10:49:18 11401 [Note] Event Scheduler: Loaded 0 events
2014-05-07 10:49:18 11401 [Note] /usr/sbin/mysqld: ready for connections.

バージョン: '5.6.12-log'ソケット: '/ fs0/mysql/instance/1/run/mysql.sock'ポート:3306 MySQL Community Server(GPL)2014-05-07 10:49:48 11401 [注]/usr/sbin/mysqld:通常のシャットダウン

2014-05-07 10:49:48 11401 [Note] Giving 0 client threads a chance to die gracefully
2014-05-07 10:49:48 11401 [Note] Event Scheduler: Purging the queue. 0 events
2014-05-07 10:49:48 11401 [Note] Shutting down slave threads
2014-05-07 10:49:48 11401 [Note] Forcefully disconnecting 0 remaining clients
2014-05-07 10:49:48 11401 [Note] Binlog end
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'partition'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'ARCHIVE'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'BLACKHOLE'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_METRICS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_CMPMEM'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_CMP'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_LOCKS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_TRX'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'InnoDB'
2014-05-07 10:49:48 11401 [Note] InnoDB: FTS optimize thread exiting.
2014-05-07 10:49:48 11401 [Note] InnoDB: Starting shutdown...
2014-05-07 10:49:49 11401 [Note] InnoDB: Shutdown completed; log sequence number 1626153
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'MRG_MYISAM'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'CSV'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'MEMORY'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'MyISAM'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'sha256_password'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'mysql_old_password'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'mysql_native_password'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'binlog'
2014-05-07 10:49:49 11401 [Note] /usr/sbin/mysqld: Shutdown complete
1
Gidi Kern

Mysqldと呼ばれるデーモンを構成する必要があります。起動時にデーモンとして実行するようにクライアントを構成しようとしています。

chkconfig mysqld on

service mysqld start

1
Trinue