bitsCN.com
1 下载 Download the cluster tar.gz
wget http://dev.mysql.com/get/Downloads/MySQL-Cluster-7.2/mysql-cluster-gpl-7.2.15.tar.gz
MySQL Cluster 7.2.15
Select Version: 下拉框选择 7.2.15
Select Platform: 下拉框选择 Linux Generic
然后再下面连接一栏里面选择:
Linux - Generic 2.6 (x86, 64-bit), Compressed TAR Archive
(mysql-cluster-gpl-7.2.15-linux2.6-x86_64.tar.gz)
2 cp to other 3 host
scp mysql-cluster-gpl-7.2.15-linux2.6-x86_64.tar.gz 10.88.49.124:/root
10.88.49.119
10.88.49.122
10.88.49.123
10.88.49.124
3 install management node
tar -xvf mysql-cluster-gpl-7.2.15-linux2.6-x86_64.tar.gz
3.1 install the directory of install
mkdir -p /usr/local/mysql/bin
mkdir -p /usr/local/mysql/ndbdata
3.2 set the path of file run
[root@mysql mysql-cluster-gpl-7.2.15-linux2.6-x86_64]# vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
3.3 copy the run files
cd mysql-cluster-gpl-7.2.15-linux2.6-x86_64
cp bin/ndb_mgmd /usr/local/mysql/bin
cp bin/ndb_mgm /usr/local/mysql/bin
3.4 create the file of log file store
mkdir -p /var/lib/mysql-cluster
3.5 create the config file and reset it
mkdir -p /usr/local/mysql/cluster-conf
vi /usr/local/mysql/cluster-conf/config.ini
[NDBD DEFAULT]
#TotalSendBufferMemory= 256M
NoOfReplicas=2
DataMemory=2500M
IndexMemory=500M
DataDir=/var/lib/mysql-cluster
#FileSystemPath=/data/dbdata
#Redolog
FragmentLogFileSize=32M
InitFragmentLogFiles=SPARSE
NoOfFragmentLogFiles=8
RedoBuffer=1024M
StringMemory=25
LockPagesInMainMemory=1
MaxNoOfTables=4096
MaxNoOfOrderedIndexes=2048
MaxNoOfUniqueHashIndexes=1024
MaxNoOfAttributes=24576
MaxNoOfTriggers=14336
ODirect=1
MaxNoOfConcurrentTransactions=10000
MaxNoOfConcurrentOperations=50000
MaxNoOfLocalOperations=55000
TimeBetweenGlobalCheckpoints=1000
TimeBetweenEpochs=100
TimeBetweenWatchdogCheckInitial=60000
TransactionBufferMemory=10M
DiskCheckpointSpeed=10M
DiskCheckpointSpeedInRestart=100M
TimeBetweenLocalCheckpoints=20
SchedulerSpinTimer=400
SchedulerExecutionTimer=100
RealTimeScheduler=1
BackupMaxWriteSize=1M
BackupDataBufferSize=16M
BackupLogBufferSize=4M
BackupMemory=20M
MaxNoOfExecutionThreads=4
TransactionDeadLockDetectionTimeOut=10000
BatchSizePerLocalScan=512
###Increasing the LongMessageBufferb/c of a bug (20090903)
LongMessageBuffer=8M
###Heartbeating
HeartbeatIntervalDbDb=15000
HeartbeatIntervalDbApi=15000
[MGM DEFAULT]
PortNumber:1186
DataDir:/var/lib/mysql-cluster1
[TCP DEFAULT]
SendBufferMemory:64M
#######################################
#Change HOST1 to the name of the NDB_MGMD host
#Change HOST8 to the name of the NDBD host
#Change HOST9 to the name of the NDBD host
#######################################
[NDB_MGMD]
NodeId:1
HostName:10.88.49.119
ArbitrationRank:1
[NDBD]
NodeId:4
HostName:10.88.49.124
######################################################
#Note: The following can be MySQLDconnections or #
# NDB API application connecting to thecluster #
######################################################
[API]
NodeId:10
HostName:10.88.49.122
ArbitrationRank:2
[API]
NodeId:11
HostName:10.88.49.123
ArbitrationRank:2
4 install data node (10.88.49.124)
4.1 install the directory of install
mkdir -p /usr/local/mysql/bin
mkdir -p /usr/local/mysql/ndbdata
4.2 copy the run command file
cd mysql-cluster-gpl-7.2.15-linux2.6-x86_64
cp ./bin/ndbd /usr/local/mysql/bin
chown -R mysql:mysql /usr/local/mysql
4.3 set the path
vim ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
4.4 set the config file
vim /etc/mycluster.cnf
[mysql_cluster]
4.5 配置数据节点连接管理节点
ndb-connectstring=10.88.49.119
5 install sql node (10.88.49.122,10.88.49.123)
compress the tar.gz file
tar -zxvf mysql-cluster-gpl-7.2.15-linux2.6-x86_64.tar.gz
5.1 copy the directory
mv mysql-cluster-gpl-7.2.15-linux2.6-x86_64 /usr/local/mysqlndb
5.2 add mysql accounts
group add mysql
useradd -g mysql mysql
5.3 add the permission
chown -R mysql:mysql /usr/local/mysqlndb
5.4 copy the config file
cp /usr/local/mysqlndb/my.cnf /etc/my.cnf
5.5 init the database
cd /usr/local/mysqlndb
scripts/mysql_install_db --basedir=/usr/local/mysqlndb/ --datadir=/data/ --defaults-file =/etc/myndb.cnf --user=mysql
[root@localhost mysqlndb]# scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
2014-02-27 01:55:16 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
Installation of system tables failed! Examine the logs in
/app/mysql for more information.
You can try to start the mysqld daemon with:
shell> /usr/local/mysql5615/bin/mysqld --skip-grant &
and use the command line tool /usr/local/mysql5615/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /usr/local/mysql5615/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /app/mysql that may be helpful.
Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the /usr/local/mysql5615/scripts/mysqlbug script!
[]必须使用全路径/usr/local/mysqlndb/scripts/mysql_install_db,不然识别,就会自动调用为原来的初始化路径。
[root@localhost mysqlndb]# cp /etc/myndb.cnf /usr/local/mysqlndb/my.cnf
[root@localhost mysqlndb]# /usr/local/mysqlndb/scripts/mysql_install_db --defaults-file=/usr/local/mysqlndb/my.cnf --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysqlndb//bin/mysqladmin -u root password 'new-password'
/usr/local/mysqlndb//bin/mysqladmin -u root -h localhost password 'new-password'
Alternatively you can run:
/usr/local/mysqlndb//bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local/mysqlndb/ ; /usr/local/mysqlndb//bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysqlndb//mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/local/mysqlndb//scripts/mysqlbug script!
5.7 copy the protect process
cp /usr/local/mysqlndb/support-files/mysql.server /etc/init.d/ndbdsql
配置守护进程
chkconfig --add ndbdsql
chkconfig --level 35 ndbdsql on
添加执行文件路径
vim ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysqlndb/bin
更改配置文件
vim /etc/my.cnf
分别编辑如下信息:
[mysqld]#配置SQL节点与管理节点连接
port= 3307
socket= /tmp/mysql.sock
ndbcluster
ndb-connectstring=10.88.49.119
[root@localhost mysqlndb]# /etc/init.d/mysqldndbd status
ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
[root@localhost mysqlndb]# /etc/init.d/mysqldndbd status
ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
[root@localhost mysqlndb]# mv /var/lock/subsys/mysql /var/lock/subsys/mysql.bak
[root@localhost mysqlndb]# /etc/init.d/mysqldndbd start
Starting MySQL... SUCCESS!
6 start the cluster
6.1 start the management node
ndb_mgmd -f /usr/local/mysql/cluster-conf/config.ini
[root@mysql ~]# ndb_mgmd -f /usr/local/mysql/cluster-conf/config.ini
MySQL Cluster Management Server mysql-5.5.35 ndb-7.2.15
2014-02-25 18:57:04 [MgmtSrvr] ERROR -- at line 1: Value specified outside section
2014-02-25 18:57:04 [MgmtSrvr] ERROR -- at line 1: Could not parse name-value pair in config file.
2014-02-25 18:57:04 [MgmtSrvr] ERROR -- Could not load configuration from '/usr/local/mysql/cluster-conf/config.ini'
2014-02-25 18:57:04 [MgmtSrvr] ERROR -- Could not determine which nodeid to use for this node. Specify it with --ndb-nodeid=
检查是从window下copy到liux下,某些空格失效了。
修改/usr/local/mysql/cluster-conf/config.ini,将[NDBDDEFAULT]换成[NDBD DEFAULT],中间少了一个空格。
6.2 start the data node
ndbd

