10/29/13

MySQL中间件 Atlas-1.0.3 安装记录

1、wget https://github.com/Qihoo360/Atlas/archive/1.0.3.tar.gz -o Atlas-1.0.3.tar.gz

2、tar zxvf Atlas-1.0.3.tar.gz

3、cd Atlas-1.0.3

4、vim bootstrap.sh

#!/bin/sh
base=$(cd “$(dirname “$0″)”; pwd)
cd $base
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure –with-mysql=/opt/phpdba/mysql/bin/mysql_config –prefix=/opt/phpdba/atlas_mysql_proxy CFLAGS=”-DHAVE_LUA_H -O2″ LDFLAGS=”-lm -ldl -lcrypto” LUA_CFLAGS=”-I/usr/local/include/” LUA_LIBS=”-L/usr/local/lib -llua”

5、./bootstrap.sh glib版本低,升级之

checking for GLIB… configure: error: Package requirements (glib-2.0 >= 2.32.0) were not met:

Requested ‘glib-2.0 >= 2.32.0′ but version of GLib is 2.22.5

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

6、升级glib

a、wget http://ftp.gnome.org/pub/gnome/sources/glib/2.36/glib-2.36.3.tar.xz

b、xz -d glib-2.36.3.tar.xz && tar xvf glib-2.36.3.tar

c、cd glib-2.36.3 &&  ./configure && make

保存信息:

/root/chen-123/glib-2.36.3/missing: line 81: automake-1.13: command not found
WARNING: ‘automake-1.13′ is missing on your system.
You should only need it if you modified ‘Makefile.am’ or
‘configure.ac’ or m4 files included by ‘configure.ac’.
The ‘automake’ program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make[4]: *** [Makefile.in] 错误 127
make[4]: Leaving directory `/root/chen-123/glib-2.36.3/docs/reference/glib’
make[3]: *** [all-recursive] 错误 1
make[3]: Leaving directory `/root/chen-123/glib-2.36.3/docs/reference’
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/root/chen-123/glib-2.36.3/docs’
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/root/chen-123/glib-2.36.3′
make: *** [all] 错误 2

d、wget http://ftp.gnu.org/gnu/automake/automake-1.13.3.tar.gz  &&  tar zxvf  automake-1.13.3.tar.gz  && cd automake-1.13.3 &&  ./configure

错误信息:

checking whether autoconf is recent enough… no
configure: error: Autoconf 2.65 or better is required.

e、wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz && tar zxvf  autoconf-2.69.tar.gz && cd autoconf-2.69 && ./configure && make && make install

f、cd automake-1.13.3 && ./configure && make   &&make install

g、cd glib-2.36.3 &&  ./configure && make

报错:

configure.ac:66: error: version mismatch.  This is Automake 1.13.3,
configure.ac:66: but the definition used by this AM_INIT_AUTOMAKE
configure.ac:66: comes from Automake 1.13.2.  You should recreate
configure.ac:66: aclocal.m4 with aclocal and run automake again.
gtk-doc.make:32: warning: EXTRA_DIST multiply defined in condition TRUE …
docs/reference/glib/Makefile.am:85:   ‘gtk-doc.make’ included from here
Makefile.decl:8: … ‘EXTRA_DIST’ previously defined here
docs/reference/glib/Makefile.am:2:   ‘Makefile.decl’ included from here
WARNING: ‘automake-1.13′ is probably too old.

h、cd automake-1.13.3 &&  make uninstall  && wget http://ftp.gnu.org/gnu/automake/automake-1.13.2.tar.gz  &&  tar zxvf  automake-1.13.2.tar.gz  && cd automake-1.13.2 &&  ./configure && make && make install

i、cd glib-2.36.3 &&  ./configure && make && make install

7、cd Atlas-1.0.3  &&  ./bootstrap.sh && make && make install    安装完成

10/16/13

mysql-proxy 安装记录

1、tar zxvf mysql-proxy-0.8.3.tar.gz
2、cd mysql-proxy-0.8.3
3、./configure –prefix=/opt/phpdba/mysql-proxy
configure: error: mysql_config is not found, use $ ./configure –with-mysql=/path/to/mysql_config【mysql 安装没配置系统环境变量】
4、 ./configure –prefix=/opt/phpdba/mysql-proxy –with-mysql=/opt/phpdba/mysql/bin/mysql_config
checking for LUA… no
… checked for Lua via pkg-config: No package ‘lua’ found. retrying with lua5.1
checking for LUA… no
configure: error: checked for Lua via pkg-config: No package ‘lua5.1′ found. Make sure lua and its devel-package, which includes the lua5.1.pc (debian and friends) or lua.pc (all others) file, is installed
5、安装lua 5.1
tar zxvf lua-5.1.5.tar.gz
cd lua-5.1.5
make linux
在包含自 lua.h:16 的文件中,
从 lua.c:15:
luaconf.h:275:31: 错误:readline/readline.h:没有那个文件或目录
luaconf.h:276:30: 错误:readline/history.h:没有那个文件或目录
lua.c: 在函数‘pushline’中:
lua.c:182: 警告:隐式声明函数‘readline’
lua.c:182: 警告:赋值时将整数赋给指针,未作类型转换
lua.c: 在函数‘loadline’中:
lua.c:210: 警告:隐式声明函数‘add_history’

yum -y install readline
yum -y install readline-devel
make linux
make linux install
6、重新编译mysql-proxy
checking for LUA… no
… checked for Lua via pkg-config: No package ‘lua’ found. retrying with lua5.1
checking for LUA… no
configure: error: checked for Lua via pkg-config: No package ‘lua5.1′ found. Make sure lua and its devel-package, which includes the lua5.1.pc (debian and friends) or lua.pc (all others) file, is installed

export LUA_CFLAGS=”-I/usr/local/include”
export LUA_LIBS=”-L/usr/local/lib -llua -ldl”
7、make
/usr/bin/ld: /usr/local/lib/liblua.a(lapi.o): relocation R_X86_64_32 against `luaO_nilobject_’ can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/liblua.a: could not read symbols: Bad value
8、重新编译lua

make clean
cd src/

修改Makefile 中CFLAGS 添加 -fPIC

9、cd mysql-proxy-0.8.3 ;make
./.libs/libmysql-chassis.so: undefined reference to `sqrt’
./.libs/libmysql-chassis.so: undefined reference to `floor’
./.libs/libmysql-chassis.so: undefined reference to `ceil’
./.libs/libmysql-chassis.so: undefined reference to `cosh’
./.libs/libmysql-chassis.so: undefined reference to `tan’
./.libs/libmysql-chassis.so: undefined reference to `tanh’
./.libs/libmysql-chassis.so: undefined reference to `asin’
./.libs/libmysql-chassis.so: undefined reference to `log’
./.libs/libmysql-chassis.so: undefined reference to `atan’
./.libs/libmysql-chassis.so: undefined reference to `sinh’
./.libs/libmysql-chassis.so: undefined reference to `fmod’
./.libs/libmysql-chassis.so: undefined reference to `acos’
./.libs/libmysql-chassis.so: undefined reference to `exp’
./.libs/libmysql-chassis.so: undefined reference to `sin’
./.libs/libmysql-chassis.so: undefined reference to `pow’
./.libs/libmysql-chassis.so: undefined reference to `atan2′
./.libs/libmysql-chassis.so: undefined reference to `cos’
./.libs/libmysql-chassis.so: undefined reference to `log10′

10、重新编译
./configure –prefix=/opt/phpdba/mysql-proxy –with-mysql=/opt/phpdba/mysql/bin/mysql_config CFLAGS=-g LIBS=-lm
make && make install
安装成功!