日期:2014-05-16  浏览次数:20447 次

Spider Storage Engine安装手顺
MySQL数据库的记录数达到两千万后,性能会急剧下降。所以在未到达之前,就要考虑新的办法。Spider Storage Engine可以对MySQL进行分区,因此进行了相关的调查。

1.下载MySQL源代码、Spider源代码、condition pushdown安装包(用于将Spider服务器的查询条件传递到远端服务器)
MySQL源代码下载地址:http://dev.mysql.com/downloads/mysql/#downloads
Spider源代码下载地址:https://launchpad.net/spiderformysql/+download
condition pushdown安装包下载地址:https://edge.launchpad.net/partitionconditionpushdownformysql/+download
都放置于/home/peng目录下。

2.安装Spider
解压MySQL源代码:
cd /home/peng
mkdir spider
mkdir /usr/src/redhat      # MySQL源代码会被解压到这里
cd spider
rpm -ivh --nodeps --force /home/peng/MySQL-community-5.1.46-1.rhel5.src.rpm

执行成功后,会在/usr/src/redhat/SOURCES下出现MySQL源文件的压缩包:mysql-5.1.46.tar.gz

解压上述压缩包:
tar -xzf /usr/src/redhat/SOURCES/mysql-5.1.46.tar.gz


同样在/home/peng/spider目录下解压Spider源代码以及文档:
tar -xzf /home/peng/spider-src-2.19-for-5.1.44.tgz.tar
tar -xzf /home/peng/spider-doc-2.19-for-5.1.44.tgz.tar


同样在/home/peng/spider目录下解压condition pushdown安装包(版本推荐5.1.36):
tar -xzf /home/peng/partition_cond_push-0.1-for-5.1.36.tgz


spider storage engine源码向MySQL中移行:
mv spider mysql-5.1.46/storage/


spider storage engine和MySQL集成编译:
cd mysql-5.1.46
patch -p2 < ../mysql-5.1.44.spider.diff
patch -p2 < ../mysql-5.1.36.partition_cond_push.diff
autoconf  # autoconf安装手顺请参照下面
automake  # automake安装手顺请参照下面

./configure --enable-thread-safe-client \
--enable-local-infile \
--with-pic --with-fast-mutexes \
--with-client-ldflags=-static \
--with-mysqld-ldflags=-static --with-zlib-dir=bundled \
--with-big-tables --with-ssl --with-readline \
--with-embedded-server --with-partition \
--with-innodb --without-ndbcluster \
--without-archive-storage-engine \
--without-blackhole-storage-engine \
--with-csv-storage-engine \
--without-example-storage-engine \
--without-federated-storage-engine \
--with-extra-charsets=complex && make


编译成功时的信息
引用
g++ -DMYSQL_INSTANCE_MANAGER -DMYSQL_SERVER -I. -I../../include -I../../zlib -I../../include -I../../include    -O3    -fno-implicit-templates -fno-exceptions -fno-rtti -MT mysqlmanager-guardian.o -MD -MP -MF .deps/mysqlmanager-guardian.Tpo -c -o mysqlmanager-guardian.o `test -f 'guardian.cc' || echo './'`guardian.cc
mv -f .deps/mysqlmanager-guardian.Tpo .deps/mysqlmanager-guardian.Po
g++ -DMYSQL_INSTANCE_MANAGER -DMYSQL_SERVER -I. -I../../include -I../../zlib -I../../include -I../../include    -O3    -fno-implicit-templates -fno-exceptions -fno-rtti -MT mysqlmanager-parse_output.o -MD -MP -MF .deps/mysqlmanager-parse_output.Tpo -c -o mysqlmanager-parse_output.o `test -f 'parse_output.cc' || echo './'`parse_output.cc
mv -f .deps/mysqlmanager-parse_output.Tpo .deps/mysqlmanager-parse_output.Po
g++ -DMYSQL_INSTANCE_MANAGER -DMYSQL_SERVER -I. -I../../include -I../../zlib -I../../include -I../../include    -O3    -fno-implicit-templates -fno-exceptions -fno-rtti -MT mysqlmanager-user_management_commands.o -MD -MP -MF .deps/mysqlmanager-user_management_commands.Tpo -c -o mysqlmanager-user_management_commands.o `test -f 'user_management_commands.cc' || echo './'`user_management_commands.cc
mv -f .deps/mysqlmanager-user_management_commands.Tpo .deps/mysqlmanager-user_management_commands.Po
g++ -DMYSQL_INSTANCE_MANAGER -DMYSQL_SERVER -I. -I../../include -I../../zlib -I../../include -I../../include    -O3    -fno-implicit-templates -fno-exceptions -fno-rtti -MT mysqlmanager-angel.o -MD -MP -MF .deps/mysqlmanager-angel.Tpo -c -o mysqlmanager-angel.o `test -f 'angel.cc'