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

MemSQL学习笔记-类似MySQL的数据库
http://gigaom.com/cloud/ex-facebookers-launch-memsql-to-make-your-database-fly/


-- 多主-从

http://www.mysqlops.com/2012/02/14/diy_multi_master_replication.html
http://www.cnblogs.com/liuhao/archive/2012/06/26/2563702.html


前facebook员工和前微软sql server工程师联合搞的一个分布式关系数据库
全部内存运行,将sql转化成速度更快的c++, 原理类似HipHop


有mysql api, 完全兼容mysql,没有学习使用成本
速度是mysql的30倍,每秒可处理150万的事务


官方网站:http://memsql.com/
参考文档:http://space.itpub.net/7607759/viewspace-733545


参考官方文档:http://developers.memsql.com/docs/1b/
http://developers.memsql.com/docs/1b/
-- ==============================================================


1  Install

wget http://download.memsql.com/814d3816f4084953833243fbf6c40d37/memsqlbin_amd64.tar.gz

tar xvfz memsqlbin_amd64.tar.gz
cd memsqlbin
./check_system
Warning: The version of CentOS that you're using (5.5) is too low.
MemSQL supports versions 6.0 and up.

/home/manchun/memsqlbin/objdir/usr/local/bin/memsql-g++: /lib64/libc.so.6: version GLIBC_2.11' not found (required by /home/manchun/memsqlbin/objdir/usr/local/bin/memsql-g++)


【解决办法】安装glibc
[root@banggo ~]# 
wget http://ftp.gnu.org/pub/gnu/glibc/glibc-2.11.tar.gz
tar zxvf glibc-2.11.tar.gz
cd glibc-2.11
mkdir glibc-2.11-build
退出去在别的目录执行如下编译
/usr/src/glibc-2.11/configure --prefix=/usr/src/glibc-2.11/glibc-2.11-build/
error:
checking for .cfi_personality and .cfi_lsda pseudo-ops... no 
configure: error: assembler too old, .cfi_personality support missing 


【解决】
参考网址 
http://groups.google.com/group/rocks-clusters/browse_thread/thread/4c9298adecf5a335 
http://www.caritasem.com/?p=162


I couldn't overcome that problem, and I'm wondering how I can, but I 
said, "hey cuda only requires glibc-2.7, so lets compile that". I went 
ahead, and installed it into /share/apps/glibc-2.7. So here comes the 
main question: how can I link CUDA C to the glibc-2.7 installed in 
/share/apps ? Years ago, Tim Carlson has said "It is really not 
practical to try and upgrade glibc to 2.5. You might want to try 
installing a glibc 2.5 from source in /share/apps/glibc-2.5 and then 
use LD_PRELOAD to load that library in for you CMAQ binary.", but I 
don't know how to use LD_PRELOAD, and I would appreciate any 
guideline. 
[换成2.8]
[root@banggo ~]# 
wget http://ftp.gnu.org/pub/gnu/glibc/glibc-2.8.tar.gz
tar zxvf glibc-2.8.tar.gz
cd glibc-2.8
mkdir glibc-2.8-build
退出去在别的目录执行如下编译
/usr/src/glibc-2.8/configure --prefix=/usr/src/glibc-2.8/glibc-2.8-build/
make
make install


继续执行刚才的check_system
[root@banggo memsqlbin]# ./check_system
Warning: The version of CentOS that you're using (5.5) is too low.
MemSQL supports versions 6.0 and up.
/home/manchun/memsqlbin/objdir/usr/local/bin/memsql-g++: /lib64/libc.so.6: version 'GLIBC_2.11' not found (required by /home/manchun/memsqlbin/objdir/usr/local/bin/memsql-g++)
【】我不得不承认,我out了,仔细一看,原来需要centos 6.0的。



2 重新安装
wget http://download.memsql.com/814d3816f4084953833243fbf6c40d37/memsqlbin_amd64.tar.gz
tar xvfz memsqlbin_amd64.tar.gz
cd memsqlbin
 ./check_system 
报错如下:
Warning: The recommended configuration for MemSQL is at least 8 GB of RAM


【】解决方案:
 let "mem_mb=$(free -m | sed  -n -e '/^Mem:/s/^[^0-9]*\([0-9]*\) .*/\1/p')";
if [ $mem_mb -lt 1000 ]; then
    echo "Warning: The recommended configuration for MemSQL is at least 1 GB of RA