安装Mysql群集时启动Mysql

时间:2015-08-19 14:30:35

标签: mysql linux ubuntu

当我在singel服务器上安装了mysql集群时,我遇到启动mysql的问题。

我已经读过一些地方,如果你安装Mysql集群,你不必下载MySQL服务器或客户端(apt-get install mysql-server / client) 这些将最终陷入冲突。 Mysql数据包应该在我从here下载的mysql-cluster-gpl-7.4.7-linux-glibc2.5-x86_64文件中。

但是如何在没有安装mysql-server或client的情况下启动mysql?

如果我在提示中写mysql,我会收到以下错误消息:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

如果我搜索“mysql-cluster-gpl-7.4.7-linux-glibc2.5-x86_64”,那么我找不到任何匹配的文件到mysqld.sock

我也尝试启动mysqld,但我有很多错误。

2015-08-19 14:52:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-08-19 14:52:00 4208 [ERROR] Can't find messagefile '/usr/local/mysql-cluster-gpl-7.4.7-linux-glibc2.5-x86_64/share/mysql/errmsg.sys'
2015-08-19 14:52:00 4208 [Warning] Can't create test file /usr/local/mysql/data/Idrottskoll.lower-test
2015-08-19 14:52:00 4208 [Warning] Can't create test file /usr/local/mysql/data/Idrottskoll.lower-test
2015-08-19 14:52:00 4208 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)

2015-08-19 14:52:00 4208 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000)

2015-08-19 14:52:00 4208 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Unknown error 1017
2015-08-19 14:52:00 4208 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2015-08-19 14:52:00 4208 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-19 14:52:00 4208 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-19 14:52:00 4208 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-19 14:52:00 4208 [Note] InnoDB: Compressed tables use zlib 1.2.8
2015-08-19 14:52:00 4208 [Note] InnoDB: Using Linux native AIO
2015-08-19 14:52:00 4208 [Note] InnoDB: Using CPU crc32 instructions
2015-08-19 14:52:00 4208 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-19 14:52:00 4208 [Note] InnoDB: Completed initialization of buffer pool
2015-08-19 14:52:00 4208 [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode
2015-08-19 14:52:00 4208 [ERROR] InnoDB: The system tablespace must be writable!
2015-08-19 14:52:00 4208 [ERROR] Plugin 'InnoDB' init function returned error.
2015-08-19 14:52:00 4208 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-08-19 14:52:00 4208 [ERROR] mysqld: unknown option '--ndbcluster'
2015-08-19 14:52:00 4208 [ERROR] Aborting

2015-08-19 14:52:00 4208 [Note] Binlog end
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'partition'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_METRICS'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_CMPMEM'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_CMP'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_LOCKS'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'INNODB_TRX'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'ARCHIVE'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'BLACKHOLE'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'CSV'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'MRG_MYISAM'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'MEMORY'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'MyISAM'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'sha256_password'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'mysql_old_password'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'mysql_native_password'
2015-08-19 14:52:00 4208 [Note] Shutting down plugin 'binlog'
2015-08-19 14:52:00 4208 [Note] 

我显然是编程新手,并且可以真正使用你的帮助来解释mysql如何与mysql集群一起工作。

我已按照以下link安装mysql集群:

Mysql Cluster似乎有效:

[ndbd(NDB)] 1 node(s)
id=2    @46.21.99.140  (mysql-5.6.25 ndb-7.4.7, Nodegroup: 0, *)

[ndb_mgmd(MGM)] 1 node(s)
id=1    @46.21.99.140  (mysql-5.6.25 ndb-7.4.7)

[mysqld(API)]   1 node(s)
id=3    @46.21.99.140  (mysql-5.6.25 ndb-7.4.7)

如果我输入:ps aux | grep mysql

root      3800  0.0  0.0   4440   752 ?        S    14:24   0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/myname.pid

mysql     3951  0.4  5.7 1514076 465052 ?      Sl   14:24   0:05 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/myname.err --pid-file=/usr/local/mysql/data/myname.pid --socket=/tmp/mysql.sock


my.cnf

[mysqld]
# Options for mysqld process:
ndbcluster                      # run NDB storage engine

basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
#socket= /tmp/mysql.sock


[mysql_cluster]
# Options for MySQL Cluster processes:
ndb-connectstring=xx.xx.xx.xxx  # location of management server

1 个答案:

答案 0 :(得分:0)

现在它有效!我用socket = / var / run / mysqld / mysqld.sock替换了#socket = /tmp/mysql.sock并删除了注释。创建了一个名为mysqld的文件夹和一个名为mysqld.sock的文件夹中的新文件。

重新启动mysql后启动了!

感谢Marc B的帮助!