Install memcached on Ubuntu and windows

Source: Internet
Author: User

Refer:

Http://www.linuxidc.com/Linux/2010-08/28100.htm

Http://www.linuxidc.com/Linux/2010-04/25543.htm

Http://www.cr173.com/html/15392_1.html

This chapter focuses on installation. Click here for a test ticket

Test the memcached service on Ubuntu and windows

Many large load sites around the world use memcache as a cache service to share the pressure on database servers.

Memcache is the project name and memcached is the service name. It makes a lot of new contacts feel inexplicable. I personally think it is more correct to use the former.

Like database development, memcache is divided into two parts: memcache server and client. The memcache server runs as a Service. The creation, storage, and deletion of all data caches are actually completed here. Client, here we refer to extensions that can be called by PHP, C, and Java applications.

Installation on Ubuntu:

Sudo apt-Get installmemcached

After the installation, memcached will be automatically started. Listen on port 11211 and check the command PS-Ef | grep memcached.

After installing the memcache server, we need to specify the parameter to start the service:

Memcached-D-M 128-p 11111-u Root

Here we need to describe the memcached service startup parameters:

-P listening port
-L connected IP address. The default value is local
-D start: Start the memcached service.
-D restart: restart the memcached service.
-D stop | Shutdown the running memcached Service
-D install the memcached Service
-D uninstall memcached Service
-U runs as the identity (only valid when running as root)
-MB maximum memory usage, in MB. The default value is 64 MB.
-An error is returned when M memory is used up, instead of deleting items.
-C: Maximum number of simultaneous connections. The default value is 1024.
-F block size growth factor. The default value is 1.25-n. The minimum allocation space is 48 for key + value + flags.
-H Show Help

Remember to modify the parameters:

/Etc/memcached. conf andsearch-L 127.0.0.1And replace it-L 0.0.0.0

(Installation details ---------------------------------------------------------------------------------------------------------------------------)

Http://programming.iteye.com/blog/1483257

If the system cannot find the memcache installation package

Update Software Source
You can use any source image in the following list to add a line to your/etc/APT/sources. list file as follows:

Deb http://security.ubuntu.com/ubuntu hard-security main universe

Reinstallation

  1. Sudo apt-Get update ---- update source operation
  2. Sudo apt-Get install memcache

Check whether the installation is successful.
-----
After the installation is successful, memcache starts itself. Check the process

PS-Aux

A record is found.

/Usr/bin/memcached-M 64-P 11211-u nobody-l 127.0.0.1

Memcached port 11211 user nobody address 127.0.0.1 is displayed to connect to the memcached server.

Telnet fig 11211

Enter

Stats


The parameters of the current memcached are displayed ..

  1. SysAdmin @ Ubuntu:/etc/apt $ Telnet fig 11211
  2. Trying 127.0.0.1...
  3. Connected to 127.0.0.1.
  4. Escape Character is '^]'.
  5. Stats
  6. Stat PID 3065
  7. Statuptime 170
  8. Stat time 1334121278
  9. Stat version 1.4.7
  10. Stat libevent 2.0.12-stable
  11. Stat pointer_size 64
  12. Stat rusage_user 0.004000
  13. Stat rusage_system 0.000000
  14. Stat curr_connections 5
  15. Stat total_connections 7
  16. Stat connection_structures 6
  17. Stat performance_get 0
  18. Stat performance_set 0
  19. Stat 1__flush 0
  20. Stat get_hits 0
  21. Stat get_misses 0
  22. Stat delete_misses 0
  23. Stat delete_hits 0
  24. Stat incr_misses 0
  25. Stat incr_hits 0
  26. Stat decr_misses 0
  27. Stat decr_hits 0
  28. Stat cas_misses 0
  29. Stat cas_hits 0
  30. Stat cas_badval 0
  31. Stat auth_cmds 0
  32. Stat auth_errors 0
  33. Stat bytes_read 140
  34. Stat bytes_written 856
  35. Stat limit_maxbytes 67108864
  36. Stat accepting_conns 1
  37. Stat listen_disabled_num 0
  38. Stat threads 4
  39. Stat conn_yields 0
  40. Stat bytes 0
  41. Stat curr_items 0
  42. Stat total_items 0
  43. Stat evictions 0
  44. Stat reclaimed 0
  45. End

Manually start memcached

  1. Memcached-D-M 128-l 127.0.0.1-P 11211-u Root


Start memcache with a root user allocated a maximum of 2 gm memory

  1. Memcached-D-M 128-l 127.0.0.1-P 11212-u Root


Start another memcache instance on port 11212.

Bytes --------------------------------------------------------------------------------------------------------

Installation on windwos:


1. Extract to the specified directory, such as: C: \ memcached \ memcached-win32-1.4.4-14.

2. Open the command window with cmd, go to the decompressed directory, and enter unzip memcached.exe-D install ".

3. Open the control panel and open the service. You can see that memcached is already available. If it is not started, start it manually.



4. You can also modify the startup parameters in the registry.

"D: \ memcached-1.2.6-win32-bin \ memcached.exe"-D runservice-l 127.0.0.1-M 1024-C 2048


5. Perform the Telnet 127.0.0.1 11211 test and start to display nothing. Press enter and enter the command stats to view the statistics, as shown in figure




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.