需要boost 1.42 或更高版本,redhat自带的boost是1.41版本,所以需要下载个新的编译安装一下:
下载安装boost:http://www.boost.org/users/download/
如果没有mysql用户和组,需要加入:
# 编译安装 MySQL and Infobright server and client tools
安装启动脚本:
找到以下两行:
修改为:
启动:
shell> /etc/init.d/mysql-ib start
客户端连接:
shell> /usr/local/infobright/bin/mysql --default-file=/etc/my-ib.cnf -uroot
加入开机启动:
下载安装boost:http://www.boost.org/users/download/
- cd boost_1_45_0
- ./bootstrap.sh --prefix=/usr/local/boost_1_45_0
- ./bjam install
- export BOOST_ROOT=/usr/local/boost_1_45_0
- echo "/usr/local/boost_1_45_0/lib" > /etc/ld.so.conf.d/boost-x86_64.conf
- ldconfig
如果没有mysql用户和组,需要加入:
- shell> groupadd mysql
- shell> useradd -g mysql mysql
# 编译安装 MySQL and Infobright server and client tools
- shell> cd infobright-version
-
make PREFIX=/usr/local/infobright EDITION=community release make PREFIX=/usr/local/infobright EDITION=community install-release
- # Setting config file and brighthouse.ini file.
- shell> cp src/build/pkgmt/my-ib.cnf /etc/
- shell> cd /usr/local/infobright
- shell> bin/mysql_install_db --defaults-file=/etc/my-ib.cnf --user=mysql
- shell> chown -R root .
- shell> chown -R mysql var cache
- shell> chgrp -R mysql .
安装启动脚本:
- shell> cp share/mysql/mysql.server /etc/init.d/mysqld-ib
- shell> vi /etc/init.d/mysqld-ib
找到以下两行:
- conf=@BH_CONF@
- user=@BH_USER@
修改为:
- conf=/etc/mysql-ib.cnf
- user=mysql
启动:
shell> /etc/init.d/mysql-ib start
客户端连接:
shell> /usr/local/infobright/bin/mysql --default-file=/etc/my-ib.cnf -uroot
加入开机启动:
shell> chkconfig --add mysqld-ib
##########################
最近在搞后台数据分析,涉及大量的数据,他们使用的数据仓库是InfoBright(简称ib),ib提供社区版本(ICE)和商业版本(IEE)。两者区别较大。不过对于即时性要求不是特别严格的需要,社区版本勉强够用了。
两者之间的区别,参考博文: Infobright分享<1>:发展现状和ICE-IEE间区别
本文主要是指导ib的安装及使用(如果涉及boost及其他基础软件版本过低,请自行升级安装)
首先从InfoBright官网下载源码,最新的版本是:infobright-4.0.7-0-src-ice.tar.gz
编译安装
1 2 3 4 5 6 7 8 | tar zxvf infobright-4.0.7-0-src-ice.tar.gz cd infobright-4.0.7 make PREFIX=/usr/local/infobright EDITION=community release make PREFIX=/usr/local/infobright EDITION=community install-release mkdir /usr/local/infobright/conf /usr/local/infobright/data /usr/local/infobright/logs chown -R mysql.mysql /usr/local/infobright/data /usr/local/infobright/logs cp src/build/pkgmt/my-ib.cnf /usr/local/infobright/conf/my-ib.cnf /usr/local/infobright/bin/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/infobright/data --user=mysql |
修改my-ib.cnf
1 2 3 | basedir = /usr/local/infobright datadir = /usr/local/infobright/data log-error = /usr/local/infobright/logs/bh.err |
启动ib实例
1 2 | cd /usr/local/infobright bin/mysqld_safe --defaults-file=conf/my-ib.cnf --user=mysql > /dev/null 2>&1 & |
初始化ib实例的密码
1 | /usr/local/infobright/bin/mysqladmin -u root password "123456" |
因为使用的ICE社区版本,所以只能使用IB loader导入数据(其实就是只支持csv文件手工导入数据)。
注意:create table t () engine=brighthouse xxx;
创建表时,表的引擎要使用【brighthouse】,这样才会使用到ib仓库的特性(因为infobright-4.0.7带得有myisam、memory等mysql存储引擎,如果不指定,有可能使用到其他引擎)
示例如下,假设csv数据文件为data.csv
1 2 | bin/mysql -u root -p123456 load data infile "/root/data.csv" into table t_data fields terminated by ',' enclosed by '"' escaped by '\' lines terminated by '\n'; |
数据导入成功后,就可以在ib中对数据进行sum、avg、group by等数据挖掘操作了。