infobright安装

需要boost 1.42 或更高版本,redhat自带的boost是1.41版本,所以需要下载个新的编译安装一下: 
下载安装boost:http://www.boost.org/users/download/ 
Shell代码   收藏代码
  1. cd boost_1_45_0  
  2. ./bootstrap.sh --prefix=/usr/local/boost_1_45_0  
  3. ./bjam install  
  4. export BOOST_ROOT=/usr/local/boost_1_45_0  
  5. echo "/usr/local/boost_1_45_0/lib" > /etc/ld.so.conf.d/boost-x86_64.conf  
  6. ldconfig  


如果没有mysql用户和组,需要加入: 
Shell代码   收藏代码
  1. shell> groupadd mysql  
  2. shell> useradd -g mysql mysql  


# 编译安装 MySQL and Infobright server and client tools 
Shell代码   收藏代码
  1. shell> cd infobright-version  
  2. make  PREFIX=/usr/local/infobright  EDITION=community release
    make PREFIX=/usr/local/infobright   EDITION=community install-release
  3.   
  4. # Setting config file and brighthouse.ini file.  
  5. shell> cp src/build/pkgmt/my-ib.cnf /etc/  
  6.   
  7. shell> cd /usr/local/infobright  
  8. shell> bin/mysql_install_db --defaults-file=/etc/my-ib.cnf --user=mysql  
  9. shell> chown -R root  .  
  10. shell> chown -R mysql var cache  
  11. shell> chgrp -R mysql .  


安装启动脚本: 
Shell代码   收藏代码
  1. shell> cp share/mysql/mysql.server /etc/init.d/mysqld-ib  
  2. shell> vi /etc/init.d/mysqld-ib  

找到以下两行: 
Shell代码   收藏代码
  1. conf=@BH_CONF@  
  2. user=@BH_USER@  

修改为: 
Shell代码   收藏代码
  1. conf=/etc/mysql-ib.cnf  
  2. 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
编译安装

? View Code SHELL
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

? View Code TEXT
1
2
3
basedir = /usr/local/infobright
datadir = /usr/local/infobright/data
log-error = /usr/local/infobright/logs/bh.err

启动ib实例

? View Code TEXT
1
2
cd /usr/local/infobright
bin/mysqld_safe --defaults-file=conf/my-ib.cnf --user=mysql > /dev/null 2>&1 &

初始化ib实例的密码

? View Code TEXT
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

? View Code TEXT
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等数据挖掘操作了。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值