安装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. cc150 Chapter 2 | Linked Lists 2.6 Given a circular linked list, implement an algorithm which returns node at the beginning of the loop.

    2.6Given a circular linked list,  implement an algorithm which returns the node at the beginning of ...

  2. 【转】V4L2+swscale+X264+live555实现流媒体服务端

    写这边博客,一方面是因为自己在做项目的时候不太做笔记,怕以后自己忘记了.另一方面,是让正在寻求资料的同行少走一点弯路吧.不能说我这个方案怎么的好,至少是有一点参考价值的.这边博客需要一定基础才能看明白 ...

  3. PHP MySQL Where 子句 之Where

    WHERE 子句 如需选取匹配指定条件的数据,请向 SELECT 语句添加 WHERE 子句. 语法 SELECT column FROM table WHERE column operator va ...

  4. php使用PDO方法详解

    PDO::exec:返回的是int类型,表示影响结果的条数. 复制代码 代码如下: PDOStatement::execute 返回的是boolean型,true表示执行成功,false表示执行失败, ...

  5. 求斐波那契数列的第n项

    问题描述:斐波那契数列是这样的一个数列,1,1,2,3,5,8,..,即前两项都是1,后面每一项都是其前面两项的和. 现在要你求出该数列的第n项. 分析:该问题是一个经典的数列问题,相信大家在很多语言 ...

  6. 物理机与虚拟机IP互ping通,而互ping主机名不通

    问题描述:虚拟机信息:VMware-workstation 10安装RHEL5.8操作系统.hostname:rhel201.com IP:192.168.1.201 物理机系统:windows 7主 ...

  7. apache 限制指定user_agent

    有些user_agent 不是我们想要的,可以通过rewrite功能针对 %{HTTP_USER_AGENT} 来rewirete到404页,从而达到限制某些user_agent的请求.   配置如下 ...

  8. js执行环境深入研究

    js 声明函数是创建函数对象的过程,当创建函数对象时,函数对象的[[scope]] =连当前执行环境对象的作用域(栈顶执行环境--当执行函数时,js会将该函数的执行环境对象入栈) 当为全局函数时,如: ...

  9. EntityFramework1

    1.ORM都是Select * ,即使不需要某些字段,也要查询出来,效率是否很低. 可以使用视图来解决,比如对于列表页,可以定义一个视图,只查询列表中需要使用的字段,然后将列表映射为实体 2.ORM中 ...

  10. JS局部打印两种方法

    所有浏览器都可以 <html> <head title=""> <title>测试打印</title> <style medi ...