Mysql+heartbeat+nfs do high Availability

Source: Internet
Author: User
Tags bz2

First , the Environment preparation node two
node1:10.10.10.202
node2:10.10.10.203
Server for NFS:
node3:10.10.10.204
System Environment CentOS release 6.5 (Final)
second, create a shared directory of MySQL on the NFS server
Mkdir/data
Vim/etc/exports
/data 10.10.10.0/24 (rw,no_root_squash)
re-export the file system
Exportfs-rav
look at the client and try to mount
showmount-e 10.10.10.204
mount-t NFS 10.10.10.204:/data/data
Add the MySQL user group and the user (the ID of the MySQL user and group to keep each node is consistent OH)
groupadd-r-G MySQL
useradd-u 250-g MySQL mysql
setfacl-m U:mysql:rwx/data
Node1:
groupadd-r-G MySQL
useradd-u 250-g MySQL mysql
Node2:
groupadd-r-G MySQL
useradd-u 250-g MySQL mysql
Node1 and Node2:
Tar xf mariadb-10.0.28-linux-glibc_214-x86_64.tar.gz-c/usr/local/
ln-sv mariadb-10.0.28-linux-x86_64 MySQL
chown Root.mysql.-R
Mkdir/data/{database,binlog}
chown-r Mysql.mysql/data
Initializing the database
mariaDB10.0.28 need to install version 2.14 of glibc and 6.5 is 2.12
error message:
./bin/my_print_defaults:/lib64/libc.so.6:version ' glibc_2.14 ' not found (required by./bin/my_print_defaults)
Workaround:
Upgrade glibc
wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
Tar zxvf glibc-2.14.tar.gz
CD glibc-2.14
mkdir Build
CD Build
.. /configure--prefix=/usr/local/glibc-2.14
Make
Make Install
export ld_library_path=/usr/local/glibc-2.14/lib: $LD _library_path
ln-sf/usr/local/glibc-2.14/lib/libc-2.14.so/lib64/libc.so.6
ln-sf/lib64/libc-2.14.so/lib64/libc.so.6
error message:
Installing Mariadb/mysql system tables in '/data/database ' ...
./bin/mysqld:/usr/lib64/libstdc++.so.6:version ' glibcxx_3.4.15 ' not found (required by./bin/mysqld)
Workaround:
Upgrade GCC
wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.0/gcc-4.8.0.tar.bz2
TAR-JXVF gcc-4.8.0.tar.bz2
CD gcc-4.8.0
./contrib/download_prerequisites
CD..
mkdir gcc-build-4.8.0
CD gcc-build-4.8.0
.. /gcc-4.8.0/configure--enable-checking=release--enable-languages=c,c++--disable-multilib
Make
error message:
make[2]: * * [configure-stage1-libcpp] Error 1
make[2]: Leaving directory '/opt/gcc-build-4.8.0 '
make[1]: * * [stage1-bubble] Error 2
make[1]: Leaving directory '/opt/gcc-build-4.8.0 '
Make : * * * [ALL] Error 2
Workaround:
Yum Install gcc-c++
Make Install
determine the path to the newly installed GCC, usually by default under/usr/local/bin.
ls/usr/local/bin | grep gcc
viewing the GCC version can be used gcc-v
add a new gcc to the optional, the last third is the name, the penultimate parameter is the new GCC path, the final parameter 40 is the priority, and the new version is automatically used after setting a larger one.
update-alternatives--INSTALL/USR/BIN/GCC GCC/USR/LOCAL/BIN/I686-PC-LINUX-GNU-GCC
Start with strings/usr/lib64/libstdc++.so.6 | grep glibcxx to view supported versions
ln-sf/usr/local/lib64/libstdc++.so.6.0.18/usr/lib64/libstdc++.so.6
Copy the MySQL startup scripts and configuration files
Mkdir/etc/mysql
CP support-files/my-large.cnf/etc/mysql/my.cnf
CP Support-files/mysql.server/etc/rc.d/init.d/mysqld
chmod +x/etc/rc.d/init.d/mysqld
chkconfig--add mysqld
chkconfig mysqld off
VIM/ETC/MYSQL/MY.CNF Join
DataDir =/data/database
innodb_file_per_table = on
Log-bin=/data/binlog/master-bin
Start the service
/etc/init.d/mysqld Start

Mysql+heartbeat+nfs do high Availability

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.