安装magent到/usr/local/下



cd /usr/local

mkdir magent

cd magent/

wget http://memagent.googlecode.com/files/magent-0.6.tar.gz

tar zxvf magent-0.6.tar.gz

/sbin/ldconfig

sed -i "s#LIBS = -levent#LIBS = -levent -lm#g" Makefile

make



错误1:



    gcc -lrt -Wall -g -O2 -I/usr/local/include -m64 -c -o magent.o magent.c

    magent.c: In function ‘writev_list’:

    magent.c:729: error: ‘SSIZE_MAX’ undeclared (first use in this function)

    magent.c:729: error: (Each undeclared identifier is reported only once

    magent.c:729: error: for each function it appears in.)

    make: *** [magent.o] Error 1



解决的方法:

vi ketama.h



在开头增加

   

#ifndef SSIZE_MAX

# define SSIZE_MAX      32767

#endif



错误2:



    gcc -Wall -g -O2 -I/usr/local/include -m64 -c -o magent.o magent.c

    gcc -Wall -g -O2 -I/usr/local/include -m64 -c -o ketama.o ketama.c

    gcc -Wall -g -O2 -I/usr/local/include -m64 -o magent magent.o ketama.o /usr/lib64/libevent.a /usr/lib64/libm.a

    /usr/lib64/libevent.a(event.o): In function `gettime’:

    (.text+0×449): undefined reference to `clock_gettime’

    /usr/lib64/libevent.a(event.o): In function `event_base_new’:

    (.text+0x72a): undefined reference to `clock_gettime’

    collect2: ld returned 1 exit status

    make: *** [magent] Error 1



解决的方法

vim Makefile

   

CFLAGS = -Wall -g -O2 -I/usr/local/include $(M64)

改为:   

CFLAGS = -lrt -Wall -g -O2 -I/usr/local/include $(M64)



错误3:centos 6



[root@test magent]# make

gcc -Wall -g -O2 -I/usr/local/include -m64 -c -o magent.o magent.c

gcc -Wall -g -O2 -I/usr/local/include -m64 -c -o ketama.o ketama.c

gcc -Wall -g -O2 -I/usr/local/include -m64 -o magent magent.o ketama.o /usr/lib64/libevent.a /usr/lib64/libm.a

gcc: /usr/lib64/libm.a:没有那个文件或文件夹

make: *** [magent] 错误 1

解决的方法



ln -s /usr/lib64/libm.so /usr/lib64/libm.a

注:有可能还会报错 gcc: /usr/lib64/libevent.a: 没有那个文件或文件夹

假设有,可运行

vi Makefile



找到 LIBS = /usr/lib64/libevent.a /usr/lib64/libm.a

改动 LIBS = /usr/libevent 的安装路径/libevent.a /usr/lib64/libm.a

例: LIBS = /usr/lib/libevent.a /usr/lib64/libm.a

查看magent是否成功安装

cd usr/bin/magent ./magent



please provide -s "ip:port" argument

 

memcached agent v0.6 Build-Date: Oct 15 2012 16:12:30

Usage:

  -h this message

  -u uid

  -g gid

  -p port, default is 11211. (0 to disable tcp support)

  -s ip:port, set memcached server ip and port

  -b ip:port, set backup memcached server ip and port

  -l ip, local bind ip address, default is 0.0.0.0

  -n number, set max connections, default is 4096

  -D don't go to background

  -k use ketama key allocation algorithm

  -f file, unix socket path to listen on. default is off

  -i number, set max keep alive connections for one memcached server, default is 20

  -v verbose

