您的位置:首页 > 运维架构 > 网站架构

MYSQL高可用解决方案:PHXSQL(腾讯微信)编译实录

2018-03-01 12:00 323 查看
[root@king01 ~]# rpm -ivh epel-release-6-8.noarch.rpm
[root@king01 ~]# yum install -y automake zlib autoconf cmake gcc libtool ncurses ncurses-devel readline readline-devel

[root@king01 ~]# yum install -y centos-release-scl
[root@king01 ~]# yum install -y devtoolset-4-gcc-c++ devtoolset-4-gcc
[root@king01 ~]# scl enable devtoolset-4 bash

[root@king01 ~]# git clone --recursive https://github.com/tencent-wechat/phxsql.git
[root@king01 ~]# cd phxsql
[root@king01 phxsql]# cd third_party/leveldb
[root@king01 leveldb]# make
[root@king01 leveldb]# mkdir lib
[root@king01 leveldb]# cd lib
[root@king01 lib]# ln -s ../out-static/libleveldb.a libleveldb.a

[root@king01 ~]# cd phxsql
[root@king01 phxsql]# cd third_party/protobuf
[root@king01 protobuf]# cp -r ../phxpaxos/third_party/gmock gmock
[root@king01 protobuf]# ./autogen.sh
[root@king01 protobuf]# ./configure CXXFLAGS=-fPIC --prefix=/root/phxsql/third_party/protobuf
[root@king01 protobuf]# make && make install

[root@king01 ~]# cd phxsql
[root@king01 phxsql]# cd third_party/glog
[root@king01 glog]# ./configure CXXFLAGS=-fPIC --prefix=/root/phxsql/third_party/glog

[root@king01 ~]# cd phxsql
[root@king01 phxsql]# cd third_party/colib
[root@king01 colib]# make

[root@king01 ~]# cd phxsql
[root@king01 phxsql]# cd third_party/phxpaxos/third_party
[root@king01 third_party]# rm -rf glog
[root@king01 third_party]# rm -rf leveldb
[root@king01 third_party]# rm -rf protobuf
[root@king01 third_party]# ln -s ../../glog glog
[root@king01 third_party]# ln -s ../../leveldb leveldb
[root@king01 third_party]# ln -s ../../protobuf protobuf
[root@king01 third_party]# cd ..
[root@king01 phxpaxos]# ./autoinstall.sh
[root@king01 phxpaxos]# make && make install
[root@king01 phxpaxos]# cd plugin/
[root@king01 plugin]# make && make install

[root@king01 ~]# cd phxsql
[root@king01 phxsql]# cd third_party/phxrpc
[root@king01 phxrpc]# mkdir third_party
[root@king01 phxrpc]# cd third_party/
[root@king01 third_party]# ln -s ../../protobuf protobuf
[root@king01 third_party]# cd ..
[root@king01 third_party]# make

[root@king01 ~]# cd phxsql
[root@king01 phxsql]# tar zxvf percona-server-5.6.31-77.0.tar.gz
[root@king01 phxsql]# mv percona-server-5.6.31-77.0 percona
[root@king01 phxsql]# ./autoinstall.sh
[root@king01 phxsql]# make && make install
[root@king01 phxsql]# make package
creating package phxsql-0.8.5.tar.gz...

[root@king01 phxsql]# ll -h phxsql-0.8.5.tar.gz
-rw-r--r-- 1 root root 55M Mar 1 12:52 phxsql-0.8.5.tar.gz
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mysql phxsql