搜尋

Mysql Cluster

Jun 07, 2016 pm 03:33 PM
clustermysql配置

Cluster配置 10.152.8.130 管理节点 10.152.8.91 数据节点 sql节点 10.152.8.92 数据节点 sql节点 1、分别在三台服务器上 将Cluster安装到C盘(默认的路径下) 2、在管理节点的C盘创建 生成c:/mysql/bin、C:/mysql/mysql-cluster(第一次启动后在这个文件夹会

Cluster配置
10.152.8.130 管理节点


10.152.8.91  数据节点 sql节点
10.152.8.92 数据节点 sql节点




1、分别在三台服务器上
将Cluster安装到C盘(默认的路径下)
2、在管理节点的C盘创建
生成c:/mysql/bin、C:/mysql/mysql-cluster(第一次启动后在这个文件夹会生成类似ndb_1_config.bin.1的文件,好像是为了以后启动加载的配置)
和c:/mysql/bin/cluster-logs目录,在下载解压的文件目录mysql/bin中将ndb_mgmd.exe和ndb_mgm.exe复制到172.16.0.162的c:/mysql/bin目录下。
在管理节点服务器的c:/mysql/bin下生成两个文件,my.ini和config.ini。
my.ini的内容为:
[mysql_cluster]

config_file=c:/mysql/bin/config.ini

config.ini文件的内容为:
[NDBD DEFAULT]
NoOfReplicas=2
datadir=d:\mysqlcluster\datanode\mysql\bin\cluster-data
datamemory=1G
indexmemory=200M
[MYSQLD DEFAULT]  
[NDB_MGMD DEFAULT]  
[TCP DEFAULT]
[NDB_MGMD]
Nodeid=1
HostName=10.152.8.130
datadir=c:\mysql\bin\cluster-logs
[NDBD]
Nodeid=2
HostName=10.152.8.91
DataDir=d:\mysqlcluster\datanode\mysql\bin\cluster-data
[NDBD]
Nodeid=3
HostName=10.152.8.92
DataDir=d:\mysqlcluster\datanode\mysql\bin\cluster-data
[MYSQLD]
Nodeid=4
HostName=10.152.8.91
[MYSQLD]
Nodeid=5
HostName=10.152.8.92

2、
在所有数据节点
在D盘创建
d:\mysqlcluster\datanode\mysql\bin\cluster-data
d:\mysqlcluster\datanode\mysql\cluster-data


将安装包解压后的mysql/bin目录中的ndbd.exe拷贝到 d:\mysqlcluster\datanode\mysql\bin 下
在d:mysqlcluster\datanode\mysql\bin 下创建 my.ini文件。内容为


[mysqld]
ndbcluster
[mysql_cluster]
ndb-connectstring=10.152.8.130

3、
在所有SQL节点中 创建
d:\mysqlcluster\sqlnode


将Cluster 安装包中的mysql的目录整个拷贝到 d:\mysqlcluster\sqlnode下


修改 d:\mysqlcluster\sqlnode\mysql\my-default.ini 或在d:\mysqlcluster\sqlnode\mysql下创建 my.ini文件
内容为:
[mysqld]
ndbcluster
ndb-connectstring=10.152.8.130

4、启动集群
顺序(必须)为:
管理节点服务器 > 数据节点服务器 > SQL节点服务器
a、
启动管理节点
c:\mysql\bin\ndb_mgmd -f config.ini --configdir=c:\mysql\bin\cluster-logs
我在启动管理节点服务器的管理节点服务时遇到如下错误:
Could neither create or open key 'SYSTEM\CurrentControlSet\Services\EventLog\Application\MySQL Cluster Management Server', error: 5
Failed to setup event logging


解决方法:
regedit 打开注册表
在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\下新建创建KEY 值 MySQL Cluster Management Server  即可
再次执行 c:\mysql\bin\ndb_mgmd -f config.ini --configdir=c:\mysql\bin\cluster-logs
查看是否启动成功
c:\mysql\bin\ndb_mgm 
ndb_mgm>show  或者 all status


b、
启动数据节点服务
d:\mysqlcluster\datanode\mysql\bin\ndbd --connect-string="nodeid2;host=10.152.8.130:1186"
d:\mysqlcluster\datanode\mysql\bin\ndbd --connect-string="nodeid3;host=10.152.8.130:1186"


nodeid2是根据管理节点的配置文件
         config.ini中的id决定的,如果id为2,则为nodeid2
查看是否启动成功
c:\mysql\bin\ndb_mgm 
ndb_mgm>show  或者 all status


如果遇到:
Could neither create or open key 'SYSTEM\CurrentControlSet\Services\EventLog\Application\MySQL Cluster Data Node Daemon', error: 5
Failed to setup event logging
解决方法:
在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\下新建创建KEY 值 MySQL Cluster Data Node Daemon 即可
c、
启动SQL节点
d:\mysqlcluster\sqlnode\mysql\bin\mysqld --console

陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
在MySQL中使用視圖的局限性是什麼?在MySQL中使用視圖的局限性是什麼?May 14, 2025 am 12:10 AM

mysqlviewshavelimitations:1)他們不使用Supportallsqloperations,限制DatamanipulationThroughViewSwithJoinsOrsubqueries.2)他們canimpactperformance,尤其是withcomplexcomplexclexeriesorlargedatasets.3)

