为了测试,我想创建自己的MySQL集群。我有2台机器,第一台包含管理节点,ndbd节点和SQL节点,第二台机器配置为ndbd节点。我安装了一个centos(最小版本)并尝试使用MySQL-Cluster-server-gpl-7.5.0-1.el7.x86_64.rpm安装集群。
安装完成后,我在第一台机器上启动了ndb_mgmd,ndbd,在第二台机器上启动了ndbd,最后我尝试启动没有启动的mysqld_safe。 我开始之前的群集配置如下:
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 @192.168.1.20 (mysql-5.7.10 ndb-7.5.0, Nodegroup: 0, *)
id=3 @192.168.1.10 (mysql-5.7.10 ndb-7.5.0, starting, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @192.168.1.10 (mysql-5.7.10 ndb-7.5.0)
[mysqld(API)] 1 node(s)
id=4 (not connected, accepting connect from 192.168.1.10)
我使用以下命令启动mysqld:
sudo mysqld_safe --user=mysql
我在localdomain.err中的输出结果如下:
160213 18:50:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2016-02-13T23:50:46.566878Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-02-13T23:50:46.568284Z 0 [Warning] Insecure configuration for --secure-file-priv: Location is accessible to all OS users. Consider choosing a different directory.
2016-02-13T23:50:46.568368Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.10-ndb-7.5.0-cluster-gpl) starting as process 4904 ...
2016-02-13T23:50:46.575076Z 0 [Note] InnoDB: PUNCH HOLE support available
2016-02-13T23:50:46.575151Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-02-13T23:50:46.575166Z 0 [Note] InnoDB: Uses event mutexes
2016-02-13T23:50:46.575204Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-02-13T23:50:46.575214Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-02-13T23:50:46.575268Z 0 [Note] InnoDB: Using Linux native AIO
2016-02-13T23:50:46.575823Z 0 [Note] InnoDB: Number of pools: 1
2016-02-13T23:50:46.576075Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2016-02-13T23:50:46.591704Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-02-13T23:50:46.608714Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-02-13T23:50:46.613116Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2016-02-13T23:50:46.626947Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-02-13T23:50:46.665494Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-02-13T23:50:46.665916Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2016-02-13T23:50:46.862972Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2016-02-13T23:50:46.864951Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2016-02-13T23:50:46.865008Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-02-13T23:50:46.866666Z 0 [Note] InnoDB: Waiting for purge to start
2016-02-13T23:50:46.917017Z 0 [Note] InnoDB: 5.7.10 started; log sequence number 1210166
2016-02-13T23:50:46.918446Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2016-02-13T23:50:46.918797Z 0 [Note] Plugin 'FEDERATED' is disabled.
2016-02-13T23:50:46.919099Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160213 18:50:46
2016-02-13T23:50:46.919181Z 0 [Note] InnoDB: not started
mysqld: Table 'mysql.plugin' doesn't exist
2016-02-13T23:50:46.919481Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2016-02-13T23:50:47.106436Z 0 [Note] NDB: NodeID is 4, management server '192.168.1.10:1186'
2016-02-13T23:50:47.506868Z 0 [Note] NDB[0]: NodeID: 4, all storage nodes connected
2016-02-13T23:50:47.506952Z 0 [Warning] NDB: server id set to zero - changes logged to bin log with server id zero will be logged with another server id by slave mysqlds
2016-02-13T23:50:47.507270Z 0 [Note] NDB Util: Starting...
2016-02-13T23:50:47.507482Z 0 [Note] NDB Util: Wait for server start completed
2016-02-13T23:50:47.507318Z 0 [Note] NDB Binlog: Starting...
2016-02-13T23:50:47.507746Z 1 [Note] NDB Binlog: Started
2016-02-13T23:50:47.507817Z 1 [Note] NDB Binlog: Setting up
2016-02-13T23:50:47.508038Z 1 [Note] NDB Binlog: Created schema Ndb object, reference: 0x80040004, name: 'Ndb Binlog schema change monitoring'
2016-02-13T23:50:47.508174Z 1 [Note] NDB Binlog: Created injector Ndb object, reference: 0x80050004, name: 'Ndb Binlog data change monitoring'
2016-02-13T23:50:47.508220Z 1 [Note] NDB Binlog: Setup completed
2016-02-13T23:50:47.508258Z 1 [Note] NDB Binlog: Wait for server start completed
2016-02-13T23:50:47.509155Z 0 [Note] NDB Index Stat: Starting...
2016-02-13T23:50:47.509364Z 0 [Note] NDB Index Stat: Wait for server start completed
2016-02-13T23:50:47.716426Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-02-13T23:50:47.716657Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2016-02-13T23:50:47.717071Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2016-02-13T23:50:47.717187Z 0 [Note] IPv6 is available.
2016-02-13T23:50:47.717219Z 0 [Note] - '::' resolves to '::';
2016-02-13T23:50:47.717251Z 0 [Note] Server socket created on IP: '::'.
2016-02-13T23:50:47.746455Z 0 [Warning] Failed to open optimizer cost constant tables
2016-02-13T23:50:47.747272Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2016-02-13T23:50:47.747532Z 0 [ERROR] Aborting
2016-02-13T23:50:47.747584Z 0 [Note] Binlog end
2016-02-13T23:50:47.747598Z 0 [Note] NDB Util: Stop
2016-02-13T23:50:47.747614Z 0 [Note] NDB Util: Wakeup
2016-02-13T23:50:48.507740Z 0 [Note] NDB Util: Stopped
2016-02-13T23:50:48.507872Z 0 [Note] NDB Util: Stop completed
2016-02-13T23:50:48.507926Z 0 [Note] NDB Binlog: Stop
2016-02-13T23:50:48.507968Z 0 [Note] NDB Binlog: Wakeup
2016-02-13T23:50:48.508366Z 1 [Note] NDB Binlog: Shutting down
2016-02-13T23:50:48.508631Z 1 [Note] NDB Binlog: Stopping...
2016-02-13T23:50:48.508778Z 0 [Note] NDB Binlog: Stopped
2016-02-13T23:50:48.508855Z 0 [Note] NDB Binlog: Stop completed
2016-02-13T23:50:48.509010Z 0 [Note] Shutting down plugin 'ngram'
2016-02-13T23:50:48.509038Z 0 [Note] Shutting down plugin 'partition'
2016-02-13T23:50:48.509050Z 0 [Note] Shutting down plugin 'ndb_transid_mysql_connection_map'
2016-02-13T23:50:48.509061Z 0 [Note] Shutting down plugin 'ndbinfo'
2016-02-13T23:50:48.510441Z 0 [Note] Shutting down plugin 'ndbcluster'
2016-02-13T23:50:48.510535Z 0 [Note] NDB Index Stat: Stop
2016-02-13T23:50:48.510552Z 0 [Note] NDB Index Stat: Wakeup
2016-02-13T23:50:49.509615Z 0 [Note] NDB Index Stat: Stopping...
2016-02-13T23:50:49.509693Z 0 [Note] NDB Index Stat: Stopped
2016-02-13T23:50:49.509839Z 0 [Note] NDB Index Stat: Stop completed
2016-02-13T23:50:49.509864Z 0 [Note] NDB Util: Stop
2016-02-13T23:50:49.509875Z 0 [Note] NDB Util: Wakeup
2016-02-13T23:50:49.509885Z 0 [Note] NDB Util: Stop completed
2016-02-13T23:50:50.056850Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2016-02-13T23:50:50.056929Z 0 [Note] Shutting down plugin 'ARCHIVE'
2016-02-13T23:50:50.056942Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-02-13T23:50:50.057142Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2016-02-13T23:50:50.057162Z 0 [Note] Shutting down plugin 'MyISAM'
2016-02-13T23:50:50.057208Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2016-02-13T23:50:50.057225Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-02-13T23:50:50.057235Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-02-13T23:50:50.057245Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-02-13T23:50:50.057253Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-02-13T23:50:50.057261Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-02-13T23:50:50.057269Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-02-13T23:50:50.057278Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-02-13T23:50:50.057286Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-02-13T23:50:50.057295Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-02-13T23:50:50.057304Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-02-13T23:50:50.057312Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-02-13T23:50:50.057320Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-02-13T23:50:50.057328Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-02-13T23:50:50.057336Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-02-13T23:50:50.057350Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-02-13T23:50:50.057360Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2016-02-13T23:50:50.057368Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2016-02-13T23:50:50.057430Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-02-13T23:50:50.057473Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-02-13T23:50:50.057512Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-02-13T23:50:50.057551Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-02-13T23:50:50.057607Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-02-13T23:50:50.057678Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-02-13T23:50:50.057732Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-02-13T23:50:50.057772Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-02-13T23:50:50.057816Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2016-02-13T23:50:50.057856Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-02-13T23:50:50.057898Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-02-13T23:50:50.057910Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2016-02-13T23:50:50.057919Z 0 [Note] Shutting down plugin 'InnoDB'
2016-02-13T23:50:50.058028Z 0 [Note] InnoDB: FTS optimize thread exiting.
2016-02-13T23:50:50.058201Z 0 [Note] InnoDB: Starting shutdown...
2016-02-13T23:50:50.158515Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2016-02-13T23:50:50.159546Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 160213 18:50:50
2016-02-13T23:50:51.836011Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1210194
2016-02-13T23:50:51.841736Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2016-02-13T23:50:51.841804Z 0 [Note] Shutting down plugin 'MEMORY'
2016-02-13T23:50:51.841848Z 0 [Note] Shutting down plugin 'CSV'
2016-02-13T23:50:51.841862Z 0 [Note] Shutting down plugin 'sha256_password'
2016-02-13T23:50:51.841875Z 0 [Note] Shutting down plugin 'mysql_native_password'
2016-02-13T23:50:51.842343Z 0 [Note] Shutting down plugin 'binlog'
2016-02-13T23:50:51.842853Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
160213 18:50:51 mysqld_safe mysqld from pid file /var/lib/mysql/localhost.localdomain.pid ended
我做错了什么以及如何启动mysqld服务?
答案 0 :(得分:0)
我解决了这个问题!我不知道为什么它没有创建系统表(可能是因为它的写权限)。我重新检查我的权限,然后尝试执行以下命令,并重新创建系统数据库及其表。
/ usr / sbin / mysqld --basedir = / usr --datadir = / var / lib / mysql --plugin-dir = / usr / lib64 / mysql / plugin --user = mysql --log-error = / var / lib / mysql / localhost.localdomain.err --pid-file = / var / lib / mysql / localhost.localdomain.pid --initialize