Altas 2.2.1 在 Ubuntu 14.04 LTS 下編譯安裝

Altas 2.2.1 & Ubuntu 14.04 LTS 安裝

==================================================================================================================================java

1. 安裝編譯及依賴環境


for mariadb

sudo apt-get install build-essential libssl-dev liblua5.1-0-dev libmariadbd-dev flex bison gettext libjemalloc-dev libglib2.0-dev

for mysql

sudo apt-get install build-essential libssl-dev liblua5.1-dev libmysqld-dev flex bison gettext libjemalloc-dev libglib2.0-dev

2. 補完其他依賴


wget https://launchpad.net/ubuntu/+archive/primary/+files/libevent_2.0.21-stable.orig.tar.gz
tar -zxvf libevent_2.0.21-stable.orig.tar.gz
cd libevent_2.0.21-stable
./configure && make
sudo make install

3. 針對configure LUA_LIBS 參數調整,創建軟連接 (重要


sudo -i
ln -s /usr/lib/x86_64-linux-gnu/liblua5.1.so.0.0.0 /usr/local/lib/liblua.so.0.0.0
ln -s /usr/lib/x86_64-linux-gnu/liblua5.1-c++.a /usr/local/lib/liblua-c++.a
ln -s /usr/lib/x86_64-linux-gnu/liblua5.1-c++.so.0 /usr/local/lib/liblua-c++.so.0
ln -s /usr/lib/x86_64-linux-gnu/liblua5.1.so.0 /usr/local/lib/liblua.so.0
ln -s /usr/lib/x86_64-linux-gnu/liblua5.1-c++.so /usr/local/lib/liblua-c++.so
ln -s /usr/lib/x86_64-linux-gnu/liblua5.1-c++.so.0.0.0 /usr/local/lib/liblua-c++.so.0.0.0
ln -s /usr/lib/x86_64-linux-gnu/liblua5.1.so /usr/local/lib/liblua.so
ln -s /usr/lib/x86_64-linux-gnu/liblua5.1.a /usr/local/lib/liblua.a
exit

4. 下載Atlas穩定版安裝包


wget -O Atlas-2.2.1.zip https://codeload.github.com/Qihoo360/Atlas/zip/2.2.1
unzip Atlas-2.2.1.zip
cd Atlas-2.2.1

5. 修改 bootstrap.sh LUA_CFLAGS 將 /usr/local/include/ 修改成 /usr/include/lua5.1/ (重要


sudo cat > bootstrap.sh <<-"EOF"
#!/bin/sh 
base=$(cd "$(dirname "$0")"; pwd)
cd $base
# PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --with-mysql=/usr --prefix=/usr/local/mysql-proxy CFLAGS="-DHAVE_LUA_H -O2" LDFLAGS="-lm -ldl -lcrypto -ljemalloc" LUA_CFLAGS="-I/usr/local/include/" LUA_LIBS="-L/usr/local/lib -llua"
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --with-mysql=/usr --prefix=/usr/local/mysql-proxy CFLAGS="-DHAVE_LUA_H -O2" LDFLAGS="-lm -ldl -lcrypto -ljemalloc" LUA_CFLAGS="-I/usr/include/lua5.1/" LUA_LIBS="-L/usr/local/lib -llua"

EOF

6. 編譯安裝 執行該步聚前,確認 第三、5步正確, 即 LUA_LIBS 與 LUA_CFLAGS 必須設置正確


./bootstrap.sh
make
sudo make install

更新:公司如今使用CENTOS 7 因此編譯了一個版本,並將默認的mysql版本號從5.0.81調整爲5.6.21解決JDBC下報java.sql.SQLException: Unknown system variable 'language'的問題,供須要的朋友們使用

猛擊:Atlas2.2.1-for-jdbc-fixed.tar.gz 注意MySQL5.0.X的直接使用官方版本便可mysql

相關文章
相關標籤/搜索