CentOSx64 安装 Gearmand 和 Gearman php扩展
2016-05-31 18:25
543 查看
1.首先下载所需软件
wget https://github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz
wget http://sourceforge.net/projects/re2c/files/re2c/0.13.5/re2c-0.13.5.tar.gz/download
wget https://launchpad.net/gearmand/1.2/1.1.6/+download/gearmand-1.1.6.tar.gz
wget http://pecl.php.net/get/gearman-1.1.1.tgz
wget http://ncu.dl.sourceforge.net/project/boost/boost/1.53.0/boost_1_53_0.zip
2.安装编译软件
tar zxvf libevent-2.0.20-stable.tar.gz
cd libevent-2.0.20-stable
./configure --prefix=/usr
make
make install
/sbin/ldconfig
unzip boost_1_53_0.zip
cd boost_1_53_0
./bootstrap.sh --prefix=/opt/local/boost-1.53
vi tools/build/v2/user-config.jam
在最后增加
using mpi
./b2
./b2 install
tar zxvf gearmand-1.1.6.tar.gz
cd gearmand-1.1.6
./configure --with-boost=/opt/local/boost-1.53
make
make install
/sbin/ldconfig
tar -zxvf re2c-0.13.5.tar.gz
cd re2c-0.13.5
./configure
make
make install
tar zxvf gearman-1.1.1.tgz
cd gearman-1.1.1
/opt/local/php/bin/phpize
./configure --with-php-config=/opt/local/php/bin/php-config --with-gearman
make
make install
3. 编辑 php.ini
vi php.ini
增加
extension = "gearman.so"
重启php
4. 启动gearmand 服务
gearmand -L 10.6.0.6 -p 4730 -u root -l /var/log/gearmand.log -d
其他参数请 gearmand --help
5. 一个监控的工具
wget https://nodeload.github.com/yugene/Gearman-Monitor/zip/master
ps:
错误.1
error: tr1/cinttypes: No such file or directory
yum install gcc44 gcc44-c++ libstdc++44-devel
export CC="gcc44"
export CXX="g++44"
错误.2
configure: error: Please install libgearman
export GEARMAN_LIB_DIR=/usr/include/libgearman
export GEARMAN_INC_DIR=/usr/include/libgearman
错误.3
libhostile/function.c: In function 'print_function_cache_usage':
libhostile/function.c:54: error: 'for' loop initial declarations are only allowed in C99 mode
libhostile/function.c:54: note: use option -std=c99 or -std=gnu99 to compile your code
那是因为 C++ 默认是用 c89 来编译的···需要更改成 c99 编译!
./configure 以后
vim Makefile
搜搜 CC
这里更改为
CC = gcc44 -std=c99
-------------------------------------------------------------------------------------
错误.4
collect2: ld returned 1 exit status
make[1]: *** [benchmark/blobslap_worker] Error 1
GOOGLE 解决办法
cd /opt/local/boost-1.53/lib
cp -rf * /usr/lib/;
cp -rf * /usr/lib64/;
ln -s /opt/local/boost-1.53/include/boost /usr/include/boost
-------------------------------------------------------------------------------------
错误.5
gearmand make 出现 sqlite3 的错误.. 找不到解决办法~只能在configure 里把 sqlite3 先关闭掉...
./configure --with-boost=/opt/local/boost-1.53 --with-sqlite3=no
wget https://github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz
wget http://sourceforge.net/projects/re2c/files/re2c/0.13.5/re2c-0.13.5.tar.gz/download
wget https://launchpad.net/gearmand/1.2/1.1.6/+download/gearmand-1.1.6.tar.gz
wget http://pecl.php.net/get/gearman-1.1.1.tgz
wget http://ncu.dl.sourceforge.net/project/boost/boost/1.53.0/boost_1_53_0.zip
2.安装编译软件
tar zxvf libevent-2.0.20-stable.tar.gz
cd libevent-2.0.20-stable
./configure --prefix=/usr
make
make install
/sbin/ldconfig
unzip boost_1_53_0.zip
cd boost_1_53_0
./bootstrap.sh --prefix=/opt/local/boost-1.53
vi tools/build/v2/user-config.jam
在最后增加
using mpi
./b2
./b2 install
tar zxvf gearmand-1.1.6.tar.gz
cd gearmand-1.1.6
./configure --with-boost=/opt/local/boost-1.53
make
make install
/sbin/ldconfig
tar -zxvf re2c-0.13.5.tar.gz
cd re2c-0.13.5
./configure
make
make install
tar zxvf gearman-1.1.1.tgz
cd gearman-1.1.1
/opt/local/php/bin/phpize
./configure --with-php-config=/opt/local/php/bin/php-config --with-gearman
make
make install
3. 编辑 php.ini
vi php.ini
增加
extension = "gearman.so"
重启php
4. 启动gearmand 服务
gearmand -L 10.6.0.6 -p 4730 -u root -l /var/log/gearmand.log -d
其他参数请 gearmand --help
5. 一个监控的工具
wget https://nodeload.github.com/yugene/Gearman-Monitor/zip/master
ps:
错误.1
error: tr1/cinttypes: No such file or directory
yum install gcc44 gcc44-c++ libstdc++44-devel
export CC="gcc44"
export CXX="g++44"
错误.2
configure: error: Please install libgearman
export GEARMAN_LIB_DIR=/usr/include/libgearman
export GEARMAN_INC_DIR=/usr/include/libgearman
错误.3
libhostile/function.c: In function 'print_function_cache_usage':
libhostile/function.c:54: error: 'for' loop initial declarations are only allowed in C99 mode
libhostile/function.c:54: note: use option -std=c99 or -std=gnu99 to compile your code
那是因为 C++ 默认是用 c89 来编译的···需要更改成 c99 编译!
./configure 以后
vim Makefile
搜搜 CC
这里更改为
CC = gcc44 -std=c99
-------------------------------------------------------------------------------------
错误.4
collect2: ld returned 1 exit status
make[1]: *** [benchmark/blobslap_worker] Error 1
GOOGLE 解决办法
cd /opt/local/boost-1.53/lib
cp -rf * /usr/lib/;
cp -rf * /usr/lib64/;
ln -s /opt/local/boost-1.53/include/boost /usr/include/boost
-------------------------------------------------------------------------------------
错误.5
gearmand make 出现 sqlite3 的错误.. 找不到解决办法~只能在configure 里把 sqlite3 先关闭掉...
./configure --with-boost=/opt/local/boost-1.53 --with-sqlite3=no
相关文章推荐
- Varnish CentOS 6.4 x64
- CentOS 6.4 x64 Cacti 监控安装配置
- CentOS 5.8 x64 源码安装 samba-3.6.9
- Linux:正则扩展
- Linux如何修改密码
- CentOS x 64 MooseFS 学习
- 技巧:Linux 动态库与静态库制作及使用详解
- linux常用命令
- Linux基本命令
- ubuntu下svn+svnmanager搭建
- Centos rsync文件同步配置
- linux定时任务
- linux下利用curl监控web应用状态
- 【linux】umask
- 【Linux运维入门】PSSH-轻量集群管理工具
- 解决android系统唤醒时间偏长------如何在android的linux kernel中获取系统时间
- Linux下gcc生成和使用静态库和动态库详解
- Linux _常用命令使用(二)
- linux split 及优化
- CentOS 6.4 搭建 Java 开发环境详解