安装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. tomcat配置访问日志,访问首页主目录

    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" ...

  2. windows 基于命令行制作vhd虚拟磁盘

    什么是VHD? VHD是Virtual Hard Disk的简称,就是虚拟硬盘,就是能把VHD文件直接虚拟成一个硬盘,在其中能像真实硬盘一样操作,读取.写入.创建分区.格式化.如果你用过虚拟机,就会知 ...

  3. curl 浏览器模拟请求实战

    1,curl 常用选项

  4. mongoDB 在windows平台下安装成系统服务

    1,用如截图所示命令将mongoDB安装成windows系统服务,byRuiy Tips[Note,logpath and dbpath根据你命令行指导的路径,这些目录一定要已经创建]

  5. error LNK2001

    error LNK2001: 无法解析的外部符号 "public: virtual void __cdecl Observer::update(float,float,float)" ...

  6. 在国内使用cnpm代替npm

    npm是Node.js的模块依赖管理工具,由于使用npm安装包是从国外服务器下载,在国内很容易受到网络的影响,速度非常慢,因此可以选用cnpm.cnpm可以使用淘宝团队提供的淘宝npm镜像,你可以用此 ...

  7. Swift的基础,操作符,字符串和集合类型

    这篇文章主要讲解苹果Swift官方指南的第二章前四节的要点内容,如果想看完整的英文文档可以去苹果开发者页面下载. Basic 声明常量let 声明变量var 注释依旧使用"//" ...

  8. Android Audio System 之一:AudioTrack如何与AudioFlinger

    Android Framework的音频子系统中,每一个音频流对应着一个AudioTrack类的一个实例,每个AudioTrack会在创建时注册到 AudioFlinger中,由AudioFlinge ...

  9. JavaScript鼠标事件,点击鼠标右键,弹出div

    document.oncontextmenu = function(){return false}; //禁止鼠标右键菜单显示 var res = document.getElementById('b ...

  10. linux学习笔记之套接字

    一.基础知识. 1:套接字基础. 1,是通信端点的抽象. 2,在UNIX类系统中被当作是一种文件描述符. 3,套接字通信域. 域 描述 AF_INET IPV4因特网域 AF_INET6 IPV6因特 ...