This article describes how to install memcache and start it in ubuntu environment. Share with you for your reference, as follows:
It is relatively simple to install the memcache server on ubuntu.
sudo apt-get install memcached
memcached -d -m 128-p 22222-u root -c 1024-l 127.0.0.1-P /tmp/memcached.pid -s /tmp/memcached.sock
**Parameter explanation: **
After starting the above command, check the memcache process
ps -ef | grep memcache
# There will be the following display,Then in/There will also be memcache pid and sock files under tmp
duck 37351011:33?00:00:00 memcached -d -m 128-p 22222-u root -c 1024-l 127.0.0.1-P /tmp/memcached.pid
- s /tmp/memcached.sock
Test the link
#! /usr/bin/env python
import memcache
mem_cli = memcache.Client(['127.0.0.1:22222'],debug=0)
mem_cli.set("test","what is happend?")
value = pymem.get("test")
print value
I hope that this article will help you configure your ubuntu environment.
Recommended Posts