GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing wikitech.wikimedia.org — Redis - Wikitech For the Redis service at Toolforge, see Help:Toolforge/Redis.
There are a number of Redis clusters and instance in Wikimedia production.
Outside production, we have MediaWiki-Vagrant and MediaWiki-Vagrant in Cloud VPS which are configured by default to use a Redis instance for local object caching and session store. Cluster redis_gitlabSee Gitlab. Cluster redis_miscThe role The servers are setup as 2 independent pairs. This is for HA purposes and it's up to the application to use it that way. Conversely not all applications are able to do so. The puppet setup related to the rdb nodes is a generic one and has no information related to the purpose of every instance. The fact that we assign an instance to a specific task is only related to the clients that are configured to use it. This is why, for example, rdb1013 and rdb1015 run the same puppet role and hiera settings, but they have their instances assigned to different purposes. Consumers:
Pair 1 (rdb1013 and rdb2011)Cumin alias: redis-misc-pair1-master Replicas: rdb1014 and rdb2012 (Cumin alias: redis-misc-pair1-slave)
Pair 2 (rdb1015 and rdb2013)Cumin alias: redis-misc-pair2-master Replicas rdb1016 and rdb2014 (Cumin alias: redis-misc-pair2-slave)
ServersEach master has a replica. Masters use odd numbers (e.g. rdb1005) and replicas the subsequent even number (e.g. rdb1006). Master-replica instances use the same ports e.g. ServicesChange propagation (or changeprop) is a service that runs on Kubernetes nodes by listening to topics on Kafka for events, and then translating them into HTTP requests to various systems. It is also responsible for cache evictions to happen on all services like RESTBase. Changeprop talks to Redis via Nutcracker. Related puppet code
Other Info
Cluster redis_lockSee also: Lock Manager
The role Related puppet code
Other Info
Using RedisConnecting
Some useful commands
# Replication role:slave master_host:10.64.0.24 master_port:6379 master_link_status:up master_last_io_seconds_ago:0 <snip> # Keyspace db0:keys=9351936,expires=9291239,avg_ttl=0
Using Redis from other ServicesSome services may require or be able to use Redis, and this Redis cluster is appropriate for that. As noted above, each pair of Redis servers in each data center have five separate instances on different ports, a majority of which are not in use; the first step to using the Redis server in production service is to choose an unused instance/port pair which can be located by examining Hiera data for what is currently in use: a relatively straight forward way to do this is to use Once a port/host combination for each datacenter is chosen, it is as simple as referring to those from the Puppet state which will use them. Using Redis from a service requires a password; the password may be obtained from the Hiera key UpgradingSee T419976 for the Redis 8.0 upgrade tracking task and use it as an example. Each application should be migrated to new hosts one by one. To find all consumers of a given host, search for either its IP address or hostname in both puppet and deployment-charts, and give service owners a heads up about the migration. The strategy is simple, one master server at a Kubernetes applications talk to Redis via external services. See External-services for how to deploy the updated server list in the `admin` namespace.
Data migrationRedis is generally considered ephemeral storage, so at the time of this writing, no service owner has requested a data migration in case of host replacement.
Other referencesCommands are easy, they all depend on the data type (hash, set, list, etc). Here's a quick reference. Configuration is likewise pretty straightforward with perhaps the exception of the snapshotting, aof and memory settings; here's the sample config file. Former clustersCluster redis_mapsSee Maps. Cluster redis_sessionsThe "redis_sessions" cluster was co-located on the main The cluster had a capacity of 8GB in total (16 shards with 520MB each, downsized to 8 shards as of April 2021, T280582). The cluster was stable in its utilization at a fairly constant 3GB of live data at any given time (as of July 2021, T212129#6283230). Past consumers in MediaWiki:
The decomission task is T267581: Phasing out "redis_sessions" cluster Reboots & RestartsMonitoringSee Grafana Redis See also
Retrieved from "https://wikitech.wikimedia.org/w/index.php?title=Redis&oldid=2454161" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |