Redis Cache: Unterschied zwischen den Versionen

Aus MoodleDocs
Wechseln zu:Navigation, Suche
Zeile 2: Zeile 2:
  
 
{{Zum Überarbeiten}}
 
{{Zum Überarbeiten}}
 +
 +
Der Redis Cache Store ist eine der besten Optionen, um Session- und Anwendungs-Caches zu verwalten, denn der Redis Cache Store bietet Datensicherheit, Locking, Key Awareness. Außerdem kann er für das [[Sitzungsinformationen#Redis Session Treiber|Caching der Nutzersitzungen]] in der [[Moodle-Konfigurationsdatei]] ''config.php'' verwendet werden.
 +
 +
Before Redis is available as a cache store, you will need to install [[Redis]] service (daemon) on your Moodle server, locally in case of a single Moodle app node architecture or externally if you are using a cluster of Moodle nodes. only then, you can configure Redis as an application or session level cache store.
 +
 +
If you are configuring a cluster of Moodle servers/nodes, the [[Redis]] service (daemon) should be installed on an external server and all Moodle nodes (servers/instances) should point to that external Redis. so all user's data is available when the user is using (connected to) any of the Moodle nodes, in case the user's connection is not persistent (sticky) to a specific node for the entire Moodle session. An external Redis (NoSQL) service can be installed on the main SQL server alongside the MySQL/MariaDB service, just make sure you have enough memory allocated on that server for both services.
 +
 +
A good practice is to give the [[Redis]] cache store prefix a proper short name and not leave it empty, as later on, it might conflict with user's session Redis cache you might choose to use, or other Moodle instances that will be installed on the same server. for example "my-school-name_cs_", where you replace "my-school-name" with your short school name. (and if you are also using a user's session store on the config.php file, you might like to prefix it with "my-school-name_us_")
 +
 +
When using a cluster setup with several Moodle instances on each node that belong to different Schools/Institutes/clients, make sure that you use the same Prefix for all Moodle instances that are on different nodes and are of the same School/Institute/Client.
 +
 +
==Redis Server installieren ==
 +
* [https://www.linode.com/docs/databases/redis/install-and-configure-redis-on-centos-7 Redis unter CentOS 7 installieren und konfigurieren]
 +
* [[Sitzungsinformationen#Redis Session Treiber]] und Tutorial [https://www.digitalocean.com/community/tutorials/how-to-set-up-a-redis-server-as-a-session-handler-for-php-on-ubuntu-14-04 How to Set Up a Redis Server as a Session Handler for PHP]
 +
 +
==Redis PHP-Treiber installieren==
 +
* Für CentOS können Sie entweder das [https://rpms.remirepo.net/ Remi] oder das [https://ius.io/ IUS] Repository und den [https://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/repoview/php71u-pecl-redis.html php71u-pecl-redis] Treiber installieren.
 +
* Unter Ubuntu 14.04 können Sie den [https://gist.github.com/hollodotme/418e9b7c6ebc358e7fda Redis php-fpm 7] Treiber installieren.
  
 
==Siehe auch==
 
==Siehe auch==
 
+
* [https://gist.github.com/kabel/10023961 Monitor Redis stats (a php one page app)]
 
* MDL-48468
 
* MDL-48468
  
 
[[en:Redis cache store]]
 
[[en:Redis cache store]]

Version vom 22. Januar 2018, 15:23 Uhr


Vorlage:Zum Überarbeiten

Der Redis Cache Store ist eine der besten Optionen, um Session- und Anwendungs-Caches zu verwalten, denn der Redis Cache Store bietet Datensicherheit, Locking, Key Awareness. Außerdem kann er für das Caching der Nutzersitzungen in der Moodle-Konfigurationsdatei config.php verwendet werden.

Before Redis is available as a cache store, you will need to install Redis service (daemon) on your Moodle server, locally in case of a single Moodle app node architecture or externally if you are using a cluster of Moodle nodes. only then, you can configure Redis as an application or session level cache store.

If you are configuring a cluster of Moodle servers/nodes, the Redis service (daemon) should be installed on an external server and all Moodle nodes (servers/instances) should point to that external Redis. so all user's data is available when the user is using (connected to) any of the Moodle nodes, in case the user's connection is not persistent (sticky) to a specific node for the entire Moodle session. An external Redis (NoSQL) service can be installed on the main SQL server alongside the MySQL/MariaDB service, just make sure you have enough memory allocated on that server for both services.

A good practice is to give the Redis cache store prefix a proper short name and not leave it empty, as later on, it might conflict with user's session Redis cache you might choose to use, or other Moodle instances that will be installed on the same server. for example "my-school-name_cs_", where you replace "my-school-name" with your short school name. (and if you are also using a user's session store on the config.php file, you might like to prefix it with "my-school-name_us_")

When using a cluster setup with several Moodle instances on each node that belong to different Schools/Institutes/clients, make sure that you use the same Prefix for all Moodle instances that are on different nodes and are of the same School/Institute/Client.

Redis Server installieren

Redis PHP-Treiber installieren

Siehe auch