Question: How to install Memcached in CentOS 7?
Answer
Memcached is a high-performance, distributed memory object caching server that stores data in memory to reduce the number of times an external database or an API must be accessed. Here's how you can install Memcached on CentOS 7:
- Update your system:
sudo yum update
- Install Memcached and its dependencies:
sudo yum install memcached
sudo yum install libmemcached-tools
- Start Memcached and configure it to start at boot time:
sudo systemctl start memcached
sudo systemctl enable memcached
- Verify that Memcached is running:
sudo systemctl status memcached
- By default, Memcached listens only on the loopback interface (localhost). If you want to allow incoming connections from other hosts, edit the configuration file /etc/sysconfig/memcached and change the OPTIONS line as follows:
OPTIONS="-l 0.0.0.0"
This will cause Memcached to listen on all available network interfaces.
- Restart Memcached for the changes to take effect:
sudo systemctl restart memcached
That's it! You have successfully installed and configured Memcached on CentOS 7.
Was this content helpful?
Other Common Memcached Questions (and Answers)
- Does Memcached expire?
- Does Memcached write to disk?
- What is the location of Memcached error log?
- How does Memcached consistent hashing work?
- Does Memcached support encryption?
- How to pronounce Memcached?
- How to check Memcached version in Linux?
- How to clear Memcached data?
- How does Memcached work in PHP?
- How to install Memcached on Windows?
- How much memory RAM does Memcached use?
- How to install Memcached on Ubuntu?
White Paper
Free System Design on AWS E-Book
Download this early release of O'Reilly's latest cloud infrastructure e-book: System Design on AWS.
Switch & save up to 80%
Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement. Instantly experience up to a 25X boost in performance and 80% reduction in cost