banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành *nix [MySQL cluster] SQL node không thể kết nối đến Management node?  XML
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 31/10/2008 04:05:34 (+0700) | #31 | 157045
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

centos wrote:
trên con server 5.13 như lúc đầu em nói cái tiến trình ndbd nó không chạy thì sao mà ps aux cho anh xem được
 

Ban đầu file cấu hình config.ini của bạn chỉ có 1 data node nên bạn start cái node thứ 2 nó mới la lên rằng:
No free node id found for ndbd(NDB). 

Sau khi bạn chỉnh lại config.ini, thì khi start ở node 2 lên, tôi chắc chắn rằng nó không la thế nữa, vậy nó báo cáo gì?

centos wrote:

3. SQL node tự động connect vào MGM.
và hiện em đã bỏ bớt một SQL node để đánh bug 

"Tự động connect" sao chưa thấy trong ndb_mgm -e 'SHOW' nhỉ?

Còn vài câu hỏi bạn chưa trả lời:

- Trên 2 con data nodes có file cấu hình my.cnf chưa?
- iptables thế nào?
- Tôi cần thông tin chứng minh điều này:

Nếu con server 5.13 em chay ndbd thì con này sẽ tự động kết nối vào server và con 5.14 tự động ngắt connect. Và con 5.14 chạy Ndbd thì con này sẽ kết nối vào sever. và con 5.13 ngắt kết nối khỏi server.
 
 

 
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 31/10/2008 23:37:01 (+0700) | #32 | 157139
centos
Member

[Minus]    0    [Plus]
Joined: 28/03/2008 17:13:12
Messages: 219
Offline
[Profile] [PM]
Cám ơn anh quanta nhiều lắm, em install lại MGM thì 2 thằng data node đã connect vào mgm, nhưng còn 2 thằng SQL thì chưa connect vào được.

