作業系統:Centos5.6
Infobright版本:Infobright Community Edition(ICE)4.0.5
下面的安裝過程和Infobright源碼中的README檔案中給出的步驟基本相同,變化的地方很少。Infobright配置過程也很類似與MySQL Community的配置過程的。README檔案的内容見下篇部落格,Infobright Installation Using a Source Distribution(Infobright README):http://blog.csdn.net/geekcoder/article/details/12571237
1、配置編譯連接配接工具
# yum install gcc* make autoconf libtools* -y
Infobright源碼編譯安裝和啟動mysqld-ib的時候需要使用到boost庫, boost庫版本要求在v1.42.0以上。
編譯安裝boost庫
boost-1.43.0下載下傳頁面,http://sourceforge.net/projects/boost/files/boost/1.43.0/
或者個人360網盤下載下傳位址:http://yunpan.cn/QbqmFR9IQiLI3
# ./bootstrap.sh --prefix=/usr/local/boost_1_43_0
# ./bjam install
執行bootstrap.sh過程中會提示安裝一些依賴包,按照提示yum安裝這些依賴的包。
在環境變量中,配置boost庫動态連接配接路徑
# vim /etc/profile
添加 export LD_LIBRARY_PATH=/usr/local/boost_1_43_0/lib:$LD_LIBRARY_PATH
# source /etc/profile
# ldconfig 或者 #/sbin/ldconfig -v
這一步很重要,否則下面的Infobright的安裝過程中和啟動mysqld-ib會提示找不到很多共享庫檔案(.so檔案)。
2、編譯安裝Infobright
個人360網盤下載下傳位址:http://yunpan.cn/Qbqm8DsTyhyyU
# tar zxvf infobright-4.0.7-0-src-ice.tar.gz
# cd infobright-4.0.7
# make -j 8 PREFIX=/usr/local/infobright EDITION=community release
# make -j 8 PREFIX=/usr/local/infobright EDITION=community install-release
make -j 8 表示使用伺服器的8個核并行編譯
PREFIX=/usr/local/infobright 指定安裝路徑
3、添加mysql使用者
# useradd mysql
禁止使用mysql賬戶系統登入,
# vim /etc/passwd
mysql:x:500:500::/home/mysql:/bin/bash 更改為
mysql:x:500:500::/home/mysql:/sbin/nologin
4、mysql資料庫初始化
# cp src/build/pkgmt/my-ib.cnf /usr/local/infobright/conf/my-ib.cnf
可以修改my-ib.cnf配置檔案,如basedir、datadir、log等參數選項
basedir = /usr/local/infobright
datadir = /usr/local/infobright/data
log-error = /usr/local/infobright/data/bh.err
# cd /usr/local/infobright
# ./bin/mysql_install_db --basedir=/usr/local/infobright --datadir=/usr/local/infobright/data --user=mysql
如果這一步提示錯誤,表示--basedir和--datadir參數設定存在問題
# chown -R root .
# chgrp -R mysql .
# chown -R mysql data/ cache/
5、配置啟動腳本
# cp share/mysql/mysql.server /etc/init.d/mysqld-ib
# vim /etc/init.d/mysqld-ib
設定預設配置檔案和程序使用者
[email protected][email protected]
[email protected][email protected]
修改為:
Shell代碼
conf=/etc/mysql-ib.cnf
user=mysql
加入開機啟動:
# vim /etc/rc.local
添加 /etc/init.d/mysqld-ib start
增加mysql client軟連結
# ln -s ./bin/mysql /usr/local/mysql-ib
6、啟動
/etc/init.d/mysqld-ib start
如果啟動失敗,檢視log_error指定的錯誤日志檔案
7、安裝過程中出現的錯誤
1)沒有設定boost動态連接配接庫路徑引
錯誤提示:
/usr/local/infobright/libexec/mysqld: error while loading shared libraries: libboost_filesystem.so.1.43.0: cannot open shared object file
啟動時沒有找到boost動态連接配接庫,設定LD_LIBRARY_PATH,以便程式加載運作時能夠自動找到需要的動态連結庫。
解決方案:
在/etc/profile中添加
export LD_LIBRARY_PATH=/usr/local/boost_1_43_0/lib:$LD_LIBRARY_PATH
或者在/etc/init.d/mysqld-ib中添加export LD_LIBRARY_PATH=/usr/local/boost_1_43_0/lib:$LD_LIBRARY_PATH
2)data、cache等目錄沒有設定mysql通路權限
錯誤提示:
/usr/local/infobright/libexec/mysqld: Table 'mysql.plugin' doesn't exist
131009 10:55:34 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
131009 10:55:34 [ERROR] Unable to load configuration
131009 10:55:34 [ERROR] ERROR: The configuration file brighthouse.ini not found
131009 10:55:34 [ERROR] Plugin 'BRIGHTHOUSE' init function returned error.
131009 10:55:34 [ERROR] Plugin 'BRIGHTHOUSE' registration as a STORAGE ENGINE failed.
131009 10:55:34 [ERROR] Failed to initialize plugins.
131009 10:55:34 [ERROR] Aborting
解決方案:
# cd /usr/local/infobright
# chown -R root .
# chgrp -R mysql .
# chown -R mysql data cache
參考
1、http://www.stamhe.com/?p=1028
2、http://www.mysqlsky.com/201110/infobright-setup-install-upgrade
3、http://blog.csdn.net/geekcoder/article/details/12571237