zoukankan      html  css  js  c++  java
  • ubuntu下的Memcached安装与测试

    ubuntu下的Memcached安装与测试

    由于memcached依赖于libevent;因此,还需要安装libevent,命令如下:

    sudo apt-get install libevent-dev
    

    如果libevent无法直接安装,则到官网下载一个http://libevent.org

    (base) root@ubuntu:/home/shaodi/Downloads/libevent-2.1.11-stable# ./configure
    (base) root@ubuntu:/home/shaodi/Downloads/libevent-2.1.11-stable# make
    (base) root@ubuntu:/home/shaodi/Downloads/libevent-2.1.11-stable# make install
    
    查看是否安装成功
    (base) root@ubuntu:/home/shaodi/Downloads/libevent-2.1.11-stable# ls -al /usr/local/lib | grep libevent
    

    最后安装memcached

    sudo apt-get install memcached
    

    启动Memcached

    (base) root@ubuntu:/home/shaodi/Downloads# memcached -m 64 -p 11211 -vv -u root
    

    使用telnet测试Memcached

    (base) shaodi@ubuntu:~$ telnet localhost 11211
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    set foo 0 0 3
    bar
    STORED
    get foo
    VALUE foo 0 3
    bar
    END
    

    使用如下的命令连接上面刚启动的Memcached。

    telnet localhost 11211
    在控制台会看到如下的信息:

    Trying 127.0.0.1...  
    Connected to localhost.  
    Escape character is '^]'. 
    

    保存数据的命令格式如下

    set foo 0 0 3
    bar
    如果保存成功,控制台会输出:STORED
    

    获取数据的命令格式如下:

    get foo
    

    在控制台的输出信息为:

    VALUE foo 0 3
    bar
    END
    
  • 相关阅读:
    centos networkmanager 和 network配置冲突
    Struts ajax json重新整理
    Struts2 ajax json小例子
    (转)json-lib 的maven dependency
    Struts2文件下载
    jQuery自定义滚动条插件mCustomScrollbar
    Struts2自定义拦截器
    Spring的自动装配在session监听器失效
    mysql 分组+排序+限定
    mysql触发器
  • 原文地址:https://www.cnblogs.com/huanyinglvtuan/p/12389606.html
Copyright © 2011-2022 走看看