Code:
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=2    @192.168.5.13  (mysql-5.1.27 ndb-6.3.17, starting, Nodegroup: 0, Master)
id=3    @192.168.5.14  (mysql-5.1.27 ndb-6.3.17, starting, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=1   (mysql-5.1.27 ndb-6.3.17)

[mysqld(API)]   2 node(s)
id=4 (not connected, accepting connect from 192.168.5.14)
id=5 (not connected, accepting connect from 192.168.5.13)
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 31/10/2008 23:40:39 (+0700) | #33 | 157140
centos
Member

[Minus]    0    [Plus]
Joined: 28/03/2008 17:13:12
Messages: 219
Offline
[Profile] [PM]
Xong rồi anh tất cả đều connect đến MGM, lỗi sảy ra là do MGM bị lỗi, và em build là bản mới thì tất cả mọi thứ ok hết. Cám ơn anh Quanta đã giúp đỡ nhiều
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 31/10/2008 23:44:18 (+0700) | #34 | 157141
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
Quay lại đúng tiêu đề của topic này đó.

Hỏi lại lần cuối: iptables rules trên tất cả các nodes của bạn thế nào?
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 31/10/2008 23:53:00 (+0700) | #35 | 157144
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

centos wrote:
Xong rồi anh tất cả đều connect đến MGM, lỗi sảy ra là do MGM bị lỗi, và em build là bản mới thì tất cả mọi thứ ok hết. Cám ơn anh Quanta đã giúp đỡ nhiều 

--> Cụ thể hơn được không bạn?
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 01/11/2008 03:39:24 (+0700) | #36 | 157172
centos
Member

[Minus]    0    [Plus]
Joined: 28/03/2008 17:13:12
Messages: 219
Offline
[Profile] [PM]
Hiện em cũng không biết chính xác là nó bị gì. Em chỉ đang nhận định là lúc đầu trong một thời điểm nó chỉ có thể open port 1186 cho 1 IP. Nếu một IP khác sử dụng query đến port 1186 thì nó sẽ tự động disconnect một IP đã connect trước đó.

PS: Hiện giờ em vẫn chưa biết chính xác được. Em sẽ bug thêm và reply lỗi cụ thể
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 01/11/2008 03:48:48 (+0700) | #37 | 157173
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

centos wrote:

...
Em chỉ đang nhận định là lúc đầu trong một thời điểm nó chỉ có thể open port 1186 cho 1 IP. Nếu một IP khác sử dụng query đến port 1186 thì nó sẽ tự động disconnect một IP đã connect trước đó.
 

Chắc chắn là không có chuyện đó, trừ phi file cấu hình trên Management node bị sai (như đã nói ở trên).
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 01/11/2008 04:02:14 (+0700) | #38 | 157175
centos
Member

[Minus]    0    [Plus]
Joined: 28/03/2008 17:13:12
Messages: 219
Offline
[Profile] [PM]
lúc em build lại MGM thì em đã lưu file cấu hình trước đó sang một chỗ khác, và copy vào source mới cho nó chạy nên em nghĩ không có vấn đề gì file cấu hình.

Và lúc đầu em cũng có nghi ngờ về file config. nhưng kết quả là không phải vì nếu em chỉ để 1 Data node và 1 SQL node ở trên 2 máy khác nhau thì nó không connect tốt hết. file config của em đã post ở bài trên. Em sẽ cố gắng tìm ra cái lỗi chính xác và post lên cho mọi người tham khảo
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 09/11/2008 04:58:54 (+0700) | #39 | 158176
centos
Member

[Minus]    0    [Plus]
Joined: 28/03/2008 17:13:12
Messages: 219
Offline
[Profile] [PM]
hi anh, các node trong cluster của em như sau:

Code:
[root@RESEARCH-01 ~]# ndb_mgm -e show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=2    @192.168.5.14  (mysql-5.1.27 ndb-6.3.17, Nodegroup: 0, Master)
id=3    @192.168.5.15  (mysql-5.1.27 ndb-6.3.17, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=1    @192.168.5.12  (mysql-5.1.27 ndb-6.3.17)

[mysqld(API)]   1 node(s)
id=4    @192.168.5.13  (mysql-5.1.27 ndb-6.3.17)
.

Khi em vào trong Mysql node để tạo database và tạo table với ENGINE=NDBDCLUSTER
Code:
ERROR 1005 (HY000): Can't create table 'dbcluster.aggregator_category_feed' (errno: 157)
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 09/11/2008 06:05:13 (+0700) | #40 | 158183
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
Bạn xem lại chỗ màu đỏ:

centos wrote:


Khi em vào trong Mysql node để tạo database và tạo table với ENGINE=NDBDCLUSTER
Code:
ERROR 1005 (HY000): Can't create table 'dbcluster.aggregator_category_feed' (errno: 157)
 
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 09/11/2008 06:15:08 (+0700) | #41 | 158186
centos
Member

[Minus]    0    [Plus]
Joined: 28/03/2008 17:13:12
Messages: 219
Offline
[Profile] [PM]
em gõ lộn anh ui mà là NDBCLUSTER
Code:
mysql> CREATE TABLE IF NOT EXISTS `aggregator_category_feed` (   `fid` int(11) NOT NULL default '0',   `cid` int(11) NOT NULL default '0',   PRIMARY KEY  (`fid`,`cid`) ) ENGINE=NDBCLUSTER
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 09/11/2008 06:27:03 (+0700) | #42 | 158187
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
Trước tiên bạn cho xem:
mysql> SHOW ENGINES\G;

Ngay sau khi gặp lỗi trên, bạn gõ tiếp:

mysql> SHOW WARNINGS;
mysql> SHOW ERRORS;

xem nó 'báo cáo' gì?
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 09/11/2008 06:32:01 (+0700) | #43 | 158189
centos
Member

[Minus]    0    [Plus]
Joined: 28/03/2008 17:13:12
Messages: 219
Offline
[Profile] [PM]
Code:
mysql> SHOW ENGINES\G
*************************** 1. row ***************************
      Engine: ndbcluster
     Support: YES
     Comment: Clustered, fault-tolerant tables
Transactions: YES
          XA: NO
  Savepoints: NO
*************************** 2. row ***************************
      Engine: MRG_MYISAM
     Support: YES
     Comment: Collection of identical MyISAM tables
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 3. row ***************************
      Engine: BLACKHOLE
     Support: YES
     Comment: /dev/null storage engine (anything you write to it disappears)
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 4. row ***************************
      Engine: CSV
     Support: YES
     Comment: CSV storage engine
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 5. row ***************************
      Engine: MEMORY
     Support: YES
     Comment: Hash based, stored in memory, useful for temporary tables
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 6. row ***************************
      Engine: InnoDB
     Support: YES
     Comment: Supports transactions, row-level locking, and foreign keys
Transactions: YES
          XA: YES
  Savepoints: YES
*************************** 7. row ***************************
      Engine: ARCHIVE
     Support: YES
     Comment: Archive storage engine
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 8. row ***************************
      Engine: MyISAM
     Support: DEFAULT
     Comment: Default engine as of MySQL 3.23 with great performance
Transactions: NO
          XA: NO
  Savepoints: NO
8 rows in set (0.01 sec)

Không hiểu tại sao không có engine: NDB

Khi bi lỗi mình chạy lện show errors;
Code:
mysql> show errors;
+-------+------+----------------------------------------------------------------------+
| Level | Code | Message                                                                           |
+-------+------+----------------------------------------------------------------------+
| Error | 1005 | Can't create table 'dbcluster.aggregator_category_feed' (errno: 157) | 
+-------+------+----------------------------------------------------------------------+
1 row in set (0.00 sec)


ProcessList trong cluster
Code:
mysql> SHOW PROCESSLIST\G
*************************** 1. row ***************************
     Id: 1
   User: system user
   Host: 
     db: NULL
Command: Daemon
   Time: 1356
  State: [color=#FF0000]Waiting for ndbcluster to start[/color]
   Info: NULL
*************************** 2. row ***************************
     Id: 3
   User: root
   Host: localhost
     db: dbcluster
Command: Query
   Time: 0
  State: NULL
   Info: SHOW PROCESSLIST
2 rows in set (0.00 sec)
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 11/11/2008 11:39:50 (+0700) | #44 | 158403
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
Hì, bạn cứ đổi các nodes lung tung hết cả!

- Làm gì có engine NDB nhỉ?
- Log có gì không bạn?
- Bạn start MySQL trên con SQL node thế nào?
- Bạn thử restart ndb_mgmd trên con Management node xem.
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 11/11/2008 23:44:49 (+0700) | #45 | 158450
centos
Member

[Minus]    0    [Plus]
Joined: 28/03/2008 17:13:12
Messages: 219
Offline
[Profile] [PM]
Hi Anh,

Lúc đầu em cấu hình Mysql node và Data node chung một con server thì nó hoạt động tốt và tạo các table với NDBCLUSTER bình thường. Khi em tách chức năng của từng con để hiểu rõ và maintain tốt hơn.


Bạn thử restart ndb_mgmd trên con Management node xem.
 


Em đã start lại nhiều lần rồi và các node đã kết nối tốt vào MGM
Code:
[root@RESEARCH-01 ~]# ndb_mgm -e show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=2    @192.168.5.14  (mysql-5.1.27 ndb-6.3.17, Nodegroup: 0, Master)
id=3    @192.168.5.15  (mysql-5.1.27 ndb-6.3.17, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=1    @192.168.5.12  (mysql-5.1.27 ndb-6.3.17)

[mysqld(API)]   1 node(s)
id=4    @192.168.5.13  (mysql-5.1.27 ndb-6.3.17)



Log có gì không bạn?
 


Log trên con SQL node của em như sau:

Code:
081111 23:24:50 [ERROR] NDB: CREATE TABLE IF NOT EXISTS mysql.ndb_apply_status ( server_id INT UNSIGNED NOT NULL, epoch BIGINT UNSIGNED NOT NULL,  log_name VARCHAR(255) BINARY NOT NULL,  start_pos BIGINT UNSIGNED NOT NULL,  end_pos BIGINT UNSIGNED NOT NULL,  PRIMARY KEY USING HASH (server_id) ) ENGINE=NDB CHARACTER SET latin1: error Can't create table 'mysql.ndb_apply_status' (errno: 157) 1005(ndb: 0) 1 1
081111 23:24:50 [Note] /usr/local/mysql/bin/mysqld: Normal shutdown

081111 23:24:50 [Note] Event Scheduler: Purging the queue. 0 events
081111 23:24:50 [Note] Stopping Cluster Utility thread
081111 23:24:53 [Note] Stopping Cluster Binlog
081111 23:24:56  InnoDB: Starting shutdown...
081111 23:24:58  InnoDB: Shutdown completed; log sequence number 0 46419
081111 23:24:58 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

081111 23:24:58 mysqld_safe mysqld from pid file /usr/local/mysql/data/RESEARCH-02.pid ended
081111 23:31:49 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
081111 23:31:50  InnoDB: Started; log sequence number 0 46419
081111 23:31:50 [Note] NDB: NodeID is 4, management server '192.168.5.12:1186'
081111 23:31:51 [Note] NDB[0]: some storage nodes connected
081111 23:31:51 [Warning] NDB: server id set to zero will cause any other mysqld with bin log to log with wrong server id
081111 23:31:51 [Note] Starting Cluster Binlog Thread
081111 23:31:51 [Note] Event Scheduler: Loaded 0 events
081111 23:31:51 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.1.27-ndb-6.3.17-cluster-gpl'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Cluster Server (GPL)

081111 23:47:31 [ERROR] NDB Binlog: ndbevent->execute failed for REPL$mysql/ndb_schema; 1427 Api node died, when SUB_START_REQ reached node 
081111 23:47:31 [ERROR] NDB Binlog:FAILED CREATE (DISCOVER) EVENT OPERATIONS Event: REPL$mysql/ndb_schema
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 12/11/2008 14:22:13 (+0700) | #46 | 158570
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
- Bạn xem lại permission trên datadir?
- Cung cấp thêm log trên Management node?
- Tham khảo:
http://forums.mysql.com/read.php?25,133034,133034#msg-133034
http://lists.mysql.com/cluster/5744
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Re: [MySQL cluster] SQL node không thể kết nối đến Management node? 12/11/2008 23:28:23 (+0700) | #47 | 158599
centos
Member

[Minus]    0    [Plus]
Joined: 28/03/2008 17:13:12
Messages: 219
Offline
[Profile] [PM]

Bạn xem lại permission trên datadir?
 


Hiện giờ thì tất ca datadir trên data node của em đều là
Code:
drwxr-x---  5 mysql mysql  4096 Nov 12 08:16 data



Cung cấp thêm log trên Management node?
 


Log tren MGM:

Code:
[root@RESEARCH-01 mysql-cluster]# tail ndb_1_cluster.log 
2008-11-13 01:04:50 [MgmSrvr] INFO     -- Node 2: Local checkpoint 8 started. Keep GCI = 9798 oldest restorable GCI = 3
2008-11-13 02:02:36 [MgmSrvr] INFO     -- Node 2: Local checkpoint 9 started. Keep GCI = 11431 oldest restorable GCI = 3
2008-11-13 03:00:19 [MgmSrvr] INFO     -- Node 2: Local checkpoint 10 started. Keep GCI = 13079 oldest restorable GCI = 3
2008-11-13 03:58:05 [MgmSrvr] INFO     -- Node 2: Local checkpoint 11 started. Keep GCI = 14725 oldest restorable GCI = 3
2008-11-13 04:55:54 [MgmSrvr] INFO     -- Node 2: Local checkpoint 12 started. Keep GCI = 16392 oldest restorable GCI = 3
2008-11-13 05:53:39 [MgmSrvr] INFO     -- Node 2: Local checkpoint 13 started. Keep GCI = 18032 oldest restorable GCI = 3
2008-11-13 06:51:24 [MgmSrvr] INFO     -- Node 2: Local checkpoint 14 started. Keep GCI = 19674 oldest restorable GCI = 3
2008-11-13 07:49:10 [MgmSrvr] INFO     -- Node 2: Local checkpoint 15 started. Keep GCI = 21333 oldest restorable GCI = 3
2008-11-13 08:45:13 [MgmSrvr] WARNING  -- Node 2: Node 4 missed heartbeat 2
2008-11-13 08:46:54 [MgmSrvr] INFO     -- Node 2: Local checkpoint 16 started. Keep GCI = 22986 oldest restorable GCI = 3

[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|