自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

MySQL Cluster開發(fā)環(huán)境簡(jiǎn)明部署

數(shù)據(jù)庫(kù) MySQL
MySQL Cluster 開發(fā)環(huán)境簡(jiǎn)明部署(中文版),內(nèi)容很詳細(xì),適合新手學(xué)習(xí)。具體內(nèi)容請(qǐng)看下文。

主要內(nèi)容

1. 獲取; 2. 安裝; 3. 配置; 4. 運(yùn)行; 5. 測(cè)試; 6. 停止; 7. 總結(jié)

1. 獲取

這個(gè)不必多言吧,到 MySQL 網(wǎng)站上面下載就是了。MySQL Cluster 的英文部署測(cè)試手冊(cè)很簡(jiǎn)明,這里和其內(nèi)容基本一樣。喜歡讀英文版的朋友可以直接下載,略過本文。

2. 安裝

先解壓,然后創(chuàng)建一個(gè) symbolic link:

  1. michael@linux:~$ tar xvf mysql-cluster-gpl-7.2.4-linux2.6-x86_64.tar  
  2. michael@linux:~$ ln -s mysql-cluster-gpl-7.2.4-linux2.6-x86_64 mysqlc 

如果你愿意,可以將~/mysqlc/bin加入到你的 path 里,方便使用。

3. 配置

作為在開發(fā)環(huán)境上第一次部署,還是以測(cè)試為主要目的。一個(gè)完整的 MySQL Cluster 由 MySQL Server,Data Nodes,Management Node 三部分組成。首先我們?yōu)樗鼈儎?chuàng)建一些必須的目錄:

  1. michael@linux:~$ mkdir mysql-cluster  
  2. michael@linux:~$ cd mysql-cluster  
  3. michael@linux:~$ mkdir conf ndb_data mysqld_data 

然后在conf目錄下創(chuàng)建如下兩個(gè)文件,分別是config.inimy.cnf,內(nèi)容如下:

config.ini

用于 MySQL Server 的配置,端口號(hào)port根據(jù)你自己的情況設(shè)定。

  1. [mysqld]  
  2. ndbcluster  
  3. datadir=/home/user1/my_cluster/mysqld_data  
  4. basedir=/home/user1/mysqlc  
  5. port=5050  

my.cnf

該文件用于配置各結(jié)點(diǎn)的 NodeId 和 Data Nodes 與 Management Node 的數(shù)據(jù)目錄。

  1. [ndb_mgmd]  
  2. hostname=localhost  
  3. datadir=/home/user1/my_cluster/ndb_data  
  4. NodeId=1  
  5.  
  6. [ndbd default]  
  7. noofreplicas=2  
  8. datadir=/home/user1/my_cluster/ndb_data  
  9.  
  10. [ndbd]  
  11. hostname=localhost  
  12. NodeId=3  
  13.  
  14. [ndbd]  
  15. hostname=localhost  
  16. NodeId=4  
  17.  
  18. [mysqld]  
  19. NodeId=50  

這時(shí)你的目錄結(jié)構(gòu)應(yīng)該如下:

  1. ~  
  2. +-- /mysql-cluster-gpl-7.2.4-linux2.6-x86_64  
  3. +-- /mysqlc -> mysql-cluster-gpl-7.2.4-linux2.6-x86_64  
  4. +-- /mysql-cluster  
  5.     +-- /conf  
  6.     +-- /ndb_data  
  7.     +-- /mysqld_data  

4. 運(yùn)行

MySQL Cluster 的啟動(dòng)順序是有要求的,如下:

  1. Management Node

  2. Data Nodes

  3. MySQL Server

命令如下:

  1. michael@linux:~$ cd ../mysql-cluster  
  2. michael@linux:~/mysql-cluster$ $HOME/mysqlc/bin/ndb_mgmd -f conf/config.ini --initial --configdir=$HOME/mysql-cluster/conf/  
  3. michael@linux:~/mysql-cluster$ $HOME/mysqlc/bin/ndbd -c localhost:1186  
  4. michael@linux:~/mysql-cluster$ $HOME/mysqlc/bin/ndbd -c localhost:1186  

檢查已經(jīng)啟動(dòng)的結(jié)點(diǎn)的狀態(tài),命令為:

  1. poecahnt@linux:~$ $HOME/mysqlc/bin/ndb_mgm -e show  

