ubuntu 15.10 安装 Memcache
1, Memcached需要libevent支持,安装libevent。
Debian/Ubuntu:
sudo apt-get install libevent-dev
Redhat/Centos:
sudo yum install libevent-devel
2, 下载 Memcached 编译安装。
官方网址:http://memcached.org/downloads
wget http://memcached.org/latest (将 latest改为最新稳定版,实例如下) wget http://memcached.org/files/memcached-1.4.31.tar.gz tar -zxvf memcached-1.x.x.tar.gz cd memcached-1.x.x ./configure && make && make test && sudo make install
3,命令行下启动
memcached -d -m 128 -u root -l 127.0.0.1 -p 11211 -c 1024 -P
说明一下memcached服务的启动参数:
-p 监听的端口
-l 连接的IP地址, 默认是本机
-d start 启动memcached服务
-d restart 重起memcached服务
-d stop|shutdown 关闭正在运行的memcached服务
-d install 安装memcached服务
-d uninstall 卸载memcached服务
-u 以的身份运行 (仅在以root运行的时候有效)
-m 最大内存使用,单位MB。默认64MB
-M 内存耗尽时返回错误,而不是删除项
-c 最大同时连接数,默认是1024
-f 块大小增长因子,默认是1.25-n 最小分配空间,key+value+flags默认是48
-h 显示帮助
启动/结束
memcached -d -m 10 -u root -l 192.168.0.122 -p 11200 -c 256 -P /tmp/memcached.pid
-d 选项是启动一个守护进程,
-m 是分配给Memcache使用的内存数量,单位是MB,这里是10MB
-u 是运行Memcache的用户,这里是root
-l 是监听的服务器IP地址,如果有多个地址的话,这里指定了服务器的IP地址192.168.0.122
-p 是设置Memcache监听的端口,这里设置了12000,最好是1024以上的端口
-c 选项是最大运行的并发连接数,默认是1024,这里设置了256,按照你服务器的负载量来设定
-P 是设置保存Memcache的pid文件
kill `cat /tmp/memcached.pid`
获取运行状态
echo stats | nc 127.0.0.1 11211
watch "echo stats | nc 127.0.0.1 11211" (实时状态)
4,命令行下连接/断开
连接: $ telnet 127.0.0.1 11211 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. 按 “ctrl + ]”进入 telnet> 断开: telnet> quit Connection closed.
5, php测试
$mem = new Memcache; $mem->connect("127.0.0.1", 11211); $mem->set('key', 'This is a memcached test!', 0, 60); $val = $mem->get('key'); echo $val;
xin@xin-VirtualBox:/var/www/memcached-1.4.31$ make test
./sizes
Slab Stats 64
Thread stats -8528
Global stats 160
Settings 208
Item (no cas) 48
Item (cas) 56
Libevent thread 184
Connection 520
----------------------------------------
libevent thread cumulative 4456
Thread stats cumulative 4272
./testapp
1..52
ok 1 - cache_create
ok 2 - cache_constructor
ok 3 - cache_constructor_fail
ok 4 - cache_destructor
ok 5 - cache_reuse
ok 6 - cache_redzone
ok 7 - issue_161
ok 8 - strtol
ok 9 - strtoll
ok 10 - strtoul
ok 11 - strtoull
ok 12 - issue_44
ok 13 - vperror
ok 14 - issue_101
Signal handled: Terminated.
ok 15 - start_server
ok 16 - issue_92
ok 17 - issue_102
ok 18 - binary_noop
ok 19 - binary_quit
ok 20 - binary_quitq
ok 21 - binary_set
ok 22 - binary_setq
ok 23 - binary_add
ok 24 - binary_addq
ok 25 - binary_replace
ok 26 - binary_replaceq
ok 27 - binary_delete
ok 28 - binary_deleteq
ok 29 - binary_get
ok 30 - binary_getq
ok 31 - binary_getk
ok 32 - binary_getkq
ok 33 - binary_gat
ok 34 - binary_gatq
ok 35 - binary_gatk
ok 36 - binary_gatkq
ok 37 - binary_incr
ok 38 - binary_incrq
ok 39 - binary_decr
ok 40 - binary_decrq
ok 41 - binary_version
ok 42 - binary_flush
ok 43 - binary_flushq
ok 44 - binary_append
ok 45 - binary_appendq
ok 46 - binary_prepend
ok 47 - binary_prependq
ok 48 - binary_stat
ok 49 - binary_illegal
ok 50 - binary_pipeline_hickup
Signal handled: Interrupt.
ok 51 - shutdown
ok 52 - stop_server
prove ./t
t/00-startup.t .............. 1/20 getaddrinfo(): Name or service not known
failed to listen on TCP port 40389: Success
t/00-startup.t .............. 13/20 slab class 1: chunk size 96 perslab 10922
slab class 2: chunk size 120 perslab 8738
slab class 3: chunk size 152 perslab 6898
slab class 4: chunk size 192 perslab 5461
slab class 5: chunk size 240 perslab 4369
slab class 6: chunk size 304 perslab 3449
slab class 7: chunk size 384 perslab 2730
slab class 8: chunk size 480 perslab 2184
slab class 9: chunk size 600 perslab 1747
slab class 10: chunk size 752 perslab 1394
slab class 11: chunk size 944 perslab 1110
slab class 12: chunk size 1184 perslab 885
slab class 13: chunk size 1480 perslab 708
slab class 14: chunk size 1856 perslab 564
slab class 15: chunk size 2320 perslab 451
slab class 16: chunk size 2904 perslab 361
slab class 17: chunk size 3632 perslab 288
slab class 18: chunk size 4544 perslab 230
slab class 19: chunk size 5680 perslab 184
slab class 20: chunk size 7104 perslab 147
slab class 21: chunk size 8880 perslab 118
slab class 22: chunk size 11104 perslab 94
slab class 23: chunk size 13880 perslab 75
slab class 24: chunk size 17352 perslab 60
slab class 25: chunk size 21696 perslab 48
slab class 26: chunk size 27120 perslab 38
slab class 27: chunk size 33904 perslab 30
slab class 28: chunk size 42384 perslab 24
slab class 29: chunk size 52984 perslab 19
slab class 30: chunk size 66232 perslab 15
slab class 31: chunk size 82792 perslab 12
slab class 32: chunk size 103496 perslab 10
slab class 33: chunk size 129376 perslab 8
slab class 34: chunk size 161720 perslab 6
slab class 35: chunk size 202152 perslab 5
slab class 36: chunk size 252696 perslab 4
slab class 37: chunk size 315872 perslab 3
slab class 38: chunk size 394840 perslab 2
slab class 39: chunk size 493552 perslab 2
slab class 40: chunk size 616944 perslab 1
slab class 41: chunk size 771184 perslab 1
slab class 42: chunk size 1048576 perslab 1
<26 server listening (auto-negotiate)
<27 server listening (auto-negotiate)
<28 send buffer was 212992, now 268435456
<32 send buffer was 212992, now 268435456
<31 server listening (udp)
<35 server listening (udp)
<30 server listening (udp)
<34 server listening (udp)
<29 server listening (udp)
<33 server listening (udp)
<28 server listening (udp)
<32 server listening (udp)
<36 new auto-negotiating client connection
<36 connection closed.
slab class 1: chunk size 96 perslab 10922
slab class 2: chunk size 120 perslab 8738
slab class 3: chunk size 152 perslab 6898
slab class 4: chunk size 192 perslab 5461
slab class 5: chunk size 240 perslab 4369
slab class 6: chunk size 304 perslab 3449
slab class 7: chunk size 384 perslab 2730
slab class 8: chunk size 480 perslab 2184
slab class 9: chunk size 600 perslab 1747
slab class 10: chunk size 752 perslab 1394
slab class 11: chunk size 944 perslab 1110
slab class 12: chunk size 1184 perslab 885
slab class 13: chunk size 1480 perslab 708
slab class 14: chunk size 1856 perslab 564
slab class 15: chunk size 2320 perslab 451
slab class 16: chunk size 2904 perslab 361
slab class 17: chunk size 3632 perslab 288
slab class 18: chunk size 4544 perslab 230
slab class 19: chunk size 5680 perslab 184
slab class 20: chunk size 7104 perslab 147
slab class 21: chunk size 8880 perslab 118
slab class 22: chunk size 11104 perslab 94
slab class 23: chunk size 13880 perslab 75
slab class 24: chunk size 17352 perslab 60
slab class 25: chunk size 21696 perslab 48
slab class 26: chunk size 27120 perslab 38
slab class 27: chunk size 33904 perslab 30
slab class 28: chunk size 42384 perslab 24
slab class 29: chunk size 52984 perslab 19
slab class 30: chunk size 66232 perslab 15
slab class 31: chunk size 82792 perslab 12
slab class 32: chunk size 103496 perslab 10
slab class 33: chunk size 129376 perslab 8
slab class 34: chunk size 161720 perslab 6
slab class 35: chunk size 202152 perslab 5
slab class 36: chunk size 252696 perslab 4
slab class 37: chunk size 315872 perslab 3
slab class 38: chunk size 394840 perslab 2
slab class 39: chunk size 493552 perslab 2
slab class 40: chunk size 616944 perslab 1
slab class 41: chunk size 771184 perslab 1
slab class 42: chunk size 1048576 perslab 1
<26 server listening (ascii)
<27 server listening (ascii)
<28 send buffer was 212992, now 268435456
<32 send buffer was 212992, now 268435456
<31 server listening (udp)
<35 server listening (udp)
<30 server listening (udp)
<34 server listening (udp)
<29 server listening (udp)
<33 server listening (udp)
<28 server listening (udp)
<32 server listening (udp)
slab class 1: chunk size 96 perslab 10922
slab class 2: chunk size 120 perslab 8738
slab class 3: chunk size 152 perslab 6898
slab class 4: chunk size 192 perslab 5461
slab class 5: chunk size 240 perslab 4369
slab class 6: chunk size 304 perslab 3449
slab class 7: chunk size 384 perslab 2730
slab class 8: chunk size 480 perslab 2184
slab class 9: chunk size 600 perslab 1747
slab class 10: chunk size 752 perslab 1394
slab class 11: chunk size 944 perslab 1110
slab class 12: chunk size 1184 perslab 885
slab class 13: chunk size 1480 perslab 708
slab class 14: chunk size 1856 perslab 564
slab class 15: chunk size 2320 perslab 451
slab class 16: chunk size 2904 perslab 361
slab class 17: chunk size 3632 perslab 288
slab class 18: chunk size 4544 perslab 230
slab class 19: chunk size 5680 perslab 184
slab class 20: chunk size 7104 perslab 147
slab class 21: chunk size 8880 perslab 118
slab class 22: chunk size 11104 perslab 94
slab class 23: chunk size 13880 perslab 75
slab class 24: chunk size 17352 perslab 60
slab class 25: chunk size 21696 perslab 48
slab class 26: chunk size 27120 perslab 38
slab class 27: chunk size 33904 perslab 30
slab class 28: chunk size 42384 perslab 24
slab class 29: chunk size 52984 perslab 19
slab class 30: chunk size 66232 perslab 15
slab class 31: chunk size 82792 perslab 12
slab class 32: chunk size 103496 perslab 10
slab class 33: chunk size 129376 perslab 8
slab class 34: chunk size 161720 perslab 6
slab class 35: chunk size 202152 perslab 5
slab class 36: chunk size 252696 perslab 4
slab class 37: chunk size 315872 perslab 3
slab class 38: chunk size 394840 perslab 2
slab class 39: chunk size 493552 perslab 2
slab class 40: chunk size 616944 perslab 1
slab class 41: chunk size 771184 perslab 1
slab class 42: chunk size 1048576 perslab 1
<26 server listening (binary)
<27 server listening (binary)
<28 send buffer was 212992, now 268435456
<32 send buffer was 212992, now 268435456
<31 server listening (udp)
<35 server listening (udp)
<30 server listening (udp)
<34 server listening (udp)
<29 server listening (udp)
<33 server listening (udp)
<28 server listening (udp)
<32 server listening (udp)
<36 new binary client connection.
<36 connection closed.
Invalid value for binding protocol: http
-- should be one of auto, binary, or ascii
t/00-startup.t .............. 17/20 Maximum connections must be greater than 0
t/00-startup.t .............. 18/20 Maximum connections must be greater than 0
t/00-startup.t .............. 19/20 Number of threads must be greater than 0
t/00-startup.t .............. ok
t/64bit.t ................... ok
t/binary-get.t .............. ok
t/binary-sasl.t ............. This server is not built with SASL support.
t/binary-sasl.t ............. ok
t/binary.t .................. ok
t/bogus-commands.t .......... ok
t/cas.t ..................... ok
t/chunked-items.t ........... ok
t/daemonize.t ............... ok
t/dash-M.t .................. ok
t/dyn-maxbytes.t ............ ok
t/evictions.t ............... ok
t/expirations.t ............. ok
t/flags.t ................... ok
t/flush-all.t ............... ok
t/getset.t .................. ok
t/idle-timeout.t ............ ok
t/incrdecr.t ................ ok
t/issue_104.t ............... ok
t/issue_108.t ............... ok
t/issue_14.t ................ ok
t/issue_140.t ............... skipped: Fix for Issue 140 was only an illusion
t/issue_152.t ............... ok
t/issue_163.t ............... ok
t/issue_183.t ............... ok
t/issue_192.t ............... ok
t/issue_22.t ................ ok
t/issue_260.t ............... skipped: Only possible to test #260 under artificial conditions
t/issue_29.t ................ ok
t/issue_3.t ................. ok
t/issue_41.t ................ ok
t/issue_42.t ................ ok
t/issue_50.t ................ ok
t/issue_61.t ................ ok
t/issue_67.t ................ ok
t/issue_68.t ................ ok
t/issue_70.t ................ ok
t/item_size_max.t ........... 1/7 Item max size cannot be less than 1024 bytes.
t/item_size_max.t ........... 2/7 Cannot set item size limit higher than 1/4 of memory max.
t/item_size_max.t ........... ok
t/line-lengths.t ............ ok
t/lru-crawler.t ............. ok
t/lru-maintainer.t .......... ok
t/lru.t ..................... ok
t/maxconns.t ................ ok
t/multiversioning.t ......... ok
t/noreply.t ................. ok
t/refhang.t ................. 124/127
# Failed test 'some ooms happened'
# at t/refhang.t line 51.
# Failed test 'nonzero lrutail_reflocked'
# at t/refhang.t line 53.
# got: '0'
# expected: anything else
# Failed test 'nonzero total lrutail_reflocked'
# at t/refhang.t line 56.
# got: '0'
# expected: anything else
# Looks like you failed 3 tests of 127.
t/refhang.t ................. Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/127 subtests
t/slabs-reassign-chunked.t .. ok
t/slabs-reassign2.t ......... ok
t/slabs_reassign.t .......... ok
t/stats-conns.t ............. ok
t/stats-detail.t ............ ok
t/stats.t ................... ok
t/touch.t ................... ok
t/udp.t ..................... ok
t/unixsocket.t .............. ok
t/watcher.t ................. ok
t/whitespace.t .............. fatal: Not a git repository (or any of the parent directories): .git
t/whitespace.t .............. skipped: Skipping tests probably because you don't have git.
Test Summary Report
-------------------
t/refhang.t (Wstat: 768 Tests: 127 Failed: 3)
Failed tests: 124, 126-127
Non-zero exit status: 3
Files=57, Tests=25794, 212 wallclock secs ( 6.26 usr 0.42 sys + 12.31 cusr 3.91 csys = 22.90 CPU)
Result: FAIL
Makefile:1588: recipe for target 'test' failed
make: *** [test] Error 1
相关推荐
ubuntu15.10安装samba的配置文件
在本文中,我们将详细探讨如何在Ubuntu 15.10操作系统上安装并配置Swift开发环境。Swift是由苹果公司开发的一种编程语言,旨在替代Objective-C成为构建Mac OS X和iOS应用的主要工具。自Swift开源以来,它已经逐渐...
ubuntu15.10中火狐可用最新的flash
标题中的“Ubuntu 15.10 GCC-4.3离线安装附件”指的是一个针对Ubuntu 15.10操作系统的GCC(GNU Compiler Collection)4.3版本的离线安装包。GCC是一个广泛使用的开源编译器套件,支持多种编程语言,如C、C++、...
Keepass2 在 Ubuntu 15.10 下中文乱码的解决办法 Keepass2 是一个流行的密码管理器,但是在 Ubuntu 15.10 下可能会出现中文乱码的问题。本文将详细介绍 Keepass2 在 Ubuntu 15.10 下中文乱码的解决办法。 问题描述...
Ubuntu 15.10 上将数据库 MySQL 转移到 MariaDB 在本文中,我们将介绍如何在 Ubuntu 15.10 上将数据库 MySQL 转移到 MariaDB。MariaDB 是 MySQL 数据库最好的替代品,自从 Oracle 收购 SUN 以后,开源界认为 Oracle...
首先脚本是开源的,所以我将要分享给大家! Katoolin 它是一个非常好的用于渗透测试的Linux发行版。但通常我们需要在电脑上安装一个完整的Kali Linux...近发布的ubuntu15.10默认python版本为3.5。使用下面的命令
在Ubuntu 15.10系统上安装Docker和Docker Compose的教程包含了一系列详细的步骤,首先从检查系统环境开始,接着是安装Docker,然后是安装Docker Compose,并且验证安装是否成功。本篇知识点将详细解释这些步骤并提供...
在Ubuntu 15.10操作系统中安装并使用MySQL 5.6.28时,可能会遇到中文乱码的问题。这通常与字符集配置有关,影响到数据的正确存储和显示。以下是一份详细的解决方案,旨在帮助你解决这个问题。 首先,我们需要检查...
在本文中,我们将详细探讨如何在Ubuntu 15.10操作系统上安装和配置Hadoop 2.7.2。Hadoop是一个开源的分布式计算框架,广泛用于大数据处理。由于不同版本之间的差异,遵循旧版教程可能会导致安装过程中遇到问题。因此...
mysql-community-source_5.7.10-1debian7_amd64 各种安装包,linux 64位安装资源包,linux 32位安装资源...mysql-community-source_5.7.10-1ubuntu12.04_amd64 各种安装包,linux 64位安装资源包,linux 32位安装资源包
mysql-community-source_5.7.10-1debian7_amd64 各种安装包,linux 64位安装资源包,linux 32位安装资源...mysql-community-source_5.7.10-1ubuntu12.04_amd64 各种安装包,linux 64位安装资源包,linux 32位安装资源包
在Ubuntu 15.10上配置Vim以适应Python开发是一项重要的任务,这将极大地提升你的编程效率。以下是一步步的详细步骤: 1. **安装Vim**: 首先,你需要通过Ubuntu的包管理器`apt-get`来安装Vim。在终端中输入以下...
Docker是一个开源软件,它可以把一个Linux应用和它所依赖的一切(比如配置文件)都封装到一个容器。然而,Docker与虚拟机不同,它使用了沙箱机制,Docker容器不运行操作...下面我将在Ubuntu 15.10安装和使用Docker。
提供的"ue_chinese.msi"文件是UE15.10中文版的安装程序,通过双击该文件,按照安装向导的步骤,用户可以轻松完成编辑器的安装。值得注意的是,"sn"可能是注册码文件,用于激活软件的完整功能。通常,安装完成后,...
* Wine 的版本号为 1.9.6,在 Ubuntu 15.10 和 16.04 中都可以使用。 * Wine 的配置可以通过 winecfg 工具来完成,例如设置 Windows 版本为 Win 200、XP 或 Vista。 二、阿里旺旺的下载和安装 * 阿里旺旺是中国...
操作系统:Linux (以Ubuntu 15.10为例) 1.Python相关环境配置(Ubuntu默认安装Python2.7不需要额外安装Python) Python包管理器安装:sudo apt-get install python-setuptools python-pip 2.相关第三方依赖库安装...
在Ubuntu 14.10系统中,用户可能会遇到在安装了最新版Gnome 15.10桌面环境后,经典Gnome桌面的字体显示问题。这个问题表现为字体变得模糊不清,颜色可能变黑,影响了用户体验。为了解决这个问题,我们可以采取以下...