- These instructions are intended specifically for installing Memcached on a single Fedora 20 node.
- I’ll be working from a Liquid Web Self Managed Fedora 20 server, and I’ll be logged in as root.
Step #1 Install MemcachedFirst, clean-up yum:
yum clean allAs a matter of best practice we’ll update our packages:
yum -y updateInstalling Memcached and related packages is now as simple as running just one command:
yum -y install memcached
Step #2: Configuration of the Memcached InstallationUse the following command to view information on the memcached command:
memcached -hThe default configuration file can be found at: /etc/sysconfig/memcached When started, Memcached will start on port 11211 by default per the default configuration file: PORT=”11211″ USER=”memcached” MAXCONN=”1024″ CACHESIZE=”64″ OPTIONS=”” To change the port (PORT), the user Memcached runs as (USER), the maximum number of allowed connections to Memcached (MAXCONN), or the cache size in megabytes (CACHESIZE), simply edit the configuration file. For a refresher on editing files with vim see: New User Tutorial: Overview of the Vim Text Editor EXAMPLE: If I wanted to run Memcached on port 1337, with 4GB of memory, and allow a maximum of 2,000 connections, I would change the config file as follows. Let’s edit the configuration file:
vim /etc/sysconfig/memcachedTo the following: PORT=”1337″ USER=”memcached” MAXCONN=”2000″ CACHESIZE=”4096″ OPTIONS=”” Exit and save the configuration file, and then restart Memcached
systemctl restart memcached
Step 3: Configure Memcached to Start on BootAnd then start Memcached:
systemctl start memcachedBe sure that Memcached starts at boot:
systemctl enable memcachedTo check the status of Memcached:
systemctl status memcachedTo stop Memcached:
systemctl stop memcached