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?
- Does Memcached-top come by default with Memcached?
- What is the location of Memcached error log?
- How does Memcached consistent hashing work?
- How does Memcached work?
- Does restarting Memcached clear cache?
- How to connect to Memcached?
- How do you configure Memcached?
- Does Memcached support encryption?
- How to pronounce Memcached?
- How to check Memcached version in Linux?
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.
Start building today
Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.