The original memcache machine is damaged, need to install Memcache on the new Linux machine, the steps are as follows:
1. Login with the root authority of the Linux machine
2, installation libevent
: http://libevent.org/
The jar package to be downloaded: Libevent-2.0.22-stable.tar upload to/opt/soft below
Unzip:
TAR-ZXVF Libevent-2.0.22-stable.tar
After decompression:
After unpacking, go to folder: CD libevent-2.0.22-stable
Run ./configure–prefix=/usr;
then make;
then make install;
"PS in Make is wrong, error is as follows:"
Make: * * * No targets specified and no makefile found. Stop.
"Solutions"
"Configure:error:no acceptable C compiler found in $PATH"
Configure does not pass, need to install GCC
No available C compilers found, maybe you gcc didn't have GCC installed.
How to install GCC:
Yum Install gcc
after installing GCC, make, haha, pass.
3: Install Memcache
To download the Memcache installation package:
Memcached-1.4.15.tar
Unzip:
TAR-ZVXF Memcached-1.4.15.tar
CD memcached-1.4.15
configuration requires specifying the installation path of libevent./configure--with-libevent=/usr;
then make;
Then make install
4. Start Memcache
/usr/local/bin/memcached-d-M 1024-u root-p 13011-c 1024-p/tmp/memcached.pid-vv/tmp/memcache.log the-D option is to start a daemon
-M is the amount of memory allocated to Memcache, in megabytes, I'm 1G
-U is the user running memcache, I am root here
-L is the server IP address of the listener
-P is the port that sets Memcache listening, preferably a port above 1024, the service is set to 13011
The-c option is the maximum number of concurrent connections to run, which is 1024 by default and is set according to the load on your server
-P is a PID file that is set to save Memcache
-VV Setting the Memcache log
As you can see from the above, there are 3 parameters related to log information when starting memcached:
Where-V stands for printing Common error or warning type log information
-VV a more detailed log than-V print with client commands and server-side response information
-VVV is the most detailed, even contains the internal state information printing
5. There are two ways to see if Memcache is started
Way One: Ps-ef|grep memcache
Mode two: Telnet IP port
Then execute the command stats
Attention:
To view the log, the path set in this article is/tmp/memcache.log
Tail-f /tmp/memcache.log
How does Linux install Memcache?