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/pengmkdir spidermkdir /usr/src/redhat # MySQL源代码会被解压到这里cd spiderrpm -ivh --nodeps --force /home/peng/MySQL-community-5.1.46-1.rhel5.src.rpm
tar -xzf /usr/src/redhat/SOURCES/mysql-5.1.46.tar.gz
tar -xzf /home/peng/spider-src-2.19-for-5.1.44.tgz.tartar -xzf /home/peng/spider-doc-2.19-for-5.1.44.tgz.tar
tar -xzf /home/peng/partition_cond_push-0.1-for-5.1.36.tgz
mv spider mysql-5.1.46/storage/
cd mysql-5.1.46patch -p2 < ../mysql-5.1.44.spider.diffpatch -p2 < ../mysql-5.1.36.partition_cond_push.diffautoconf # 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
./use select engine,support,transactions,xa from information_schema.engines;
+------------+---------+--------------+------+| engine | support | transactions | xa |+------------+---------+--------------+------+| SPIDER | YES | YES | YES || MRG_MYISAM | YES | NO | NO || CSV | YES | NO | NO || MyISAM | DEFAULT | NO | NO || InnoDB | YES | YES | YES || MEMORY | YES | NO | NO |+------------+---------+--------------+------+
ln -s /usr/src/linux/include/linux /usr/include/.
cd /home/pengtar -xzf autoconf-2.63.tar.gzcd autoconf-2.63/./configure --prefix=/usrmakemake install
cd /home/pengtar -xzf automake-1.11.1.tar.gzcd automake-1.11.1./configure --prefix=/usrmakemake check (耗时很长,非必须!!!)make install
rpm -ivh cpp-4.1.2-42.el5.i386.rpmrpm -ivh kernel-headers-2.6.6-1.i386.rpmrpm -ivh glibc-2.5-24.i386.rpmrpm -ivh glibc-headers-2.5-24.i386.rpmrpm -ivh glibc-devel-2.5-24.i386.rpmrpm -ivh libgomp-4.1.2-42.el5.i386.rpmrpm -ivh gcc-4.1.2-42.el5.i386.rpm
rpm -ivh libstdc++-devel-4.1.2-42.el5.i386.rpmrpm -ivh gcc-c++-4.1.2-42.el5.i386.rpm
cd /home/pengtar -xzf MySQL-Sandbox-3.0.09.tar.gzcd MySQL-Sandbox-3.0.09perl Makefile.PLmakesudo make installexport SANDBOX_AS_ROOT=1 (如果是root用户,此处必须是0以外的值;如果是root以外用户,设不不需要执行这行。)