Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7656413
  • 博文数量: 1770
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16357
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1770)

文章存档

2024年(15)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: Mysql/postgreSQL

2012-05-03 09:29:47

安装mysql spdier
wget
wget
tar -zxvf mysql-5.5.14-spider-2.28-vp-0.17-hs-1.1-q4m-0.95-linux-x86_64-glibc25.tgz
mv mysql-5.5.14-spider-2.28-vp-0.17-hs-1.1-q4m-0.95-linux-x86_64-glibc25 mysql
mv mysql /usr/local/
cd /usr/local/mysql
cp support-files/mysql.server /etc/init.d/mysql
cp support-files/my-small.cnf /etc/my.cnf
groupadd mysql
useradd -g mysql mysql
./scripts/mysql_install_db --user=mysql
chown -R mysql /usr/local/mysql/data
chgrp -R mysql /usr/local/mysql/.
chmod 755 /etc/init.d/mysql
chkconfig --level 345 mysql on
echo "/usr/local/mysql/lib" >> /etc/ld.so.conf
ldconfig
sed -i "s#/usr/local/mysql-5.5.14-spider-2.28-vp-0.17-hs-1.1-q4m-0.95-linux-x86_64-glibc25#/usr/local/mysql#g" /etc/init.d/mysql
service mysql start
/usr/local/mysql/bin/mysqladmin -u root password google123
echo 'export PATH="/usr/local/mysql/bin:$PATH"' >>/etc/profile
source /etc/profile
sed -i 's#thread_stack = 128K#thread_stack = 512K#g' /etc/my.cnf
/etc/init.d/mysql restart
 
启用spider引擎
tar -zxvf spider-init-2.28-for-5.5.14.tgz
mysql -uroot -pgoogle123
查看引擎
mysql -uroot -pgoogle123 -e "show engines;"
+--------------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine             | Support | Comment                                                    | Transactions | XA   | Savepoints |
+--------------------+---------+------------------------------------------------------------+--------------+------+------------+
| SPIDER             | YES     | Spider storage engine                                      | YES          | YES  | NO         |
| InnoDB             | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        |
| MRG_MYISAM         | YES     | Collection of identical MyISAM tables                      | NO           | NO   | NO         |
| PERFORMANCE_SCHEMA | YES     | Performance Schema                                         | NO           | NO   | NO         |
| CSV                | YES     | CSV storage engine                                         | NO           | NO   | NO         |
| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables  | NO           | NO   | NO         |
| MyISAM             | YES     | MyISAM storage engine                                      | NO           | NO   | NO         |
+--------------------+---------+------------------------------------------------------------+--------------+------+------------+
 
A数据库
drop schema if exists myspider;
create schema myspider;
use myspider;
Create table tbl_a(
        col_a int,
        col_b int,
        primary key(col_a)
) engine = Spider                                            //启用spider引擎
Connection ' table "tbl_a", user "root", password "root" '
partition by range( col_a )
(
        partition pt1 values less than (1000000)            //id号10W以内在192.168.14.12机器
          comment 'host "192.168.14.12", port "3306"',
        partition pt1 values less than (2000000) 
          comment 'host "192.168.14.13", port "3306"', 
        partition pt2 values less than (MAXVALUE)
          comment 'host "192.168.14.14", port "3306"'
);

B、C、D安装
tar -zxvf Percona-Server-5.5.22-rel25.2-237.Linux.x86_64.tar.gz
mv Percona-Server-5.5.22-rel25.2-237.Linux.x86_64 mysql
mv mysql /usr/local
cd /usr/local/mysql
cp support-files/mysql.server /etc/init.d/mysql
cp support-files/my-small.cnf /etc/my.cnf
groupadd mysql
useradd -g mysql mysql
./scripts/mysql_install_db --user=mysql
chown -R mysql /usr/local/mysql/data
chgrp -R mysql /usr/local/mysql/.
chmod 755 /etc/init.d/mysql
chkconfig --level 345 mysql on
echo "/usr/local/mysql/lib" >> /etc/ld.so.conf
ldconfig
sed -i "s#/usr/local/Percona-Server-5.5.22-rel25.2-237.Linux.x86_64#/usr/local/mysql#g" /etc/init.d/mysql
service mysql start
/usr/local/mysql/bin/mysqladmin -u root password google123
echo 'export PATH="/usr/local/mysql/bin:$PATH"' >>/etc/profile
source /etc/profile
 
//测试用,允许root远程防问
grant all on *.* to identified by 'root';
 
drop schema if exists myspider;
create schema myspider;
use myspider;
Create table tbl_a(
        col_a int,
        col_b int,
        primary key(col_a)
) ;

A:
insert into tbl_a values (1,1);
insert into tbl_a values (1500001,2);
insert into tbl_a values (2000001,2);
 
可以到各个数据库查看数据的分布情况
阅读(1068) | 评论(0) | 转发(0) |
0

上一篇:hiera-mysql

下一篇:tcpcopy测试

给主人留下些什么吧!~~