linux - Centos 单机 源码 编译 安装 mysql cluster 7.2.7 source install

原文链接http://blog.csdn.net/ylqmf/article/details/7795497
tudou@xiaomi
mkdir -p /opt/soft/mysql-cluster-7.2.7
tudou@xiaomi

CHOST="x86_64-pc-linux-gnu" \
CFLAGS=" -O3 \
-m128bit-long-double \
-m64 \
-ftree-loop-linear \
-fprefetch-loop-arrays \
-freg-struct-return \
-fgcse-sm \
-fgcse-las \
-frename-registers \
-fforce-addr \
-fivopts \
-ftree-vectorize \
-ftracer \
-frename-registers \
-minline-all-stringops \
-felide-constructors \
-fno-exceptions \
-fno-rtti" \
CXXFLAGS="${CFLAGS}" \
cmake -DCMAKE_INSTALL_PREFIX=/opt/soft/mysql-cluster-7.2.7 \
-DMYSQL_UNIX_ADDR=/tmp/mysql-cluster.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DWITH_EMBEDDED_SERVER=0 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_NDBCLUSTER_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_USER=mysql \
-DWITH_DEBUG=0 \
-DWITH_SSL=yes
tudou@xiaomi

make
make install


#config
vi config.ini
[ndb_mgmd]
hostname=192.168.161.80
datadir=/home/data/mysqlc/ndb_data1
NodeId=1


[ndbd default]
noofreplicas=2


[ndbd]
hostname=192.168.161.80
datadir=/home/data/mysqlc/ndb_data3
NodeId=3


[ndbd]
hostname=192.168.161.80
datadir=/home/data/mysqlc/ndb_data4
NodeId=4


[ndbd]
hostname=192.168.161.80
datadir=/home/data/mysqlc/ndb_data5
NodeId=5


[ndbd]
hostname=192.168.161.80
datadir=/home/data/mysqlc/ndb_data6
NodeId=6


[mysqld]
hostname=192.168.161.80
NodeId=50


[mysqld]
hostname=192.168.161.80
NodeId=51


[mysqld]
hostname=192.168.161.80
NodeId=52


[mysqld]
hostname=192.168.161.80
NodeId=53

vi my50.cnf
[mysqld]
ndbcluster
datadir=/home/data/mysqlc/ndb_data50
basedir=/opt/soft/mysql-cluster-7.2.7
port=3350

vi my51.cnf
[mysqld]
ndbcluster
datadir=/home/data/mysqlc/ndb_data51
basedir=/opt/soft/mysql-cluster-7.2.7
port=3351

vi my52.cnf
[mysqld]
ndbcluster
datadir=/home/data/mysqlc/ndb_data52
basedir=/opt/soft/mysql-cluster-7.2.7
port=3352

vi my53.cnf
[mysqld]
ndbcluster
datadir=/home/data/mysqlc/ndb_data53
basedir=/opt/soft/mysql-cluster-7.2.7
port=3353

mkdir -p /home/data/mysqlc/ndb_data1


#install db
/opt/soft/mysql-cluster-7.2.7/scripts/mysql_install_db --no-defaults --user=mysql --datadir=/home/data/mysqlc/ndb_data1
cp -r /home/data/mysqlc/ndb_data1 /home/data/mysqlc/ndb_data3
cp -r /home/data/mysqlc/ndb_data1 /home/data/mysqlc/ndb_data4
cp -r /home/data/mysqlc/ndb_data1 /home/data/mysqlc/ndb_data5
cp -r /home/data/mysqlc/ndb_data1 /home/data/mysqlc/ndb_data6


cp -r /home/data/mysqlc/ndb_data1 /home/data/mysqlc/ndb_data50
cp -r /home/data/mysqlc/ndb_data1 /home/data/mysqlc/ndb_data51
cp -r /home/data/mysqlc/ndb_data1 /home/data/mysqlc/ndb_data52
cp -r /home/data/mysqlc/ndb_data1 /home/data/mysqlc/ndb_data53


chown mysql:mysql /home/data/mysqlc/ -R
chown mysql:mysql /opt/soft/mysql-cluster-7.2.7/ -R


#ndb_manager start
/opt/soft/mysql-cluster-7.2.7/bin/ndb_mgmd --config-file=/opt/soft/mysql-cluster-7.2.7/config.ini --initial --configdir=/opt/soft/mysql-cluster-7.2.7/conf