輸出如下:

  1. Connected to Management Server at: localhost:1186  
  2. Cluster Configuration  
  3. ---------------------  
  4. [ndbd(NDB)]     2 node(s)  
  5. id=3    @127.0.0.1  (mysql-5.5.19 ndb-7.2.4, Nodegroup: 0, Master)  
  6. id=4    @127.0.0.1  (mysql-5.5.19 ndb-7.2.4, Nodegroup: 0)  
  7.  
  8. [ndb_mgmd(MGM)] 1 node(s)  
  9. id=1    @127.0.0.1  (mysql-5.5.19 ndb-7.2.4)  
  10.  
  11. [mysqld(API)]   1 node(s)  
  12. id=50   @127.0.0.1  (mysql-5.5.19 ndb-7.2.4)  

表示已經(jīng)可以啟動(dòng) MySQL Server 了。最后啟動(dòng) MySQL Server,命令為:

  1. michael@linux:~/mysql-cluseter$ $HOME/mysqlc/bin/mysqld --defaults-file=conf/my.cnf &  

輸出信息如下:

  1. 120223 15:29:02 InnoDB: The InnoDB memory heap is disabled  
  2. 120223 15:29:02 InnoDB: Mutexes and rw_locks use GCC atomic builtins  
  3. 120223 15:29:02 InnoDB: Compressed tables use zlib 1.2.3  
  4. 120223 15:29:02 InnoDB: Using Linux native AIO  
  5. 120223 15:29:02 InnoDB: Initializing buffer pool, size = 128.0M  
  6. 120223 15:29:02 InnoDB: Completed initialization of buffer pool  
  7. 120223 15:29:02 InnoDB: highest supported file format is Barracuda.  
  8. 120223 15:29:02  InnoDB: Waiting for the background threads to start  
  9. 120223 15:29:03 InnoDB: 1.1.8 started; log sequence number 1595675  
  10. 120223 15:29:04 [Note] NDB: NodeID is 50, management server 'localhost:1186' 
  11. 120223 15:29:04 [Note] NDB[0]: NodeID: 50, all storage nodes connected  
  12. 120223 15:29:04 [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  
  13. 120223 15:29:04 [Note] Starting Cluster Binlog Thread  
  14. 120223 15:29:04 [Note] Event Scheduler: Loaded 0 events  
  15. 120223 15:29:04 [Note] $HOME/mysqlc/bin/mysqld: ready for connections.  
  16. Version: '5.5.19-ndb-7.2.4-gpl'  socket: '/tmp/mysql.sock'  port: 5050  MySQL Cluster Community Server (GPL)  
  17. 120223 15:29:05 [Note] NDB: Creating mysql.ndb_schema  
  18. 120223 15:29:08 [Note] NDB Binlog: CREATE TABLE Event: REPL$mysql/ndb_schema  
  19. 120223 15:29:09 [Note] NDB Binlog: logging ./mysql/ndb_schema (UPDATED,USE_WRITE)  
  20. 120223 15:29:09 [Note] NDB: Creating mysql.ndb_apply_status  
  21. 120223 15:29:09 [Note] NDB Binlog: CREATE TABLE Event: REPL$mysql/ndb_apply_status  
  22. 120223 15:29:09 [Note] NDB Binlog: logging ./mysql/ndb_apply_status (UPDATED,USE_WRITE)  
  23. 120223 15:29:09 [Note] NDB: missing frm for mysql.ndb_index_stat_sample, discovering...  
  24. 120223 15:29:09 [Note] NDB: missing frm for mysql.ndb_index_stat_head, discovering...  
  25. 2012-02-23 15:29:10 [NdbApi] INFO     -- Flushing incomplete GCI:s < 579/14  
  26. 2012-02-23 15:29:10 [NdbApi] INFO     -- Flushing incomplete GCI:s < 579/14  
  27. 120223 15:29:10 [Note] NDB Binlog: starting log at epoch 579/14  
  28. 120223 15:29:10 [Note] NDB Binlog: ndb tables writable  

5. 測(cè)試

連接 MySQL Server 進(jìn)行測(cè)試,確認(rèn)可以用ndb存儲(chǔ)引擎來創(chuàng)建數(shù)據(jù)庫(kù)中的表,如下:

  1. michael@linux:~$ $HOME/mysqlc/bin/mysql -h 127.0.0.1 -P 5050  
  2. mysql> create database clusterdb;  
  3. mysql> use clusterdb;  
  4. mysql> insert into simples values (1),(2),(3),(4);  
  5. mysql> select * from simples;  
  6.  
  7.         +----+  
  8.         | id |  
  9.         +----+  
  10.         |  3 |  
  11.         |  1 |  
  12.         |  2 |  
  13.         |  4 |  
  14.         +----+  

6. 停止

MySQL Cluster 必須手動(dòng)停止,Data Nodes 可以用 ndb_mgm 來停止:

  1. michael@linux:~$ $HOME/mysqlc/bin/mysqladmin -h 127.0.0.1 -P 5050 shutdown  

如果提示:

  1. /home/michael/mysqlc/bin/mysqladmin: shutdown failed; error: 'Access denied; you need (at least one of) the SHUTDOWN privilege(s) for this operation' 

則在shutdown命令前加上sudo。

  1. michael@linux:~$ $HOME/mysqlc/bin/ndb_mgm -e shutdown  

正常停止的信息類似如下:

  1. 120223 16:44:11 [Note] /home/michael/mysqlc/bin/mysqld: Normal shutdown  
  2.  
  3. michael@linux:~/mysql-cluster$ 120223 16:44:11 [Note] Event Scheduler: Purging the queue. 0 events  
  4. 120223 16:44:13 [Warning] /home/michael/mysqlc/bin/mysqld: Forcing close of thread 2  user'michael' 
  5.  
  6. 120223 16:44:13 [Note] Stopping Cluster Utility thread  
  7. 120223 16:44:13 [Note] Stopping Cluster Index Stats thread  
  8. 120223 16:44:13 [Note] Stopping Cluster Binlog  
  9. 120223 16:44:13 [Note] Stopping Cluster Index Statistics thread  
  10. 120223 16:44:14  InnoDB: Starting shutdown...  
  11. 120223 16:44:15  InnoDB: Shutdown completed; log sequence number 1595675  
  12. 120223 16:44:15 [Note] /home/michael/mysqlc/bin/mysqld: Shutdown complete  

7. 總結(jié)

  1. 有序啟動(dòng):Management Node,Data Nodes,MySQL Server

  2. 配置項(xiàng)與各節(jié)點(diǎn)的對(duì)應(yīng)

  3. 每個(gè)結(jié)點(diǎn)都單獨(dú)啟動(dòng)

  4. Management Node 提供狀態(tài)查看等多種功能

 原文鏈接:http://blog.csdn.net/poechant/article/details/7289103

【編輯推薦】

  1. MySQL內(nèi)存表的特性與使用介紹
  2. 利用Java進(jìn)行MySql數(shù)據(jù)庫(kù)的導(dǎo)入和導(dǎo)出
  3. 甲骨文推出MySQL集群7.2
  4. MySQL的四種不同查詢的分析
  5. MySQL Workbench 5.2.38發(fā)布

 

責(zé)任編輯:林師授 來源: 柳大·Poechant的博客
相關(guān)推薦

2010-05-22 10:38:15

Symbian開發(fā)

2010-05-02 14:29:15

Meego開發(fā)

2010-06-03 10:51:09

Hadoop安裝部署

2011-06-17 16:47:12

Qt Eclipse Windows

2011-06-17 17:16:01

Qt Eclipse Linux

2011-06-15 15:01:32

2011-06-17 17:01:22

Qt Eclipse Windows

2010-05-17 13:39:10

MySQL Clust

2012-10-09 11:01:18

IBMdw

2009-09-02 17:38:19

C#開發(fā)GIS

2013-07-11 09:55:38

LVS瓶頸LVS ClusterOSPF+LVS

2010-05-28 12:32:50

2012-05-15 14:28:58

XP安裝WP7開發(fā)環(huán)境

2013-08-30 15:56:57

MySQLMariaDB

2010-08-23 10:19:49

DIV+CSS

2011-01-27 09:19:14

Mono開發(fā)

2011-01-11 14:30:29

企業(yè)內(nèi)網(wǎng)開發(fā)環(huán)境

2011-07-07 10:12:40

MySQL Clust

2009-07-03 13:45:48

JSP簡(jiǎn)明教程組件為中心

2022-01-22 21:38:19

K8SRedisRedis clus
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)