真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

mysql集群怎么連接 mysql集群三種方式

如何連接 mysql cluster

Driver template :選擇要連接數(shù)據(jù)庫類型我用mysql選擇MYSQL Connector/J Driver name :所創(chuàng)建連接名字,隨便寫 Driver classname:com.mysql.jdbc.Driver要Add JARs選擇 com.mysql.jdbc.Driver路徑顯示 使用oracle參考我面式

目前創(chuàng)新互聯(lián)建站已為千余家的企業(yè)提供了網(wǎng)站建設、域名、網(wǎng)絡空間、網(wǎng)站托管維護、企業(yè)網(wǎng)站設計、拉孜網(wǎng)站維護等服務,公司將堅持客戶導向、應用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。

java程序如何連接Mysql集群?

mysql集群是master-slaver模式,java程序當然是鏈接master那臺機器了,slaver只是給master做輔助的。

C#怎么連接mysql cluster集群

mysql cluster 7.1.3 安裝筆記

今天初步安裝了一下mysql cluster,基本上都是按照官方文檔做的,歡迎大家拍磚。

1,服務器使用情況

Management (MGMD) node 192.168.0.10

MySQL server (SQL) node 192.168.0.20

Data (NDBD) node "A" 192.168.0.30

Data (NDBD) node "B" 192.168.0.40

2,安裝Management、Sql node、 Data node 重復以下步驟:

[root@www local]# tar -zxvf mysql-cluster-gpl-7.1.3-linux-i686-glibc23.tar.gz

[root@www local]# mv mysql-cluster-gpl-7.1.3-linux-i686-glibc23 mysql

[root@www local]# groupadd mysql

[root@www local]# useradd -g mysql mysql

[root@www local]# chown -R mysql.mysql mysql

[root@www local]# /usr/local/mysql/scripts/mysql_install_db --user=mysql

[root@www mysql]# cp support-files/mysql.server /etc/rc.d/init.d/

[root@www mysql]# chmod +x /etc/rc.d/init.d/mysql.server

[root@www mysql]# chkconfig --add mysql.server

3,配置Management節(jié)點:

[root@www mysql]# mkdir /var/lib/mysql-cluster

[root@www mysql]# vi /var/lib/mysql-cluster/config.ini

[ndbd default]

NoOfReplicas=2 # Number of replicas

DataMemory=80M # How much memory to allocate for data storage

IndexMemory=18M # 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 the cluster

# Note: It is recommended that you do not specify the port

# number at all and allow the default value to be used instead

# Management process options:

[ndb_mgmd]

hostname=192.168.0.10 # Hostname or IP address of management node

datadir=/var/lib/mysql-cluster # Directory for management node log files

# Options for data node "A":

[ndbd]

# (one [ndbd] section per data node)

hostname=192.168.0.30 # Hostname or IP address

datadir=/usr/local/mysql/data # Directory for this data node's data files

# Options for data node "B":

[ndbd]

hostname=192.168.0.40 # Hostname or IP address

datadir=/usr/local/mysql/data # Directory for this data node's data files

# SQL node options:

[mysqld]

hostname=192.168.0.20 # Hostname or IP address

# (additional mysqld connections can be

# specified for this node for various

# purposes such as running ndb_restore)

[root@www mysql-cluster]# cp bin/ndb_mgm* /usr/local/bin

4,配置MySQL server (SQL) node:

創(chuàng)建 /etc/my.cnf并添加下面的內(nèi)容

#ptions for mysqld process:

[mysqld]

ndbcluster # run NDB storage engine

ndb-connectstring=192.168.0.10 # location of management server

# Options for ndbd process:

[mysql_cluster]

ndb-connectstring=192.168.0.10 # location of management server

5,配置 Data (NDBD) node "A":

創(chuàng)建/etc/my.cnf文件,并添加下面的內(nèi)容

#ptions for mysqld process:

[mysqld]

ndbcluster # run NDB storage engine

ndb-connectstring=192.168.0.10 # location of management server

# Options for ndbd process:

[mysql_cluster]

ndb-connectstring=192.168.0.10 # location of management server

6,配置 Data (NDBD) node "B":

創(chuàng)建/etc/my.cnf文件,并添加下面的內(nèi)容

#ptions for mysqld process:

[mysqld]

ndbcluster # run NDB storage engine

ndb-connectstring=192.168.0.10 # location of management server

# Options for ndbd process:

[mysql_cluster]

ndb-connectstring=192.168.0.10 # location of management server

7,啟動Management節(jié)點:

[root@www local]# ndb_mgmd -f /var/lib/mysql-cluster/config.ini

2010-05-05 13:20:19 [MgmtSrvr] INFO -- NDB Cluster Management Server. mysql-5.1.44 ndb-7.1.3

2010-05-05 13:20:19 [MgmtSrvr] INFO -- Loaded config from '/usr/local/mysql/mysql-cluster/ndb_1_config.bin.1'

8,啟動 Data (NDBD) node "A"及 Data (NDBD) node "B":

[root@www local]# /usr/local/mysql/bin/ndbd

2010-05-05 13:20:30 [ndbd] INFO -- Configuration fetched from '192.168.0.10:1186', generation: 1

9,啟動 MySQL server (SQL) node

[root@www local]# /etc/init.d/mysql.server start

10,所有的節(jié)點都已經(jīng)起動完成了

[root@www local]# ndb_mgm

-- NDB Cluster -- Management Client --

ndb_mgm show

Connected to Management Server at: localhost:1186

Cluster Configuration

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

[ndbd(NDB)] 2 node(s)

id=2 @192.168.0.30 (mysql-5.1.44 ndb-7.1.3, Nodegroup: 0, Master)

id=3 @192.168.0.40 (mysql-5.1.44 ndb-7.1.3, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)

id=1 @192.168.0.10 (mysql-5.1.44 ndb-7.1.3)

[mysqld(API)] 1 node(s)

id=4 @192.168.0.20 (mysql-5.1.44 ndb-7.1.3)

mysql 群集怎么連接現(xiàn)有的數(shù)據(jù)庫

關閉集群 /usr/local/mysql/bin/ndb_mgm -e shutdown(以我的為例)

lz cd config.ini所在位置(我的是/var/lib/mysql-cluster/ )刪除該目錄下除config.ini的所有文件

關閉SQL節(jié)點所有mysqld服務和mysqld_safe服務(使用kill -9 PID(進程號))

然后按照以下順序重新啟動集群

管理節(jié)點-Data節(jié)點(id=2-id=3)-SQL節(jié)點(id=5-id=4)


名稱欄目:mysql集群怎么連接 mysql集群三種方式
鏈接URL:http://weahome.cn/article/doijsdd.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部