#ndbd start
/opt/soft/mysql-cluster-7.2.7/bin/ndbd --ndb-connectstring=192.168.161.80:1186 --ndb-nodeid=3 --daemon 
/opt/soft/mysql-cluster-7.2.7/bin/ndbd --ndb-connectstring=192.168.161.80:1186 --ndb-nodeid=4 --daemon 
/opt/soft/mysql-cluster-7.2.7/bin/ndbd --ndb-connectstring=192.168.161.80:1186 --ndb-nodeid=5 --daemon 
/opt/soft/mysql-cluster-7.2.7/bin/ndbd --ndb-connectstring=192.168.161.80:1186 --ndb-nodeid=6 --daemon


#mysqld start
/opt/soft/mysql-cluster-7.2.7/bin/mysqld_safe --defaults-file=/opt/soft/mysql-cluster-7.2.7/my50.cnf &
/opt/soft/mysql-cluster-7.2.7/bin/mysqld_safe --defaults-file=/opt/soft/mysql-cluster-7.2.7/my51.cnf &
/opt/soft/mysql-cluster-7.2.7/bin/mysqld_safe --defaults-file=/opt/soft/mysql-cluster-7.2.7/my52.cnf &
/opt/soft/mysql-cluster-7.2.7/bin/mysqld_safe --defaults-file=/opt/soft/mysql-cluster-7.2.7/my53.cnf &


#show status

/opt/soft/mysql-cluster-7.2.7/bin/ndb_mgm -e show

Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     4 node(s)
id=3    @192.168.161.80  (mysql-5.5.25 ndb-7.2.7, Nodegroup: 0, Master)
id=4    @192.168.161.80  (mysql-5.5.25 ndb-7.2.7, Nodegroup: 0)
id=5    @192.168.161.80  (mysql-5.5.25 ndb-7.2.7, Nodegroup: 1)
id=6    @192.168.161.80  (mysql-5.5.25 ndb-7.2.7, Nodegroup: 1)


[ndb_mgmd(MGM)] 1 node(s)
id=1    @192.168.161.80  (mysql-5.5.25 ndb-7.2.7)


[mysqld(API)]   4 node(s)
id=50   @192.168.161.80  (mysql-5.5.25 ndb-7.2.7)
id=51   @192.168.161.80  (mysql-5.5.25 ndb-7.2.7)
id=52   @192.168.161.80  (mysql-5.5.25 ndb-7.2.7)
id=53   @192.168.161.80  (mysql-5.5.25 ndb-7.2.7)

原文链接http://blog.csdn.net/ylqmf/article/details/7795497


下面给出另一个config.ini给大家作为参考

[NDBD DEFAULT]
NoOfReplicas=2
DataMemory=644245094
IndexMemory=322122547
DataDir=/app/ndb/data
BackupDataDir=/app/ndb/data/backup
LockPagesInMainMemory=1

TimeBetweenLocalCheckpoints=20
TimeBetweenGlobalCheckpoints=1000
TimeBetweenEpochs=100
TimeBetweenWatchdogCheckInitial=60000

StringMemory=28
MaxNoOfTables=1024
MaxNoOfOrderedIndexes=2048
MaxNoOfUniqueHashIndexes=512
MaxNoOfAttributes=20480
MaxNoOfTriggers=10240

DiskCheckpointSpeedInRestart=100M
FragmentLogFileSize=256M
NoOfFragmentLogFiles=16
RedoBuffer=64M

MaxNoOfConcurrentOperations=500000

TransactionInactiveTimeout=50000

MaxNoOfExecutionThreads=8

BatchSizePerLocalScan=512

### 磁盘存储
SharedGlobalMemory=20M
DiskPageBufferMemory=80M

###### COMPUTER DEFINITIONS ######
### Datanode Computer #1
[COMPUTER]
Id=1
HostName=datanode1.mysqlab.net
### Datanode Computer #2
[COMPUTER]
Id=2
HostName=datanode2.mysqlab.net
# Management Node Computer #1
[COMPUTER]
Id=3
HostName=mgmtnode.mysqlab.net

#### Data Nodes
# Node group #1
[NDBD]
Id=1
ExecuteOnComputer=1
[NDBD]
Id=2
ExecuteOnComputer=2
# Node group #2
[NDBD]
Id=3
ExecuteOnComputer=1
[NDBD]
Id=4
ExecuteOnComputer=2
# Node group #3
[NDBD]
Id=5
ExecuteOnComputer=1
[NDBD]
Id=6
ExecuteOnComputer=2
# Node group #4
[NDBD]
Id=7
ExecuteOnComputer=1
[NDBD]
Id=8
ExecuteOnComputer=2

### Management node
[NDB_MGMD]
Id=9
ExecuteOnComputer=3

# Anonymous API nodes
[MYSQLD]
Id=51
Hostname=mysqld01.mysqlab.net


你可能感兴趣的:(mysql,linux,manager,centos,server,collation)