我在测试MySQL cluster时出现如下问题请大家帮忙分析一下是怎么回事,我的mysql cluster布署如下,用的是mysql-cluster-gpl-6.2.
我在测试MySQL cluster时出现如下问题请大家帮忙分析一下是怎么回事,,我的mysql cluster布署如下,用的是mysql-cluster-gpl-6.2.15-linux-i686-glibc23.tar.gz tar 包
节点管理器:192.168.5.254
存储节点
192.168.5.45
192.168.5.30
sql节点
192.168.5.238
按着官方文档配置好后在节点管理器(192.168.5.254)用show命令显示结果如下:
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 @192.168.5.45 (mysql-5.1.23 ndb-6.2.15, starting, Nodegroup: 0)
id=3 @192.168.5.30 (mysql-5.1.23 ndb-6.2.15, starting, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 (mysql-5.1.23 ndb-6.2.15)
[mysqld(API)] 1 node(s)
id=4 (not connected, accepting connect from 192.168.5.23
管理节点簇日志如下:
2008-09-27 14:17:30 [MgmSrvr] ALERT -- Node 1: Node 2 Disconnected
2008-09-27 14:17:30 [MgmSrvr] INFO -- Node 2: Node shutdown completed.
2008-09-27 14:17:30 [MgmSrvr] ALERT -- Node 1: Node 3 Disconnected
2008-09-27 14:17:30 [MgmSrvr] INFO -- Node 3: Node shutdown completed.
2008-09-27 14:17:32 [MgmSrvr] INFO -- Shutting down server...
2008-09-27 14:17:40 [MgmSrvr] INFO -- Mgmt server state: nodeid 4 freed, m_reserved_nodes 0000000000000000000000000000000000000000000000000000000000000002.
2008-09-27 14:17:40 [MgmSrvr] INFO -- Shutdown complete
2008-09-27 14:20:37 [MgmSrvr] INFO -- NDB Cluster Management Server. mysql-5.1.23 ndb-6.2.15
2008-09-27 14:20:37 [MgmSrvr] INFO -- Id: 1, Command port: *:1186
2008-09-27 14:20:45 [MgmSrvr] INFO -- Mgmt server state: nodeid 2 reserved for ip 192.168.5.45, m_reserved_nodes 0000000000000000000000000000000000000000000000000000000000000006.
2008-09-27 14:20:45 [MgmSrvr] INFO -- Node 1: Node 2 Connected
2008-09-27 14:20:46 [MgmSrvr] INFO -- Mgmt server state: nodeid 2 freed, m_reserved_nodes 0000000000000000000000000000000000000000000000000000000000000002.
2008-09-27 14:20:48 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:20:51 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:20:54 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:20:57 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:00 [MgmSrvr] WARNING -- Allocate nodeid (0) failed. Connection from ip 192.168.5.45. Returned error string "Connection done from wrong host ip 192.168.5.45."
2008-09-27 14:21:00 [MgmSrvr] INFO -- Mgmt server state: node id's 2 connected but not reserved
2008-09-27 14:21:00 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:03 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:06 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:09 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:12 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:15 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:18 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:21 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:24 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:27 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:30 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:31 [MgmSrvr] ALERT -- Node 1: Node 2 Disconnected
2008-09-27 14:21:31 [MgmSrvr] INFO -- Node 2: Node shutdown completed.
2008-09-27 14:21:33 [MgmSrvr] INFO -- Shutting down server...
2008-09-27 14:21:37 [MgmSrvr] INFO -- Shutdown complete
2008-09-27 14:33:52 [MgmSrvr] INFO -- NDB Cluster Management Server. mysql-5.1.23 ndb-6.2.15
2008-09-27 14:33:52 [MgmSrvr] INFO -- Id: 1, Command port: *:1186
2008-09-27 14:34:53 [MgmSrvr] INFO -- Mgmt server state: nodeid 2 reserved for ip 192.168.5.45, m_reserved_nodes 0000000000000000000000000000000000000000000000000000000000000006.
2008-09-27 14:34:53 [MgmSrvr] INFO -- Node 1: Node 2 Connected
2008-09-27 14:34:54 [MgmSrvr] INFO -- Mgmt server state: nodeid 2 freed, m_reserved_nodes 0000000000000000000000000000000000000000000000000000000000000002.
2008-09-27 14:34:56 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:34:58 [MgmSrvr] INFO -- Mgmt server state: nodeid 3 reserved for ip 192.168.5.30, m_reserved_nodes 000000000000000000000000000000000000000000000000000000000000000a.
2008-09-27 14:34:59 [MgmSrvr] INFO -- Node 1: Node 3 Connected
2008-09-27 14:34:59 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:34:59 [MgmSrvr] INFO -- Mgmt server state: nodeid 3 freed, m_reserved_nodes 0000000000000000000000000000000000000000000000000000000000000002.
2008-09-27 14:35:02 [MgmSrvr] INFO -- Node 3: Initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:02 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:35:05 [MgmSrvr] INFO -- Node 3: Initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:05 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:35:08 [MgmSrvr] INFO -- Node 3: Initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:08 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:35:11 [MgmSrvr] INFO -- Node 3: Initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:11 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:35:14 [MgmSrvr] INFO -- Node 3: Initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:14 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:35:17 [MgmSrvr] INFO -- Node 3: Initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:17 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:35:20 [MgmSrvr] INFO -- Node 3: Initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:20 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
[root@host254 mysql-cluster]# cat ndb_1_cluster.log |tail
2008-09-27 14:36:02 [MgmSrvr] INFO -- Node 3: Initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:36:02 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:36:02 [MgmSrvr] WARNING -- Allocate nodeid (0) failed. Connection from ip 192.168.5.45. Returned error string "Connection done from wrong host ip 192.168.5.45."
2008-09-27 14:36:02 [MgmSrvr] INFO -- Mgmt server state: node id's 2 3 connected but not reserved
2008-09-27 14:36:05 [MgmSrvr] INFO -- Node 3: Initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:36:05 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:36:08 [MgmSrvr] INFO -- Node 3: Initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:36:08 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:36:11 [MgmSrvr] INFO -- Node 3: Initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:36:11 [MgmSrvr] INFO -- Node 2: Initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
存储节点的错误日志如下所示:
Configuration error: Error : Could not alloc node id at 192.168.5.254 port 1186: Connection done from wrong host ip 192.168.5.45.
080927 14:35:15 [ERROR] Plugin 'ndbcluster' init function returned error.
080927 14:35:15 [ERROR] Plugin 'ndbcluster' registration as a STORAGE ENGINE failed.
080927 14:35:15 [Note] Event Scheduler: Loaded 0 events
080927 14:35:15 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.1.23-ndb-6.2.15-cluster-gpl' socket: '/tmp/mysql.sock' port: 3306 MySQL Cluster Server (GPL)
在sql节点创建测试表表时出现ndb引擎没有准备好的错误 提示:
mysql> use ctest;
Database changed
mysql> create table ctest(name varchar(50)) engine=ndbcluster;
ERROR 1005 (HY000): Can't create table 'ctest.ctest' (errno: 157)
管理节点配置文件内容如下config.ini:
#options affecting ndbd processes on all data nodes:
[NDBD DEFAULT]
NoOfReplicas=2 # Number of replicas
DataMemory=180M # How much memory to allocate for data storage
IndexMemory=80M # How much memory to allocate for index storage
# For DataMemory and IndexMemory, we have used the
# default values. Since the "world" database takes up
# only about 500KB, this should be more than enough for
# this example Cluster setup.
# TCP/IP options:
[TCP DEFAULT]
portnumber=2202
# This the default; however, you can use any
# port that is free for all the hosts in cluster
# Note: It is recommended beginning with MySQL 5.0 that
# you do not specify the portnumber at all and simply allow
# the default value to be used instead
# Management process options:
[NDB_MGMD]
id=1
hostname=192.168.5.254 # Hostname or IP address of MGM node
datadir=/var/lib/mysql-cluster # Directory for MGM node logfiles
# Options for data node "A":
[NDBD]
# (one [NDBD] section per data node)
id=2
hostname=192.168.5.45 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's datafiles
# Options for data node "B":
[NDBD]
id=3
hostname=192.168.5.30 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's datafiles
# SQL node options:
[MYSQLD]
id=4
hostname=192.168.5.238
# Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
存储节点与sql节点配置文件如下 :
[MYSQLD]
ndbcluster
ndb-connectstring=192.168.5.254
[MYSQL_CLUSTER]
ndb-connectstring=192.168.5.254
从节点服务器或存储服务器上nmap管理服务器时看不到1186端口,但telnet 192.168.5.254可以连上,不过在输入get version与get status时没有任何反应(这是我在国外一贴子上看到的)。
最终确定为192.168.5.45上防火墙引起的故障,无法与服务器1186端口通话。

MySQL在数据库和编程中的地位非常重要,它是一个开源的关系型数据库管理系统,广泛应用于各种应用场景。1)MySQL提供高效的数据存储、组织和检索功能,支持Web、移动和企业级系统。2)它使用客户端-服务器架构,支持多种存储引擎和索引优化。3)基本用法包括创建表和插入数据,高级用法涉及多表JOIN和复杂查询。4)常见问题如SQL语法错误和性能问题可以通过EXPLAIN命令和慢查询日志调试。5)性能优化方法包括合理使用索引、优化查询和使用缓存,最佳实践包括使用事务和PreparedStatemen