magent编译安装及常见错误的更多相关文章

  1. PHP编译安装时常见错误解决办法,php编译常见错误

    PHP编译安装时常见错误解决办法,php编译常见错误 1.configure: error: xslt-config not found. Please reinstall the libxslt & ...

  2. 编译安装Heartbeat常见错误

    -----------那些需要升级包还有少包的错误就不写了---------- <b>1</b>. Reusable-Cluster-Components-glue-glue- ...

  3. Lnmp 源码编译安装、常见错误整理

    简介: Lnmp 环境的搭建还是非常简单的,之前由于博客迁移等原因,导致丢失了好多博文,这次重新整理记录一下. Lnmp 即:Linux .Nginx .Mysql .PHP Lnmp 是一套 Web ...

  4. 7.2.*PHP编译安装时常见错误解决办法,php编译常见错误

    configure: error: Cannot find ldap.h   检查下面是不是已经安装,如果没有安装之:检查:yum list openldapyum list openldap-dev ...

  5. 【转】ubuntu源码编译安装php常见错误解决办法

    ./configure -prefix=/usr/local/php -with-config-file-path=/etc -with-mysql=mysqlnd -with-mysqli=mysq ...

  6. PHP编译安装时常见错误及解决办法,大全

    1.   configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution ...

  7. linux编译安装时常见错误解决办法

    This article is post on https://coderwall.com/p/ggmpfa 原文链接:http://www.bkjia.com/PHPjc/1008013.html ...

  8. CentOS编译安装PHP常见错误及解决办法

    1.configure: error: No curses/termcap library found yum -y install ncurses-devel 2.configure: error: ...

  9. PHP编译安装时常见错误解决办法

    转载自:http://www.bkjia.com/PHPjc/1008013.html This article is post on https://coderwall.com/p/ggmpfa c ...

随机推荐

  1. HDU1506(单调栈或者DP) 分类: 数据结构 2015-07-07 23:23 2人阅读 评论(0) 收藏

    Largest Rectangle in a Histogram Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 ...

  2. ※数据结构※→☆非线性结构(tree)☆============二叉树 顺序存储结构(tree binary sequence)(十九)

    二叉树 在计算机科学中,二叉树是每个结点最多有两个子树的有序树.通常子树的根被称作“左子树”(left subtree)和“右子树”(right subtree).二叉树常被用作二叉查找树和二叉堆或是 ...

  3. jQuery 局部div刷新和全局刷新方法

    div的局部刷新 $(".dl").load(location.href+".dl");  全页面的刷新方法 window.location.reload( ) ...

  4. PHP 9 大缓存技术总结

    1.全页面静态化缓存 也就是将页面全部生成html静态页面,用户访问时直接访问的静态页面,而不会去走php服务器解析的流程.此种方式,在CMS系统中比较常见,比如dedecms: 一种比较常用的实现方 ...

  5. 树的直径 poj 2631

    树的直径:从随意一点出发,BFS找到最远的距离,然后在从该点出发BFS找到最远的距离 #include <iostream> #include <algorithm> #inc ...

  6. 使用disqus搭建comment时一件非常二的事

    近期在github 上面搭建自己的博客,搭建comment部分的时候出现了一个问题:配置都配置好了,可是comment就是不成功.昨天为这个问题折腾了了半晚上没找出原因,今天晚上我突然发现一个地方设置 ...

  7. oracle ORA_ROWSCN 行记录的更新时间

    在这介绍两个oracle 10G开始提供的一个伪列ORA_ROWSCN,它又分为两种模式一种是基于block,这是默认的模式,还有一种是基于row上,这种模式只能在建里表时指定ROWDEPENDENC ...

  8. VLC各个Module模块之间共享变量的实现方法

    在做VLC开发的时候,想使用一个模块访问另外一个模块的数据, 比如在网络模块得到了一些数据,想在其他模块得到这些数据进行处理,这时候就需要两个模块共享一些变量. 查看VLC的源码,发现VLC专门有va ...

  9. jQuery——AJAX(一)

    jQuery.ajax(options):通过HTTP请求加载远程数据, 参数:options(可选),ajax请求设置.所有选项都是可选的. 返回值:XMLHttpRequest function ...

  10. NPOI兼容 excel2003,2007版本

    根据项目需要,需要对excel进行导入导出,所以选择NPOI,优点在这里就不详细介绍了,下面进入正题. public int Import(string path) { IList<Studen ...