1. Installation
Yum-y Install memcached
2. Start memcached
./usr/bin/memcached-d-M 256-u root-p 11211-c 1024–p/tmp/memcached.pid
Start parameter Description:
The-D option is to start a daemon.
-U root indicates that the user who initiated the memcached is root.
-M is the amount of memory allocated to Memcache, in megabytes, by default 64MB.
-M return error on memory exhausted (rather than removing items).
-U is the user running memcache, and if it is currently root, you need to specify the user with this parameter.
-P is the port that sets the TCP listener for memcache, preferably a port above 1024.
The-c option is the maximum number of concurrent connections to run, and the default is 1024.
-P is a PID file that is set to save Memcache.
Note: If you do not know the installation directory
You can enter which memcached to view the path
3. Connect
Telnet 127.0.0.1 11211
3. Set read set setting get read
Set name 0 0 3
123
Get Name
123
Note: The last 3 is the number of bits of the set string
Install mencached with Yum under Linux