MySQL适合小型和大型企业。1)小型企业可使用MySQL进行基本数据管理,如存储客户信息。2)大型企业可利用MySQL处理海量数据和复杂业务逻辑,优化查询性能和事务处理。

InnoDB通过Next-KeyLocking机制有效防止幻读。1)Next-KeyLocking结合行锁和间隙锁,锁定记录及其间隙,防止新记录插入。2)在实际应用中,通过优化查询和调整隔离级别,可以减少锁竞争,提高并发性能。

MySQL不是一门编程语言,但其查询语言SQL具备编程语言的特性:1.SQL支持条件判断、循环和变量操作;2.通过存储过程、触发器和函数,用户可以在数据库中执行复杂逻辑操作。

MySQL是一种开源的关系型数据库管理系统,主要用于快速、可靠地存储和检索数据。其工作原理包括客户端请求、查询解析、执行查询和返回结果。使用示例包括创建表、插入和查询数据,以及高级功能如JOIN操作。常见错误涉及SQL语法、数据类型和权限问题,优化建议包括使用索引、优化查询和分表分区。

MySQL是一个开源的关系型数据库管理系统,适用于数据存储、管理、查询和安全。1.它支持多种操作系统,广泛应用于Web应用等领域。2.通过客户端-服务器架构和不同存储引擎,MySQL高效处理数据。3.基本用法包括创建数据库和表,插入、查询和更新数据。4.高级用法涉及复杂查询和存储过程。5.常见错误可通过EXPLAIN语句调试。6.性能优化包括合理使用索引和优化查询语句。

选择MySQL的原因是其性能、可靠性、易用性和社区支持。1.MySQL提供高效的数据存储和检索功能,支持多种数据类型和高级查询操作。2.采用客户端-服务器架构和多种存储引擎,支持事务和查询优化。3.易于使用,支持多种操作系统和编程语言。4.拥有强大的社区支持,提供丰富的资源和解决方案。

InnoDB的锁机制包括共享锁、排他锁、意向锁、记录锁、间隙锁和下一个键锁。1.共享锁允许事务读取数据而不阻止其他事务读取。2.排他锁阻止其他事务读取和修改数据。3.意向锁优化锁效率。4.记录锁锁定索引记录。5.间隙锁锁定索引记录间隙。6.下一个键锁是记录锁和间隙锁的组合,确保数据一致性。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

WebStorm Mac版
好用的JavaScript开发工具

SecLists
SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。

Dreamweaver Mac版
视觉化网页开发工具

安全考试浏览器
Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。