码迷,mamicode.com
首页 > 其他好文 > 详细

centos6下手工编译vitess

时间:2015-06-02 13:31:50      阅读:304      评论:0      收藏:0      [点我收藏+]

标签:mysql   sharding   proxy   vitess   

vitess是youtub开源的一款mysql代理,在ubuntu下编译很方便,但是在centos下且不能访问google的情况下坑比较多。最近根据其bootstrap.sh脚本手工编译成功,把过程贴处来供有兴趣的朋友参考一下。

升级automake
wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/monkeyiq:/centos6updates/CentOS_CentOS-6/noarch/automake-1.13.4-3.2.noarch.rpm

rpm -Uvh autoconf-2.69-12.2.noarch.rpm
rpm -Uvh automake-1.13.4-3.2.noarch.rpm


升级python-setuptools  root用户执行 wget https://bootstrap.pypa.io/ez_setup.py -O - | python 如果安装失败手动安装步骤如下
tar zxvf setuptools-17.0.tar.gz
cd setuptools-17.0
python ez_setup.py 


升级pip到7.0.1 wget https://bootstrap.pypa.io/get-pip.py;python get-pip.py
安装virtualenv13.0.1 ;pip install virtualenv
ln -s /usr/local/bin/python2.7 /usr/bin/python2.7

-------------------------------------------------------------
. ./dev.env

安装zookeeper
rm -fr $VTROOT/dist/vt-zookeeper-3.3.5
cd $VTTOP/third_party/zookeeper
tar -xjf zookeeper-3.3.5.tbz
mkdir -p $VTROOT/dist/vt-zookeeper-3.3.5/lib
cp zookeeper-3.3.5/contrib/fatjar/zookeeper-3.3.5-fatjar.jar $VTROOT/dist/vt-zookeeper-3.3.5/lib
cd zookeeper-3.3.5/src/c 
./configure --prefix=$VTROOT/dist/vt-zookeeper-3.3.5
make -j3 install
cd $VTTOP/third_party/zookeeper
rm -fr zookeeper-3.3.5

# install protoc and proto python libraries
protobuf_dist=$VTROOT/dist/protobuf

rm -rf  $VTROOT/dist/protobuf
cd $VTROOT
mkdir -p $VTROOT/dist/protobuf/lib/python2.7/site-packages
export PYTHONPATH=$VTROOT/dist/protobuf/lib/python2.7/site-packages:$PYTHONPATH
参考./travis/install_protobuf.sh执行如下操作
cd $VTROOT/protobuf-3.0.0-alpha-1
自带梯子,下载并解压gtest在$VTROOT/protobuf-3.0.0-alpha-1目录
./autogen.sh $VTROOT/dist/protobuf
./configure --prefix=$VTROOT/dist/protobuf
cd python/
python setup.py install

# install gRPC C++ base, so we can install the python adapters
grpc_dist=$VTROOT/dist/grpc

  rm -rf $VTROOT/dist/grpc
  mkdir -p $VTROOT/dist/grpc
 参考 ./travis/install_grpc.sh 执行
cd grpc
git submodule update --init
make install prefix=$VTROOT/dist/grpc
pip install -r src/python/requirements.txt -t $VTROOT/dist/grpc/lib/python2.7/site-packages
CFLAGS=-I$VTROOT/dist/grpc/include LDFLAGS=-L$VTROOT/dist/grpc/lib pip install --upgrade src/python/src -t $VTROOT/dist/grpc/lib/python2.7/site-packages

ln -nfs $VTTOP/third_party/go/launchpad.net $VTROOT/src
go install launchpad.net/gozk/zookeeper

go get -u github.com/golang/protobuf/proto
go get -u github.com/golang/glog
go get -u -a github.com/golang/protobuf/protoc-gen-go

以下go package在墙外需要手工下载编译,golang中国提供相应打包下载http://www.golangtc.com/download/package
go get -u golang.org/x/net/context
go get -u golang.org/x/tools/cmd/goimports
go get -u github.com/golang/lint/golint
go get -u github.com/tools/godep
go get -u google.golang.org/grpc


go get -u github.com/modocache/gover
go get -u github.com/mattn/goveralls

ln -snf $VTTOP/config $VTROOT/config
ln -snf $VTTOP/data $VTROOT/data
ln -snf $VTTOP/py $VTROOT/py-vtdb
ln -snf $VTTOP/go/zk/zkctl/zksrv.sh $VTROOT/bin/zksrv.sh
ln -snf $VTTOP/test/vthook-test.sh $VTROOT/vthook/test.sh

echo "$MYSQL_FLAVOR" > $VTROOT/dist/MYSQL_FLAVOR
cp $VTTOP/config/gomysql.pc.tmpl $VTROOT/lib/gomysql.pc
echo "Version:" "$($VT_MYSQL_ROOT/bin/mysql_config --version)" >> $VTROOT/lib/gomysql.pc
echo "Cflags:" "$($VT_MYSQL_ROOT/bin/mysql_config --cflags) -ggdb -fPIC" >> $VTROOT/lib/gomysql.pc
echo "Libs:" "$($VT_MYSQL_ROOT/bin/mysql_config --libs_r)" >> $VTROOT/lib/gomysql.pc


# install bson
cd $VTTOP/third_party/py/bson-0.3.2
python ./setup.py install --prefix=$VTROOT/dist/py-vt-bson-0.3.2
rm -r build

# install cbson
cd $VTTOP/py/cbson
python ./setup.py install --prefix=$VTROOT/dist/py-cbson

# create pre-commit hooks
ln -sf $VTTOP/misc/git/pre-commit $VTTOP/.git/hooks/pre-commit

centos6下手工编译vitess

标签:mysql   sharding   proxy   vitess   

原文地址:http://blog.csdn.net/jiashiwen/article/details/46325753

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!