wget https://sourceforge.net/projects/repcached/files/repcached/2.2.1-1.2.8/memcached-1.2.8-repcached-2.2.1.tar.gz tar zxf memcached-1.2.8-repcached-2.2.1.tar.gz cd memcached-1.2.8-repcached-2.2.1 ./configure --enable-replication make && make install
备注: 如make安装错误,提示 memcached.c: In function 'add_iov': memcached.c:697: error: 'IOV_MAX' undeclared (first use in this function) memcached.c:697: error: (Each undeclared identifier is reported only once memcached.c:697: error: for each function it appears in.)
[root@public01 ~]# memcached -help memcached 1.2.8 repcached 2.2.1 -p <num> TCP port number to listen on (default: 11211) -U <num> UDP port number to listen on (default: 11211, 0 is off) -s <file> unix socket path to listen on (disables network support) -a <mask> access mask for unix socket, in octal (default 0700) -l <ip_addr> interface to listen on, default is INDRR_ANY -d run as a daemon -r maximize core file limit -u <username> assume identity of <username> (only when run as root) -m <num> max memory to use for items in megabytes, default is 64 MB -M return error on memory exhausted (rather than removing items) -c <num> max simultaneous connections, default is 1024 -k lock down all paged memory. Note that there is a limit on how much memory you may lock. Trying to allocate more than that would fail, so be sure you set the limit correctly for the user you started the daemon with (not for -u <username> user; under sh this is done with 'ulimit -S -l NUM_KB'). -v verbose (print errors/warnings while in event loop) -vv very verbose (also print client commands/reponses) -h print this help and exit -i print memcached and libevent license -P <file> save PID in <file>, only used with -d option -f <factor> chunk size growth factor, default 1.25 -n <bytes> minimum space allocated for key+value+flags, default 48 -R Maximum number of requests per event limits the number of requests process for a given con nection to prevent starvation. default 20 -b Set the backlog queue limit (default 1024) -x <ip_addr> hostname or IP address of peer repcached -X <num:num> TCP port number for replication. <listen:connect> (default: 11212)