From 839323079d9d556e0d018182a15f82a1237fc262 Mon Sep 17 00:00:00 2001 From: Adrien DUPUIS Date: Fri, 27 Mar 2020 16:47:51 +0100 Subject: [PATCH 1/8] Start a memcached alternative to redis --- docker-compose.bash | 9 +++++++-- docker-compose.yml | 9 ++++++--- docker/apache/Dockerfile | 12 +++++++++--- docker/apache/parameters.yml | 17 ++++++++++++----- 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/docker-compose.bash b/docker-compose.bash index 4cb3c863..31a1af6a 100755 --- a/docker-compose.bash +++ b/docker-compose.bash @@ -1,13 +1,18 @@ #!/usr/bin/env bash # Stop on error -#set -e; +set -e; + +# Persistence Cache and Session Handler +# redis, memcached, filesystem +CACHE_AND_SESSION_HANDLER=memcached # eZ Platform logs removal rm -f var/logs/*.log; # Docker Containers Cluster Build (except Solr which needs vendor/ezsystems/ezplatform-solr-search-engine/) -docker-compose up --build --detach varnish apache redis mariadb; +docker-compose up --build --detach varnish mariadb $CACHE_HANDLER; +docker-compose build --build-arg session_save_handler=$CACHE_HANDLER apache; # MariaDB: Server Wait & Version Fetch GET_MARIADB_VERSION_CMD="docker-compose exec mariadb mysql -proot -BNe 'SELECT VERSION();' | cut -d '-' -f 1 | head -n 1;"; diff --git a/docker-compose.yml b/docker-compose.yml index d1b91e46..4452e735 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,8 @@ services: apache: build: ./docker/apache depends_on: - - redis + #- redis + - memcached - mariadb #- solr ports: @@ -22,8 +23,10 @@ services: volumes: - .:/var/www/ez - redis: - image: redis:3.2 + #redis: + # image: redis:3.2 + memcached: + image: memcached mariadb: image: mariadb:10.1 diff --git a/docker/apache/Dockerfile b/docker/apache/Dockerfile index d2a01c27..6afbeb62 100644 --- a/docker/apache/Dockerfile +++ b/docker/apache/Dockerfile @@ -3,6 +3,7 @@ FROM debian:10 MAINTAINER adrien.dupuis@ez.no ENV SYMFONY_ENV=dev +ARG session_save_handler=memcached EXPOSE 80 @@ -24,7 +25,8 @@ RUN apt-get -qq update \ php-curl \ php-mbstring \ php-zip \ - php-redis \ + php-memcached \ + #php-redis \ # GD libfreetype6-dev \ libjpeg62-turbo-dev \ @@ -33,8 +35,12 @@ RUN apt-get -qq update \ # PHP-FPM: UDS Directory & Log Creation RUN mkdir /run/php && touch /var/log/php7.3-fpm.log -# PHP-FPM: Redis as session handler -RUN echo "\n; Redis as session handler\nphp_value[session.save_handler] = redis\nphp_value[session.save_path] = \"tcp://redis:6379\"" >> /etc/php/7.3/fpm/pool.d/www.conf +# PHP-FPM: Redis o memcached as session handler +RUN if [ 'redis' == $session_save_handler ]; then \ + echo "\n; Redis as session handler\nphp_value[session.save_handler] = redis\nphp_value[session.save_path] = \"tcp://redis:6379\"" >> /etc/php/7.3/fpm/pool.d/www.conf; \ + elif [ 'memcached' == $session_save_handler ]; then \ + echo "\n; Redis as session handler\nphp_value[session.save_handler] = memcached\nphp_value[session.save_path] = \"tcp://memcached:11211\"" >> /etc/php/7.3/fpm/pool.d/www.conf; \ + fi; # Apache: FastCGI Module & PHP-FPM Configuration RUN a2enmod proxy_fcgi setenvif rewrite \ && a2enconf php7.3-fpm diff --git a/docker/apache/parameters.yml b/docker/apache/parameters.yml index dc072695..b3ef20d1 100644 --- a/docker/apache/parameters.yml +++ b/docker/apache/parameters.yml @@ -1,5 +1,6 @@ imports: - - { resource: cache_pool/cache.redis.yml } + #- { resource: cache_pool/cache.redis.yml } + - { resource: cache_pool/cache.memcached.yml } parameters: #TODO: May move all this to .env file or Dockerfile @@ -12,12 +13,18 @@ parameters: #env(HTTPCACHE_VARNISH_INVALIDATE_TOKEN): docker # https://doc.ezplatform.com/en/2.5/guide/persistence_cache/#redis - env(CACHE_POOL): cache.redis - env(CACHE_DSN): redis + #env(CACHE_POOL): cache.redis + #env(CACHE_DSN): redis # https://doc.ezplatform.com/en/2.5/guide/sessions/#handling-sessions-with-redis - #env(SESSION_HANDLER_ID): ~ + #ezplatform.session.handler_id: ~ + #env(SESSION_SAVE_PATH): tcp://redis:6379 + + # https://doc.ezplatform.com/en/2.5/guide/persistence_cache/#memcached + env(CACHE_POOL): cache.memcached + env(CACHE_DSN): memcached + # https://doc.ezplatform.com/en/2.5/guide/sessions/#handling-sessions-with-memcached ezplatform.session.handler_id: ~ - env(SESSION_SAVE_PATH): tcp://redis:6379 + env(SESSION_SAVE_PATH): tcp://memcached:11211 env(DATABASE_HOST): mariadb env(DATABASE_PASSWORD): root From 7d24b85af83727782f2b3b2d7c4938257e30e86c Mon Sep 17 00:00:00 2001 From: Adrien DUPUIS Date: Sat, 28 Mar 2020 18:30:58 +0100 Subject: [PATCH 2/8] Docker: Cache and session pool as an argument --- docker-compose.bash | 50 +++++++++++++++++++++++++++++++++--- docker-compose.yml | 6 ++--- docker/README.md | 15 ++++++++--- docker/apache/Dockerfile | 17 ++++++------ docker/apache/parameters.yml | 20 +++++---------- 5 files changed, 76 insertions(+), 32 deletions(-) diff --git a/docker-compose.bash b/docker-compose.bash index 31a1af6a..de74c5e6 100755 --- a/docker-compose.bash +++ b/docker-compose.bash @@ -4,15 +4,37 @@ set -e; # Persistence Cache and Session Handler -# redis, memcached, filesystem -CACHE_AND_SESSION_HANDLER=memcached +CACHE_AND_SESSION_HANDLER=tagaware.filesystem + +while (( "$#" )); do + case "$1" in + -h|--help) + echo "Usage: $0 [--cache-and-session-handler=(redis|memcached)]"; + echo ""; + echo "\t-c,\t--cache-and-session-handler\tCache and session handler; redis, memcached or tagaware.filesystem (default)" + exit 0 + ;; + -c=*|--cache-and-session-handler=*) + CACHE_AND_SESSION_HANDLER="${1#*=}" + shift 1 + ;; + -c|--cache-and-session-handler) + CACHE_AND_SESSION_HANDLER=$2 + shift 2 + ;; + *) + echo "Error: Unsupported argument '$1'" >&2 + exit 1 + ;; + esac +done # eZ Platform logs removal rm -f var/logs/*.log; # Docker Containers Cluster Build (except Solr which needs vendor/ezsystems/ezplatform-solr-search-engine/) -docker-compose up --build --detach varnish mariadb $CACHE_HANDLER; -docker-compose build --build-arg session_save_handler=$CACHE_HANDLER apache; +docker-compose up --build --detach varnish mariadb $CACHE_AND_SESSION_HANDLER; +docker-compose build --build-arg session_save_handler=$CACHE_AND_SESSION_HANDLER apache; # MariaDB: Server Wait & Version Fetch GET_MARIADB_VERSION_CMD="docker-compose exec mariadb mysql -proot -BNe 'SELECT VERSION();' | cut -d '-' -f 1 | head -n 1;"; @@ -24,9 +46,29 @@ while [ -n "`echo $MARIADB_VERSION | grep 'ERROR';`" ]; do done; echo "MariaDB version: $MARIADB_VERSION"; +UNUSED_CONTAINER_LIST="memcached redis"; + # Apache: Symfony parameters.yml cp docker/apache/parameters.yml app/config/parameters.yml; sed -i '' -e "s/MARIADB_VERSION/$MARIADB_VERSION/" app/config/parameters.yml; +if [[ 'redis' == "$CACHE_AND_SESSION_HANDLER" ]]; then + sed -i '' -e "s/CACHE_AND_SESSION_HOST/redis/" app/config/parameters.yml; + sed -i '' -e "s/CACHE_AND_SESSION_PORT/6379/" app/config/parameters.yml; + UNUSED_CONTAINER_LIST="memcached"; +elif [[ 'memcached' == "$CACHE_AND_SESSION_HANDLER" ]]; then + sed -i '' -e "s/CACHE_AND_SESSION_HOST/memcached/" app/config/parameters.yml; + sed -i '' -e "s/CACHE_AND_SESSION_PORT/11211/" app/config/parameters.yml; + UNUSED_CONTAINER_LIST="redis"; +else # tagaware.filesystem + sed -i '' -e "s/imports://" app/config/parameters.yml; + sed -i '' -e "s/.*resource: cache_pool/.*//" app/config/parameters.yml; + sed -i '' -e "s/env(CACHE_.*): .*//g" app/config/parameters.yml; + sed -i '' -e "s/env(SESSION_.*): .*//g" app/config/parameters.yml; + sed -i '' -e "s/ezplatform\.session\..*: .*//g" app/config/parameters.yml; +fi + +# May remove unused Docker containers +docker-compose rm -sv $UNUSED_CONTAINER_LIST; # Apache: Composer Authentication if [ ! -f auth.json ]; then diff --git a/docker-compose.yml b/docker-compose.yml index 4452e735..ddd6abc3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: build: ./docker/apache depends_on: #- redis - - memcached + #- memcached - mariadb #- solr ports: @@ -23,8 +23,8 @@ services: volumes: - .:/var/www/ez - #redis: - # image: redis:3.2 + redis: + image: redis:3.2 memcached: image: memcached diff --git a/docker/README.md b/docker/README.md index 69580d3d..952242ce 100644 --- a/docker/README.md +++ b/docker/README.md @@ -14,8 +14,9 @@ Use a Docker containers cluster to have a typical architecture for eZ Platform i * Reverse Proxy Cache Server: - Varnish 2.4 - Varnish Modules 0.15 -* [Persistence Cache](https://doc.ezplatform.com/en/2.5/guide/persistence_cache/#redis) Server: +* Optional [Persistence Cache](https://doc.ezplatform.com/en/2.5/guide/persistence_cache/) and Session Handling Servers: - Redis 3.2 + - Memcached * DataBase Server: - MariaDB 10.1 * Search Engine: @@ -27,13 +28,21 @@ Quick Start * Run `./docker-compose.bash;` (you may need your eZ Platform Enterprise Edition credentials) * Access to http://127.0.0.1:8080/ -[WIP] About +About ----- -### Philosophy * Follow [eZ Platform 2.5 Requirements](https://doc.ezplatform.com/en/2.5/getting_started/requirements/) as much as possible. * Add as less configuration as possible to [original distribution](https://github.com/ezsystems/ezplatform-ee/tree/v2.5.9). +URLs and Command Lines +---------------------- + +### Builder + +* Build with Redis as cache and session handler: `./docker-compose.bash --cache-and-session-handler=redis` +* Build with Memcached as cache and session handler: `./docker-compose.bash --cache-and-session-handler=memcached` + + ### Usefull URLs * eZ Home page through Varnish: http://127.0.0.1:8080/ * eZ Admin through Varnish: http://127.0.0.1:8080/admin diff --git a/docker/apache/Dockerfile b/docker/apache/Dockerfile index 6190b7c2..8d3ad747 100644 --- a/docker/apache/Dockerfile +++ b/docker/apache/Dockerfile @@ -2,11 +2,11 @@ FROM debian:10 # Debian "Buster" 10 comes w/ PHP 7.3 MAINTAINER adrien.dupuis@ez.no -ENV SYMFONY_ENV=dev -ARG session_save_handler=memcached - -EXPOSE 80 +ARG symfony_env=dev +ARG session_save_handler=tagaware.filesystem +ENV SYMFONY_ENV=$symfony_env +ENV DEBIAN_FRONTEND noninteractive RUN apt-get -qq update \ && apt-get -qq install -y \ cron \ @@ -26,7 +26,7 @@ RUN apt-get -qq update \ php-mbstring \ php-zip \ php-memcached \ - #php-redis \ + php-redis \ # GD libfreetype6-dev \ libjpeg62-turbo-dev \ @@ -45,9 +45,9 @@ RUN pecl install xdebug \ # PHP-FPM: UDS Directory & Log Creation RUN mkdir /run/php && touch /var/log/php7.3-fpm.log # PHP-FPM: Redis o memcached as session handler -RUN if [ 'redis' == $session_save_handler ]; then \ +RUN if [[ 'redis' == $session_save_handler ]]; then \ echo "\n; Redis as session handler\nphp_value[session.save_handler] = redis\nphp_value[session.save_path] = \"tcp://redis:6379\"" >> /etc/php/7.3/fpm/pool.d/www.conf; \ - elif [ 'memcached' == $session_save_handler ]; then \ + elif [[ 'memcached' == $session_save_handler ]]; then \ echo "\n; Redis as session handler\nphp_value[session.save_handler] = memcached\nphp_value[session.save_path] = \"tcp://memcached:11211\"" >> /etc/php/7.3/fpm/pool.d/www.conf; \ fi; # Apache: FastCGI Module & PHP-FPM Configuration @@ -77,11 +77,12 @@ RUN npm install -g yarn RUN chown www-data:www-data /var/www/ WORKDIR /var/www/ez +EXPOSE 80 # Cron, Apache, PHP-FPM & Logs #TODO: Should be an array CMD service cron restart && /usr/sbin/apache2ctl restart && /etc/init.d/php7.3-fpm restart \ - # Send several logs following to output for `docker(-compose) logs` command + # Send several log followings to output for `docker(-compose) logs` command && tail \ -F /var/log/apache2/error.log \ -F /var/log/apache2/access.log \ diff --git a/docker/apache/parameters.yml b/docker/apache/parameters.yml index b3ef20d1..bc85e5f0 100644 --- a/docker/apache/parameters.yml +++ b/docker/apache/parameters.yml @@ -1,6 +1,5 @@ imports: - #- { resource: cache_pool/cache.redis.yml } - - { resource: cache_pool/cache.memcached.yml } + - { resource: cache_pool/cache.CACHE_AND_SESSION_HOST.yml } parameters: #TODO: May move all this to .env file or Dockerfile @@ -12,19 +11,12 @@ parameters: env(HTTPCACHE_PURGE_SERVER): http://varnish #env(HTTPCACHE_VARNISH_INVALIDATE_TOKEN): docker - # https://doc.ezplatform.com/en/2.5/guide/persistence_cache/#redis - #env(CACHE_POOL): cache.redis - #env(CACHE_DSN): redis - # https://doc.ezplatform.com/en/2.5/guide/sessions/#handling-sessions-with-redis - #ezplatform.session.handler_id: ~ - #env(SESSION_SAVE_PATH): tcp://redis:6379 - - # https://doc.ezplatform.com/en/2.5/guide/persistence_cache/#memcached - env(CACHE_POOL): cache.memcached - env(CACHE_DSN): memcached - # https://doc.ezplatform.com/en/2.5/guide/sessions/#handling-sessions-with-memcached + # https://doc.ezplatform.com/en/2.5/guide/persistence_cache/ + env(CACHE_POOL): cache.CACHE_AND_SESSION_HOST + env(CACHE_DSN): CACHE_AND_SESSION_HOST + # https://doc.ezplatform.com/en/2.5/guide/sessions/ ezplatform.session.handler_id: ~ - env(SESSION_SAVE_PATH): tcp://memcached:11211 + env(SESSION_SAVE_PATH): tcp://CACHE_AND_SESSION_HOST:CACHE_AND_SESSION_PORT env(DATABASE_HOST): mariadb env(DATABASE_PASSWORD): root From 9c4b28aeca72f632613405f3065d900444d4182c Mon Sep 17 00:00:00 2001 From: Adrien DUPUIS Date: Mon, 30 Mar 2020 13:18:58 +0200 Subject: [PATCH 3/8] Docker: Fix comment added to fpm/pool.d/www.conf --- docker/apache/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/apache/Dockerfile b/docker/apache/Dockerfile index 8d3ad747..476c1f57 100644 --- a/docker/apache/Dockerfile +++ b/docker/apache/Dockerfile @@ -48,7 +48,7 @@ RUN mkdir /run/php && touch /var/log/php7.3-fpm.log RUN if [[ 'redis' == $session_save_handler ]]; then \ echo "\n; Redis as session handler\nphp_value[session.save_handler] = redis\nphp_value[session.save_path] = \"tcp://redis:6379\"" >> /etc/php/7.3/fpm/pool.d/www.conf; \ elif [[ 'memcached' == $session_save_handler ]]; then \ - echo "\n; Redis as session handler\nphp_value[session.save_handler] = memcached\nphp_value[session.save_path] = \"tcp://memcached:11211\"" >> /etc/php/7.3/fpm/pool.d/www.conf; \ + echo "\n; Memcached as session handler\nphp_value[session.save_handler] = memcached\nphp_value[session.save_path] = \"tcp://memcached:11211\"" >> /etc/php/7.3/fpm/pool.d/www.conf; \ fi; # Apache: FastCGI Module & PHP-FPM Configuration RUN a2enmod proxy_fcgi setenvif rewrite \ From 46b30280d145ecefb6598fa9c21b4634a5038493 Mon Sep 17 00:00:00 2001 From: Adrien DUPUIS Date: Mon, 30 Mar 2020 14:15:56 +0200 Subject: [PATCH 4/8] Docker: Remove protocol from Memcached list Avoid the following error: Warning: SessionHandler::read(): Failed to write session lock: getaddrinfo() or getnameinfo() HOSTNAME LOOKUP FAILURE https://www.php.net/manual/fr/memcached.sessions.php#99646 --- docker/apache/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/apache/Dockerfile b/docker/apache/Dockerfile index 476c1f57..67de620b 100644 --- a/docker/apache/Dockerfile +++ b/docker/apache/Dockerfile @@ -48,7 +48,7 @@ RUN mkdir /run/php && touch /var/log/php7.3-fpm.log RUN if [[ 'redis' == $session_save_handler ]]; then \ echo "\n; Redis as session handler\nphp_value[session.save_handler] = redis\nphp_value[session.save_path] = \"tcp://redis:6379\"" >> /etc/php/7.3/fpm/pool.d/www.conf; \ elif [[ 'memcached' == $session_save_handler ]]; then \ - echo "\n; Memcached as session handler\nphp_value[session.save_handler] = memcached\nphp_value[session.save_path] = \"tcp://memcached:11211\"" >> /etc/php/7.3/fpm/pool.d/www.conf; \ + echo "\n; Memcached as session handler\nphp_value[session.save_handler] = memcached\nphp_value[session.save_path] = \"memcached:11211\"" >> /etc/php/7.3/fpm/pool.d/www.conf; \ fi; # Apache: FastCGI Module & PHP-FPM Configuration RUN a2enmod proxy_fcgi setenvif rewrite \ From 3e55a9c304f6ea6b877eb541ac970830d269ff8a Mon Sep 17 00:00:00 2001 From: Adrien DUPUIS Date: Mon, 30 Mar 2020 17:57:46 +0200 Subject: [PATCH 5/8] Docker: Add telnet to apache to test memcached --- docker/README.md | 3 +++ docker/apache/Dockerfile | 1 + 2 files changed, 4 insertions(+) diff --git a/docker/README.md b/docker/README.md index 88fdc2c3..289f2043 100644 --- a/docker/README.md +++ b/docker/README.md @@ -100,6 +100,8 @@ URLs and Command Lines - Delete all keys: `docker-compose exec redis redis-cli FLUSHALL;` - Open Redis CLI: `docker-compose exec redis redis-cli;` - Open a shell into container: `docker-compose exec redis bash;` +* Memcached + - Get stats: `expect -c 'spawn docker-compose exec apache bash; send "telnet memcached 11211\r"; send "stats\r"; expect { puts $expect_out(0,string); }; send "quit\r"; send "exit\r";';` * TODO: Solr - Get Solr version: `docker-compose exec solr bin/solr version;` - Follow Solr logs: `docker-compose logs --follow solr;` @@ -111,6 +113,7 @@ TODO * Switch from 120.0.0.1 to localhost in README.md to be more consistent with vhost.conf `ServerName` * Ensure compatibility with other unixoides than Mac OS X. For example, `sed -i ''` is specific to Mac OS X and a solution could be https://formulae.brew.sh/formula/gnu-sed +* Find a simpler way to monitor Memcached server. Starting w/ installing telnet command directly into memcached container. * Maybe: - Build Solr at the same time than other containers and uncomment that apache depends on solr - Use more docker-compose.yml `volumes` and less Dockerfile `COPY` diff --git a/docker/apache/Dockerfile b/docker/apache/Dockerfile index 67de620b..0d444072 100644 --- a/docker/apache/Dockerfile +++ b/docker/apache/Dockerfile @@ -11,6 +11,7 @@ RUN apt-get -qq update \ && apt-get -qq install -y \ cron \ curl \ + telnet \ git \ zip unzip \ # Apache From 1b0825d12b811e7f0b24869a8f42fa82b3d9d646 Mon Sep 17 00:00:00 2001 From: Adrien DUPUIS Date: Mon, 30 Mar 2020 18:04:42 +0200 Subject: [PATCH 6/8] docker/README.md: memcached expect script quicker exit --- docker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index 289f2043..f52884d3 100644 --- a/docker/README.md +++ b/docker/README.md @@ -101,7 +101,7 @@ URLs and Command Lines - Open Redis CLI: `docker-compose exec redis redis-cli;` - Open a shell into container: `docker-compose exec redis bash;` * Memcached - - Get stats: `expect -c 'spawn docker-compose exec apache bash; send "telnet memcached 11211\r"; send "stats\r"; expect { puts $expect_out(0,string); }; send "quit\r"; send "exit\r";';` + - Get stats: `expect -c 'spawn docker-compose exec apache bash; send "telnet memcached 11211\r"; send "stats\r"; expect "END" { puts $expect_out(0,string); }; send "quit\r"; send "exit\r";';` * TODO: Solr - Get Solr version: `docker-compose exec solr bin/solr version;` - Follow Solr logs: `docker-compose logs --follow solr;` From e80ba0d5ac75e3f8697fa6173ac14c2b614fe863 Mon Sep 17 00:00:00 2001 From: Adrien DUPUIS Date: Mon, 30 Mar 2020 19:10:37 +0200 Subject: [PATCH 7/8] docker/README.md: memcached cache clear --- docker/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index f52884d3..d683861d 100644 --- a/docker/README.md +++ b/docker/README.md @@ -70,7 +70,9 @@ URLs and Command Lines - See eZ Symfony Tools info: `docker-compose exec apache composer show ezsystems/symfony-tools;` - See eZ HTTP Cache bundle info: `docker-compose exec apache composer show ezsystems/ezplatform-http-cache;` - See eZ Solr SE bundle info: `docker-compose exec apache composer show ezsystems/ezplatform-solr-search-engine;` - - Clear eZ caches: `docker-compose exec --user www-data apache sh -c "php bin/console cache:clear; php bin/console cache:pool:clear cache.redis;";` + - Clear eZ caches: `docker-compose exec --user www-data apache sh -c "php bin/console cache:clear;";` + - Clear eZ caches when using Redis: `docker-compose exec --user www-data apache sh -c "php bin/console cache:clear; php bin/console cache:pool:clear cache.redis;";` + - Clear eZ caches when using Memcached: `docker-compose exec --user www-data apache sh -c "php bin/console cache:clear; php bin/console cache:pool:clear cache.memcached;";` - Open a shell into container as root: `docker-compose exec apache bash;` - Open a shell into container as www-data: `docker-compose exec --user www-data apache bash;` * Varnish From 001f3f251c8c0e08cbe2b82b062ab7ba8ff50d4d Mon Sep 17 00:00:00 2001 From: Adrien DUPUIS Date: Mon, 30 Mar 2020 23:28:31 +0200 Subject: [PATCH 8/8] docker/README.md: Enh. Memcached expect scripts --- docker/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docker/README.md b/docker/README.md index d683861d..afeb7345 100644 --- a/docker/README.md +++ b/docker/README.md @@ -71,8 +71,8 @@ URLs and Command Lines - See eZ HTTP Cache bundle info: `docker-compose exec apache composer show ezsystems/ezplatform-http-cache;` - See eZ Solr SE bundle info: `docker-compose exec apache composer show ezsystems/ezplatform-solr-search-engine;` - Clear eZ caches: `docker-compose exec --user www-data apache sh -c "php bin/console cache:clear;";` - - Clear eZ caches when using Redis: `docker-compose exec --user www-data apache sh -c "php bin/console cache:clear; php bin/console cache:pool:clear cache.redis;";` - - Clear eZ caches when using Memcached: `docker-compose exec --user www-data apache sh -c "php bin/console cache:clear; php bin/console cache:pool:clear cache.memcached;";` + - Clear eZ caches when using Redis: `docker-compose exec --user www-data apache sh -c "php bin/console cache:clear; php bin/console cache:pool:clear cache.redis;";` + - Clear eZ caches when using Memcached: `docker-compose exec --user www-data apache sh -c "php bin/console cache:clear; php bin/console cache:pool:clear cache.memcached;";` - Open a shell into container as root: `docker-compose exec apache bash;` - Open a shell into container as www-data: `docker-compose exec --user www-data apache bash;` * Varnish @@ -103,7 +103,8 @@ URLs and Command Lines - Open Redis CLI: `docker-compose exec redis redis-cli;` - Open a shell into container: `docker-compose exec redis bash;` * Memcached - - Get stats: `expect -c 'spawn docker-compose exec apache bash; send "telnet memcached 11211\r"; send "stats\r"; expect "END" { puts $expect_out(0,string); }; send "quit\r"; send "exit\r";';` + - Get stats: `expect -c 'spawn docker-compose exec apache bash; send "telnet memcached 11211\r"; send "stats\r"; expect "END"; send "quit\r"; send "exit\r";';` + - Delete all keys: `expect -c 'spawn docker-compose exec apache bash; send "telnet memcached 11211\r"; send "flush_all\r"; expect "OK"; send "quit\r"; send "exit\r";';` * TODO: Solr - Get Solr version: `docker-compose exec solr bin/solr version;` - Follow Solr logs: `docker-compose logs --follow solr;`