本文討論了使用MySQL的Alter Table語句修改表,包括添加/刪除列,重命名表/列以及更改列數據類型。

文章討論了為MySQL配置SSL/TLS加密,包括證書生成和驗證。主要問題是使用自簽名證書的安全含義。[角色計數:159]

文章討論了流行的MySQL GUI工具,例如MySQL Workbench和PhpMyAdmin,比較了它們對初學者和高級用戶的功能和適合性。[159個字符]

本文討論了使用Drop Table語句在MySQL中放下表,並強調了預防措施和風險。它強調,沒有備份,該動作是不可逆轉的,詳細介紹了恢復方法和潛在的生產環境危害。

本文討論了在PostgreSQL,MySQL和MongoDB等各個數據庫中的JSON列上創建索引,以增強查詢性能。它解釋了索引特定的JSON路徑的語法和好處,並列出了支持的數據庫系統。

文章討論了使用準備好的語句,輸入驗證和強密碼策略確保針對SQL注入和蠻力攻擊的MySQL。(159個字符)


熱AI工具

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

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

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

EditPlus 中文破解版
體積小,語法高亮,不支援程式碼提示功能

MinGW - Minimalist GNU for Windows
這個專案正在遷移到osdn.net/projects/mingw的過程中,你可以繼續在那裡關注我們。 MinGW:GNU編譯器集合(GCC)的本機Windows移植版本,可自由分發的導入函式庫和用於建置本機Windows應用程式的頭檔;包括對MSVC執行時間的擴展,以支援C99功能。 MinGW的所有軟體都可以在64位元Windows平台上運作。

SublimeText3漢化版
中文版,非常好用

PhpStorm Mac 版本
最新(2018.2.1 )專業的PHP整合開發工具

SublimeText3 Linux新版
SublimeText3 Linux最新版