Magento – AWS elasticache (Redis) for the Magento page and default cache

full-page-cachemagento-2.1redis

I have a Magento 2 based website on an AWS EC2 and an AWS RDS.

I would like to setup AWS ElastiCache Redis for the Magento page and default cache.

I am following the documentation provided here:
http://devdocs.magento.com/guides/v2.1/config-guide/redis/redis-pg-cache.html

As soon as I add cache tag to env.php file, Magento stops working and I get the error:

 [InvalidArgumentException]
  There are no commands defined in the "cache" namespace.

Best Answer

Step 1 - sudo rm -rf var/di/* var/generation/* var/cache/* var/page_cache/* var/view_preprocessed/* var/composer_home/cache/*
Step 2 - sudo chmod 777 var -R
Step 3 - sudo chmod 777 pub -R
Step 4 - sudo php bin/magento setup:static-content:deploy
Repeat step 2 & 3.