確保您的MySQL數據庫:添加用戶並授予特權確保您的MySQL數據庫:添加用戶並授予特權May 14, 2025 am 12:09 AM

porthusermanagementinmysqliscialforenhancingsEcurityAndsingsmenting效率databaseoperation.1)usecReateusertoAddusers,指定connectionsourcewith@'localhost'or@'%'。

哪些因素會影響我可以在MySQL中使用的觸發器數量?哪些因素會影響我可以在MySQL中使用的觸發器數量?May 14, 2025 am 12:08 AM

mysqldoes notimposeahardlimitontriggers,butacticalfactorsdeterminetheireffactective:1)serverConfiguration impactactStriggerGermanagement; 2)複雜的TriggerSincreaseSySystemsystem load; 3)largertablesslowtriggerperfermance; 4)highConconcConcrencerCancancancancanceTigrignecentign; 5); 5)

mysql:存儲斑點安全嗎?mysql:存儲斑點安全嗎?May 14, 2025 am 12:07 AM

Yes,it'ssafetostoreBLOBdatainMySQL,butconsiderthesefactors:1)StorageSpace:BLOBscanconsumesignificantspace,potentiallyincreasingcostsandslowingperformance.2)Performance:LargerrowsizesduetoBLOBsmayslowdownqueries.3)BackupandRecovery:Theseprocessescanbe

mySQL:通過PHP Web界面添加用戶mySQL:通過PHP Web界面添加用戶May 14, 2025 am 12:04 AM

通過PHP網頁界面添加MySQL用戶可以使用MySQLi擴展。步驟如下:1.連接MySQL數據庫,使用MySQLi擴展。 2.創建用戶,使用CREATEUSER語句,並使用PASSWORD()函數加密密碼。 3.防止SQL注入,使用mysqli_real_escape_string()函數處理用戶輸入。 4.為新用戶分配權限,使用GRANT語句。

mysql:blob和其他無-SQL存儲,有什麼區別?mysql:blob和其他無-SQL存儲,有什麼區別?May 13, 2025 am 12:14 AM

mysql'sblobissuitableForStoringBinaryDataWithInareLationalDatabase,而ilenosqloptionslikemongodb,redis和calablesolutionsolutionsolutionsoluntionsoluntionsolundortionsolunsonstructureddata.blobobobissimplobisslowdeperformberbutslowderformandperformancewithlararengedata;

mySQL添加用戶:語法,選項和安全性最佳實踐mySQL添加用戶:語法,選項和安全性最佳實踐May 13, 2025 am 12:12 AM

toaddauserinmysql,使用:createUser'username'@'host'Indessify'password'; there'showtodoitsecurely:1)choosethehostcarecarefullytocon trolaccess.2)setResourcelimitswithoptionslikemax_queries_per_hour.3)usestrong,iniquepasswords.4)Enforcessl/tlsconnectionswith

MySQL:如何避免字符串數據類型常見錯誤?MySQL:如何避免字符串數據類型常見錯誤?May 13, 2025 am 12:09 AM

toAvoidCommonMistakeswithStringDatatatPesInMysQl,CloseStringTypenuances,chosethirtightType,andManageEngencodingAndCollat​​ionsEttingSefectery.1)usecharforfixed lengengtrings,varchar forvariable-varchar forbariaible length,andtext/blobforlargerdataa.2 seterters seterters seterters

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強大的PHP整合開發環境

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

VSCode Windows 64位元 下載

VSCode Windows 64位元 下載

微軟推出的免費、功能強大的一款IDE編輯器

SublimeText3 Linux新版

SublimeText3 Linux新版

SublimeText3 Linux最新版

SublimeText3 英文版

SublimeText3 英文版

推薦:為Win版本,支援程式碼提示!