Standalone
These instructions are for CentOS / Red Hat ... will later add ansible roles to handle also Debian line.
- install memcached
sudo yum -y install memcached
- run memcached
sudo systemctl start memcached
- test that memcached is running
[ghost@pvnp memcached]$ sudo systemctl status memcached ● memcached.service - Memcached Loaded: loaded (/usr/lib/systemd/system/memcached.service; disabled; vendor preset: disabled) Active: active (running) since Tue 2017-11-21 10:29:36 UTC; 11s ago Main PID: 2145 (memcached) CGroup: /system.slice/memcached.service └─2145 /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024 Nov 21 10:29:36 pvnp systemd[1]: Started Memcached. Nov 21 10:29:36 pvnp systemd[1]: Starting Memcached... [ghost@pvnp memcached]$
test that memcached is working[ghost@pvnp ~]$ telnet localhost 11211 Trying ::1... Connected to localhost. Escape character is '^]'. stats items
But that says nothing on if your publics can connect to the remote server hosting the memcached service ... you can be as restrictive as you like; for now, I am going to add a firewall rule to allow traffic on that port:
[ghost@pvnp ~]$ sudo firewall-cmd --zone=public --add-port=11211/tcp [sudo] password for ghost: success [ghost@pvnp ~]$ sudo service firewalld restart #-ish
Now check again, but this time from the server where your public instance/s is/are running:
test that memcached is working~/Desktop/PUBLICS\-> telnet 45.79.176.97 11211 Trying 45.79.176.97... Connected to li1275-97.members.linode.com. Escape character is '^]'. stats items
If you get a connection here, now you know everything is wired properly.
Now that memcached is setup and running on some remote server, we need to configure Magnolia (Publics ... in every case, since we've changed a pom file, we have changed the project and need to rebuild and redeploy) to know about it ... stop Magnolia and
Now let's create entries for
/modules/cache/config/contentCaching/*
Notice from the install you now have/modules/cache/config/cacheFactory/delegateFactories/memcached/caches.
We need to set this up to reflect where the server is, etc.:
set/modules/cache/config/cacheFactory/delegateFactories/memcached/caches/defaultPageCache/servers@0
and/modules/cache/config/cacheFactory/delegateFactories/memcached/caches/uuid-key-mapping/servers@0
properly ... mine is45.79.176.97:11211
:Now fire up your Public instances, and let's browse a bit to prime the cache.