mysql 7 (cluster) 叢集 配置

來源:互聯網
上載者:User

注意:在啟動資料節點後會預分配2G的硬碟空間(preallocate the space for the logs (used for recovery). This is to avoid problems during running of waiting for the OS to allocate disk space or running out of space),在分配成功後再啟動服務節點!

 

配置過程:http://www.cnblogs.com/jinzhenshui/archive/2009/12/18/1627364.html

#

管理節點設定檔my_cluster.ini:

[NDBD DEFAULT]
NoOfReplicas=2         # 預設值是2.
DataDir= E:\Program Files\MySQL\MySQL Server 7.0\Data\user_data     #如果不存在就建立一個

# Managment Server
[NDB_MGMD]
nodeid=40
HostName=192.168.1.102 #管理節點伺服器db1的IP地址
# Storage Engines   
[NDBD]
nodeid=11
HostName=192.168.1.102 #MySQL叢集db1的IP地址
[NDBD]
nodeid=12
HostName=192.168.1.102 #MySQL叢集db2的IP地址
[MYSQLD]
nodeid=1
HostName=192.168.1.102
[MYSQLD]
nodeid=2
HostName=192.168.1.102
[MYSQLD]
nodeid=3
HostName=192.168.1.102

------------------------------------------

每個的mysql設定檔(指定連接埠與datadir):
[mysqld]
basedir="e:/Program Files/MySQL/MySQL Server 7.0"
default-character-set=utf8
default-storage-engine=NDBCLUSTER
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
port=33061
datadir="e:/Program Files/MySQL/MySQL Server 7.0/data/user_data/node1/"
general_log_file="e:/Program Files/MySQL/MySQL Server 7.0/data/user_data/node1/general_log.log"
#
ndbcluster
ndb_connectstring="192.168.1.102"
#
skip_innodb
#
[ndbd]
ndb_connectstring="192.168.1.102"

------------------------------------------

將mysql資料庫複寫到datadir下

 

 

運行:

管理節點(mgmd)bat:

"E:\Program Files\MySQL\MySQL Server 7.0\bin\ndb_mgmd.exe" --config-file="E:/Program Files/MySQL/MySQL Server 7.0/data/mysql_cfg/my_cluster.ini" --initial
pause

資料節點(ndbd):

"e:\Program Files\MySQL\MySQL Server 7.0\bin\ndbd.exe" --defaults-file="e:\Program Files\MySQL\MySQL Server 7.0\data\user_data\node1\my_node1.ini"

(ndb_mgm.exe )show:

服務節點(mysqld):

"e:\Program Files\MySQL\MySQL Server 7.0\bin\mysqld.exe" --defaults-file="e:\Program Files\MySQL\MySQL Server 7.0\data\user_data\node1\my_node1.ini" --console
pause

show:

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.