<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Memcached &#8211; Hostry Help Center</title>
	<atom:link href="https://help.hostry.com/article-tags/memcached/feed/" rel="self" type="application/rss+xml" />
	<link>https://help.hostry.com</link>
	<description>Full information on how to use HOSTRY, provided by 24/7 community based support</description>
	<lastBuildDate>Thu, 24 Jun 2021 06:53:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.13</generator>

<image>
	<url>https://help.hostry.com/wp-content/uploads/cache/2021/01/cropped-apple-icon-180x180-1/836712163.png</url>
	<title>Memcached &#8211; Hostry Help Center</title>
	<link>https://help.hostry.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to install and configure Memcached on CentOS 7</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-and-configure-memcached-on-centos-7/</link>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Thu, 09 Apr 2020 08:38:46 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=1562</guid>

					<description><![CDATA[Memcached is a special open-source memory caching distribution system for objects. It is used to render pages and accelerate dynamic web applications by storing data fragments from database callout results. Install Memcached First you need to upgrade your CentOS Next, install the official Memcached package as well as Libmemcached. It [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><strong><em><a href="https://memcached.org/">Memcached </a></em></strong>is a special open-source memory caching distribution system for objects. It is used to render pages and accelerate dynamic web applications by storing data fragments from database callout results.</p>



<h2 id="install-memcached" >Install Memcached </h2>



<p>First you need to upgrade your CentOS</p>



<pre class="wp-block-code"><code>yum update -y</code></pre>



<p>Next, install the official Memcached package as well as Libmemcached. It represents several utilities for working with Memcached.</p>



<pre class="wp-block-code"><code>yum install -y memcached libmemcached</code></pre>



<p>To start Memcached at boot, you must use the <strong><em>systemctl </em></strong>command</p>



<pre class="wp-block-code"><code>systemctl enable memcached</code></pre>



<h2 id="memcached-setup" >Memcached Setup </h2>



<p>At this stage, you need to connect Memcached with the local interface and disable the UDP port. This is to avoid potential DDOS attacks. Open the <strong>/etc/sysconfig/ memcached </strong>file in your favorite editor:</p>



<pre class="wp-block-code"><code>nano /etc/sysconfig/memcached</code></pre>



<p>Next, find the line: </p>



<pre class="wp-block-code"><code>OPTIONS=""</code></pre>



<p>Change this to the following: </p>



<pre class="wp-block-code"><code>OPTIONS="-l 127.0.0.1 -U 0"</code></pre>



<p>Save the file and exit the editor. Next please restart Memcached, to use this changes</p>



<pre class="wp-block-code"><code>systemctl restart memcached</code></pre>



<p>You can verify that it works using systemctl: </p>



<pre class="wp-block-code"><code>systemctl status memcached</code></pre>



<p>The output will look like this: </p>



<pre class="wp-block-code"><code>● memcached.service - Memcached
Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2019-04-04 17:01:41 UTC; 8s ago
Main PID: 31312 (memcached)
CGroup: /system.slice/memcached.service
        └─31312 /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024 -l 127.0.0.1 -U 0

Apr 04 17:01:41 docs systemd&#91;1]: Started Memcached.</code></pre>



<p>You can verify that Memcached is only connected to the local interface and only listens for TCP connections using the <strong><em>ss</em></strong> command: </p>



<pre class="wp-block-code"><code>ss -plunt | grep memcached

tcp    LISTEN     0      128    127.0.0.1:11211                 *:*                   users:(("memcached",pid=31312,fd=26))</code></pre>



<h2 id="verify-settings" >Verify Settings </h2>



<p>You have now completed the setup and configuration of Memcached. You can verify the configuration using the memstat command from the libmemcached package</p>



<pre class="wp-block-code"><code>memstat --servers="localhost"</code></pre>



<p>The output will look like this:  </p>



<pre class="wp-block-code"><code>Server: localhost (11211)
    pid: 31312
    uptime: 385
    time: 1554397684
    version: 1.4.15
    libevent: 2.0.21-stable
    pointer_size: 64
    rusage_user: 0.006269
    rusage_system: 0.014105
    curr_connections: 1

...</code></pre>



<p></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
