[jifeng@jifeng04 ~]$ tar zxf memcached-1.4.20.tar.gz [jifeng@jifeng04 ~]$ cd memcached-1.4.20 [jifeng@jifeng04 memcached-1.4.20]$ ./configure --with-libevent=/usr checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for icc in use... no checking for clang in use... no checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking whether __SUNPRO_C is declared... no checking for gcc option to accept ISO C99... -std=gnu99 checking whether gcc -std=gnu99 and cc understand -c and -o together... yes checking sasl/sasl.h usability... no checking sasl/sasl.h presence... no checking for sasl/sasl.h... no checking for gcov... /usr/bin/gcov checking for main in -lgcov... yes checking for library containing clock_gettime... -lrt checking for library containing socket... none required checking for library containing gethostbyname... none required checking for libevent directory... /usr checking for library containing umem_cache_create... no checking for library containing gethugepagesizes... no checking for stdbool.h that conforms to C99... yes checking for _Bool... yes checking for inttypes.h... (cached) yes checking for sasl_callback_ft... no checking for print macros for integers (C99 section 7.8.1)... yes checking for an ANSI C-conforming const... yes checking for socklen_t... yes checking for endianness... little checking for htonll... no checking for library containing pthread_create... none required checking for mlockall... yes checking for getpagesizes... no checking for memcntl... no checking for sigignore... yes checking for clock_gettime... yes checking for accept4... yes checking for alignment... need checking for GCC atomics... yes checking for setppriv... no checking umem.h usability... no checking umem.h presence... no checking for umem.h... no checking for xml2rfc... no checking for xsltproc... no configure: creating ./config.status config.status: creating Makefile config.status: creating doc/Makefile config.status: creating config.h config.status: executing depfiles commands [jifeng@jifeng04 memcached-1.4.20]$make [root@jifeng04 memcached-1.4.20]$make install
启动时出现“memcached: error while loading shared libraries:libevent-2.0.so.5: cannot
open shared object file: No such file or directory”之类的信息,表示memcached 找不到[jifeng@jifeng04 memcached-1.4.20]$ ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5 ln: 创建符号链接 "/usr/lib/libevent-2.0.so.5": 权限不够 [jifeng@jifeng04 memcached-1.4.20]$ su - 密码: [root@jifeng04 ~]# ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5 [root@jifeng04 ~]# exit logout
3:启动memcached
[jifeng@jifeng04 memcached-1.4.20]$ /usr/local/bin/memcached -d -m 1024 -l 10.3.7.215 -p 11211 [jifeng@jifeng04 memcached-1.4.20]$
[jifeng@jifeng03 ~]$ echo stats | nc 10.3.7.215 11211 STAT pid 14279 STAT uptime 79957 STAT time 1407767792 STAT version 1.4.20 STAT libevent 2.0.21-stable STAT pointer_size 64 STAT rusage_user 1.392788 STAT rusage_system 0.910861 STAT curr_connections 5 STAT total_connections 7 STAT connection_structures 6 STAT reserved_fds 20 STAT cmd_get 2 STAT cmd_set 0 STAT cmd_flush 0 STAT cmd_touch 0 STAT get_hits 0 STAT get_misses 2 STAT delete_misses 0 STAT delete_hits 0 STAT incr_misses 0 STAT incr_hits 0 STAT decr_misses 0 STAT decr_hits 0 STAT cas_misses 0 STAT cas_hits 0 STAT cas_badval 0 STAT touch_hits 0 STAT touch_misses 0 STAT auth_cmds 0 STAT auth_errors 0 STAT bytes_read 22 STAT bytes_written 10 STAT limit_maxbytes 1073741824 STAT accepting_conns 1 STAT listen_disabled_num 0 STAT threads 4 STAT conn_yields 0 STAT hash_power_level 16 STAT hash_bytes 524288 STAT hash_is_expanding 0 STAT malloc_fails 0 STAT bytes 0 STAT curr_items 0 STAT total_items 0 STAT expired_unfetched 0 STAT evicted_unfetched 0 STAT evictions 0 STAT reclaimed 0 STAT crawler_reclaimed 0 END