`

how to setup memcache on linux

阅读更多
Steps to install Libevent(memcached dependency)

First we need to check if libevent is installed or not?
  • type whereis libevent on shell.


  • If you don’t find it, then we need to download and install it.  Type following sequence of commands on your shell
    wget http://www.monkey.org/~provos/libevent-1.4.8-stable.tar.gz
  • tar xfz libevent-1.4.8-stable.tar.gz
  • cd libevent-1.4.8-stable
  • ./configure
  • make
  • sudo make install


  • Finally we need to create a symlink to libevent
  • type  sudo ln -s /usr/local/lib/libevent-1.4.so.2 /usr/lib on shell.


  • Steps to install Memcached

    Download and install, for that type following sequence of commands on your shell
    wget http://danga.com/memcached/dist/memcached-1.2.6.tar.gz
  • tar xfz memcached-1.2.6.tar.gz
  • cd memcached-1.2.6
  • ./configure
  • make
  • sudo make install


  • Run Memcached as a daemon (d = daemon, m = memory, u = user, l = IP to listen to, p = port)
  • type memcached -d -m 1024 -u root -l 127.0.0.1 -p 11211 on shell


  • 当按照上面的教材安装完成后出现类似下面的错./memcached: error while loading shared libraries: libevent-1.3e.so.1: cannot open shared object file: No such file or directory


    You can fix this by simply doing this:

    上面的软连接写错位置了,应该用下面的命令

    ln -s /usr/local/lib/libevent-1.3e.so.1 /lib64/



    就可以正常运行了

    用下面的命令来查看是否成功
    netstat -a -n |grep 1121

    如果可以看到下面的结果:就成功了

    tcp        0      0 127.0.0.1:11211             0.0.0.0:*                   LISTEN
    udp        0      0 127.0.0.1:11211             0.0.0.0:*


    window 下面的安装简单

    下面 window版本的memcache server

    http://s3.amazonaws.com/downloads.northscale.com/memcached-win32-1.4.4-14.zip

    解压zip文件到某个目录如: c:\mmemcache-1.4.4

    进入 c:\mmemcache-1.4.4 目录

    memcached.exe -d install 安装服务

    memcached.exe -d start 启动服务

    memcached.exe -d uninstall 卸载服务

    更多命令 memcached.exe -h 查看帮助
    分享到:
    评论

    相关推荐

    Global site tag (gtag.js) - Google Analytics