Preface:
This is my first time in contact with Linux, CentOS, and MySQL. After five days, I finally succeeded in the MySQL-Cluster architecture based on CentOS 5.0. I will share my experiences with you. If you find any errors and negligence, Please mail me: stan_home@qq.com.
(PDF text version please: http://www.linuxidc.com/upload/2011_06/11061508344915.rar)
Before configuration, add some common Linux commands:
Ls browsing
Ls-l permission to view folders and files
Vi Text Editor (search and edit)
I status is modified
Exit: "Esc", enter ":", and then enter "wq" to write and exit
: Q! Force exit
Vim-f [file name] force file recovery
Cp file copy command
Rm delete file
Create a folder using mkdir
Ln connection price or directory
Man [command] view Command Parameters
Ifconfig Nic information command
Dig (domain information searcher)
Df view system files
Vmstat system status
Ps to view the process (-e to show all,-f to output in full format)
Ps-ef | grep mysql view all mysql Processes
Tips: enter a file or file name. Press the Tab key to automatically change the file name (provided that the file or folder must exist );
For example:
Input
[Root @ localhost tmp] # tar-xzvf mysql-c
Press the Tab key to automatically complete the operation:
[Root @ localhost tmp] # tar-xzvf mysql-cluster-gpl-7.1.13-linux-i686-glibc23.tar.gz
Let's build the architecture together!
1. Configure the environment:
OS: Linux CentOS 5.0
MySQL: mysql-cluster-gpl-7.1.13-linux-i686-glibc23.tar.gz (Note: need to use Cluster version, can be downloaded on the official websiteHttp://dev.mysql.com/downloads/cluster/#downloads)
Node Configuration:
MGM: 192.168.20.231
NDBD1: 192.168.20.133
NDBD2: 192.168.20.233
SQL1: 192.168.0000234
SQL2: 192.168.20.235
Modify CentOS IP Address
(1) Open the/etc/sysconfig/network-scripts/ifcfg-eth0 file and make the following changes
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE = eth0
BOOTPROTO = static
ONBOOT = yes
HWADDR = 00: 0c: 29: be: b3: 53
IPADDR = 192.168.20.231
NETMASK = 255.255.255.0
GATEWAY = 192.168.20.1
(2) modify the/etc/resolv. conf file as follows (modify DNS Service)
Nameserver 202.101.172.35
Search localdomain
(3) restart the network service
[Root @ localhost ~] # Service network restart