Redis for windows github

English | 简体中文

Redis Windows Version

With the powerful automated building capability of GitHub Actions, we can compile the latest version of Redis for Windows system in real-time.

The entire compilation process is completely transparent and open, with the compilation script located in the .github/workflows/ directory and the compilation logs available on the Actions page. In addition, we have added a hash calculation step when the compilation is completed, and the result is printed in the log. This is unmodifiable and recorded in the release page. You can verify the hash value of the downloaded file against the log and release page.
Our project is absolutely pure and without any hidden features, and can withstand the scrutiny of all experts. If you have any good ideas, please feel free to communicate with us.

We provide three operation modes:

  1. Run the start.bat script in the project to start directly with one click.
  2. Use the command line.
  3. Support running as a system service.

Command line startup:

cmd startup:

redis-server.exe redis.conf

powershell startup:

./redis-server.exe redis.conf

Service installation:

Can achieve automatic startup on boot. Please run it as an administrator and change RedisService.exe to the actual directory where it is stored.

sc.exe create Redis binpath=C:\Software\Redis\RedisService.exe start= auto

Start service

Out of Service

Uninstall service

image

Project Home: https://github.com/redis-windows/redis-windows

Acknowledgement:

Disclaimer

We suggest that you use it for local development and follow Redis official guidance to deploy it on Linux for production environment. This project doesn’t bear any responsibility for any losses caused by using it and is only for learning and exchange purposes.

Redis 8.0.0 for Windows

This is the General Availability release of Redis Open Source 8.0.

Redis 8.0 deprecates previous Redis and Redis Stack versions.

Stand alone RediSearch, RedisJSON, RedisTimeSeries, and RedisBloom are no longer needed as they are now part of Redis.

Major changes compared to 7.4.2

  • Name change: Redis Community Edition is now Redis Open Source

  • License change: licensed under your choice of

    • (a) the Redis Source Available License 2.0 (RSALv2); or
    • (b) the Server Side Public License v1 (SSPLv1); or
    • (c) the GNU Affero General Public License (AGPLv3)
  • Redis Query engine and 8 new data structures are now an integral part of Redis 8

    • (1) Redis Query Engine, which now supports both horizontal and vertical scaling for search, query and vector workloads

    • (2) JSON — a queryable JSON document

    • (3) Time series

    • (4-8) Five probabilistic data structures: Bloom filter, Cuckoo filter, Count-min sketch, Top-k, and t-digest

    • (9) Vector set [beta] — a data structure designed for Vector Similarity Search, inspired by Sorted set

    • These nine components are included in all binary distributions

    • See instructions in the README.md file on how to build from source with all these components

    • New configuration file: redis-full.conf — loads Redis with all these components,
      and contains new configuration parameters for Redis Query engine and the new data structures

    • New ACL categories: @search, @json, @timeseries, @bloom, @cuckoo, @cms, @topk, @tdigest

    • Commands are also included in the existing ACL categories (@read, @write, etc.)

  • More than 30 performance and resource utilization improvements

  • A new I/O threading implementation which enables throughput increase on multi-core environments
    (set with io-threads configuration parameter)

  • An improved replication mechanism which is more performant and robust

  • New hash commands — HGETDEL, HGETEX, HSETEX

For more details, see the release notes of 8.0-M01, 8.0-M02, 8.0-M03, 8.0-M04, and 8.0-RC1

Binary distributions

  • Alpine and Debian Docker images — https://hub.docker.com/_/redis
  • Install using snap — see https://github.com/redis/redis-snap
  • Install using brew — see https://github.com/redis/homebrew-redis
  • Install using RPM — see https://github.com/redis/redis-rpm
  • Install using Debian APT — see https://github.com/redis/redis-debian

Operating systems we test Redis 8.0 on

  • Ubuntu 20.04 (Focal Fossa), 22.04 (Jammy Jellyfish), 24.04 (Noble Numbat)
  • Rocky Linux 8.10, 9.5
  • AlmaLinux 8.10, 9.5
  • Debian 11 (Bullseye), 12 (Bookworm)
  • macOS 13 (Ventura), 14 (Sonoma), 15 (Sequoia)

Supported upgrade paths (by replication or persistence)

  • From previous Redis versions, without modules
  • From previous Redis versions with modules (RediSearch, RedisJSON, RedisTimeSeries, RedisBloom)
  • From Redis Stack 7.2 or 7.4

Security fixes (compared to 8.0-RC1)

  • (CVE-2025-21605) An unauthenticated client can cause an unlimited growth of output buffers

Bug fixes (compared to 8.0-RC1)

  • redis/redis#13966, redis/redis#13932 CLUSTER SLOTS — TLS port update not reflected
  • redis/redis#13958 XTRIM, XADD — incorrect lag due to trimming stream
  • redis/redis#13931 HGETEX — wrong order of keyspace notifications

Hashes

MSYS2 Builds Hashes

Algorithm : SHA256
Hash : 975F99FB94CC82583F51168646618EEBCAF19A442E62205426C7F0F07CA07346
Path : D:\a\redis-windows\redis-windows\Redis-8.0.0-Windows-x64-msys2.zip

Algorithm : SHA256
Hash : 4FBF19AD53BDA400B68D003377008F115AC641261386CD52D6DBEA83CF7F1724
Path : D:\a\redis-windows\redis-windows\Redis-8.0.0-Windows-x64-msys2-with-Service.zip

Cygwin Builds Hashes

Algorithm : SHA256
Hash : 6DAA88BC2F0902DD2D2F929B85D7F186BD9C22402794D154109BD8A308B2C206
Path : D:\a\redis-windows\redis-windows\Redis-8.0.0-Windows-x64-cygwin.zip

Algorithm : SHA256
Hash : 3F68598EA69FB9F0419B22ECBE21EFDE67E9B6B86E60CEAE8E9CC922E5F1B4AD
Path : D:\a\redis-windows\redis-windows\Redis-8.0.0-Windows-x64-cygwin-with-Service.zip

From workflow: https://github.com/redis-windows/redis-windows/actions/runs/14806459284

Redis 7.4.3 for Windows

Update urgency: SECURITY: There are security fixes in the release.

Security fixes

  • (CVE-2025-21605) An unauthenticated client can cause an unlimited growth of output buffers

Bug fixes

  • redis/redis#13661 FUNCTION FLUSH — memory leak when using jemalloc
  • redis/redis#13793 WAITAOF returns prematurely
  • redis/redis#13853 SLAVEOF — crash when clients are blocked on lazy free
  • redis/redis#13863 RANDOMKEY — infinite loop during client pause
  • redis/redis#13877 ShardID inconsistency when both primary and replica support it

Hashes

Algorithm : SHA256
Hash : 9E94BDEDDC25BAA362CAEFBC2A3003DEBB8890D4BD239DABFFA4200928D0658C
Path : D:\a\redis-windows\redis-windows\Redis-7.4.3-Windows-x64-msys2.zip

Algorithm : SHA256
Hash : 18ACBB88C70C9FF55E76F87C8516D985C2AB3F159DB3683F436B87A468F17545
Path : D:\a\redis-windows\redis-windows\Redis-7.4.3-Windows-x64-msys2-with-Service.zip

Algorithm : SHA256
Hash : F6FE3DBBEA180672FE08CBA80759168EA68A51CD7EE4F097E1B8905A053D0AD1
Path : D:\a\redis-windows\redis-windows\Redis-7.4.3-Windows-x64-cygwin.zip

Algorithm : SHA256
Hash : E21FA8C30FDDDC2356A5A1B6098A765A61960FCC585CF40EC3CD4D9C471DA856
Path : D:\a\redis-windows\redis-windows\Redis-7.4.3-Windows-x64-cygwin-with-Service.zip

From workflow: https://github.com/redis-windows/redis-windows/actions/runs/14632064330

Redis 7.2.8 for Windows

Update urgency: SECURITY: There are security fixes in the release.

Security fixes

  • (CVE-2025-21605) An unauthenticated client can cause an unlimited growth of output buffers

Bug fixes

  • redis/redis#12817, redis/redis#12905 Fix race condition issues between the main thread and module threads
  • redis/redis#13863 RANDOMKEY — infinite loop during client pause
  • redis/redis#13877 ShardID inconsistency when both primary and replica support it

Hashes

Algorithm : SHA256
Hash : AA6D4206A08D1189DD7A57C78201540A53B12350E1AD09EE7CACA04120600656
Path : D:\a\redis-windows\redis-windows\Redis-7.2.8-Windows-x64-msys2.zip

Algorithm : SHA256
Hash : 407087E4C63F11494475E15BA9CAA54CBCF62865B19B8F5D9E14D9A0A7998D5F
Path : D:\a\redis-windows\redis-windows\Redis-7.2.8-Windows-x64-msys2-with-Service.zip

Algorithm : SHA256
Hash : 6D11A676276CEE71462BB56C047EFA56A9AAE396BE4086B6BD846ED53E790EE4
Path : D:\a\redis-windows\redis-windows\Redis-7.2.8-Windows-x64-cygwin.zip

Algorithm : SHA256
Hash : CD60BBA1827513F9C8AE99287744E1C8CDDAC7CEC9C70DC2B242719DFF029799
Path : D:\a\redis-windows\redis-windows\Redis-7.2.8-Windows-x64-cygwin-with-Service.zip

From workflow: https://github.com/redis-windows/redis-windows/actions/runs/14640298268

Redis 6.2.18 for Windows

Update urgency: SECURITY: There are security fixes in the release.

Security fixes

  • (CVE-2025-21605) An unauthenticated client can cause an unlimited growth of output buffers

Hashes

Algorithm : SHA256
Hash : C21B6370F0F13D05DC25185E25D8B4A8F71A5BD5327789A14D0261E38228BA83
Path : D:\a\redis-windows\redis-windows\Redis-6.2.18-Windows-x64-msys2.zip

Algorithm : SHA256
Hash : BBD1B6AE2768C08A3AFD292B28557606F4169C18CEF3BF2FAB0CD0050D165331
Path : D:\a\redis-windows\redis-windows\Redis-6.2.18-Windows-x64-msys2-with-Service.zip

Algorithm : SHA256
Hash : AA18CEE207ADDE996C517945FED9CE34D05CD68B78EB112AFA2BEB5BA5219FC3
Path : D:\a\redis-windows\redis-windows\Redis-6.2.18-Windows-x64-cygwin.zip

Algorithm : SHA256
Hash : D803EADE93CF342F1163CC97F86E516E9C1603327AF8D37CF053CE2E0D8D5470
Path : D:\a\redis-windows\redis-windows\Redis-6.2.18-Windows-x64-cygwin-with-Service.zip

From workflow: https://github.com/redis-windows/redis-windows/actions/runs/14640291946

Redis 7.4.2 for Windows

Upgrade urgency SECURITY: See security fixes below.

Security fixes

  • (CVE-2024-46981) Lua script commands may lead to remote code execution
  • (CVE-2024-51741) Denial-of-service due to malformed ACL selectors

Bug fixes

  • redis/redis#13627 Crash on module memory defragmentation
  • redis/redis#13338 Streams: XINFO lag field is wrong when tombstone is after the last_id of the consume group
  • redis/redis#13473 Streams: XTRIM does not update the maximal tombstone, leading to an incorrect lag
  • redis/redis#13470 INFO after HDEL show wrong number of hash keys with expiration
  • redis/redis#13476 Fix a race condition in the cache_memory of functionsLibCtx
  • redis/redis#13626 Memory leak on failed RDB loading
  • redis/redis#13539 Hash: fix key ref for a hash that no longer has fields with expiration on RENAME/MOVE/SWAPDB/RESTORE
  • redis/redis#13443 Cluster: crash when loading cluster config
  • redis/redis#13422 Cluster: CLUSTER SHARDS returns empty array
  • redis/redis#13465 Cluster: incompatibility with older node versions
  • redis/redis#13608 Cluster: SORT ... GET #: incorrect error message
    Hashes
    =========

Algorithm : SHA256
Hash : 65C8D2FF57572AFA3CF4634820D4CDB8921E82760B272AD1DD12F38308414A96
Path : D:\a\redis-windows\redis-windows\Redis-7.4.2-Windows-x64-msys2.zip

Algorithm : SHA256
Hash : 70DCA38B1BED63F66362D9962B5DB593FA111FA1BC09D8C21A01B01D18FAFA66
Path : D:\a\redis-windows\redis-windows\Redis-7.4.2-Windows-x64-msys2-with-Service.zip

Algorithm : SHA256
Hash : 85725DE3FD3A780CC6509CCB489E736085F5D926856D7A52FC2CBABF010D6BE8
Path : D:\a\redis-windows\redis-windows\Redis-7.4.2-Windows-x64-cygwin.zip

Algorithm : SHA256
Hash : 627E4C2C484647C2B60EC262158FB05981C81F6B761C154F45F9979014B7519C
Path : D:\a\redis-windows\redis-windows\Redis-7.4.2-Windows-x64-cygwin-with-Service.zip

From workflow: https://github.com/redis-windows/redis-windows/actions/runs/12643895539

Redis 7.2.7 for Windows

Upgrade urgency SECURITY: See security fixes below.

Security fixes

  • (CVE-2024-46981) Lua script commands may lead to remote code execution
  • (CVE-2024-51741) Denial-of-service due to malformed ACL selectors

Bug fixes

  • redis/redis#13380 Possible crash due to OOM panic on invalid command
  • redis/redis#13338 Streams: XINFO lag field is wrong when tombstone is after the last_id of the consume group
  • redis/redis#13473 Streams: XTRIM does not update the maximal tombstone, leading to an incorrect lag
  • redis/redis#13311 Cluster: crash due to unblocking client during slot migration
  • redis/redis#13443 Cluster: crash when loading cluster config
  • redis/redis#13422 Cluster: CLUSTER SHARDS returns empty array
  • redis/redis#13465 Cluster: incompatibility with older node versions
    Hashes
    =========

Algorithm : SHA256
Hash : B13B718CD88FE6F2D032D5B6BCD97A2A0A1F150DEE8197AA3AD25CA044BECE71
Path : D:\a\redis-windows\redis-windows\Redis-7.2.7-Windows-x64-msys2.zip

Algorithm : SHA256
Hash : 49D74E32042839061F06AB91CA84AE9BF4064249894D29F2A13E222A3BC65A7F
Path : D:\a\redis-windows\redis-windows\Redis-7.2.7-Windows-x64-msys2-with-Service.zip

Algorithm : SHA256
Hash : 64FBA36D56A3463E82F0154464E62AD174AED662C625D21A54248A004898BF98
Path : D:\a\redis-windows\redis-windows\Redis-7.2.7-Windows-x64-cygwin.zip

Algorithm : SHA256
Hash : 4C5E765453A17D3D79AF7FD91BB71E1F0AF8CDFA0D6F301D1EA5E2C802DD88DA
Path : D:\a\redis-windows\redis-windows\Redis-7.2.7-Windows-x64-cygwin-with-Service.zip

From workflow: https://github.com/redis-windows/redis-windows/actions/runs/12669845191

Redis 6.2.17 for Windows

Upgrade urgency SECURITY: See security fixes below.

Security fixes

  • (CVE-2024-46981) Lua script commands may lead to remote code execution
    Hashes
    =========

Algorithm : SHA256
Hash : B8B8551BF2D77B600C11E00BB51CC3F361C50477BD98A1DD069C8B95DBF9A7E4
Path : D:\a\redis-windows\redis-windows\Redis-6.2.17-Windows-x64-msys2.zip

Algorithm : SHA256
Hash : 9D6E55FADA0003BDAC039351BEA5EDE3A43EB0D55FAF413919032CFB845F9A4D
Path : D:\a\redis-windows\redis-windows\Redis-6.2.17-Windows-x64-msys2-with-Service.zip

Algorithm : SHA256
Hash : 1E8B29B6BB26C3DECF936260EF26E21379046D03DCA1EB785D74067C0F84E5E0
Path : D:\a\redis-windows\redis-windows\Redis-6.2.17-Windows-x64-cygwin.zip

Algorithm : SHA256
Hash : 74975AD5F912FFEB4B187854C9FA97F7C73A00489F20A942C028CD0B342272FF
Path : D:\a\redis-windows\redis-windows\Redis-6.2.17-Windows-x64-cygwin-with-Service.zip

From workflow: https://github.com/redis-windows/redis-windows/actions/runs/12669848410

Redis 7.4.1 for Windows

Upgrade urgency SECURITY: See security fixes below.

Security fixes

  • (CVE-2024-31449) Lua library commands may lead to stack overflow and potential RCE.
  • (CVE-2024-31227) Potential Denial-of-service due to malformed ACL selectors.
  • (CVE-2024-31228) Potential Denial-of-service due to unbounded pattern matching.

Hashes

Algorithm : SHA256
Hash : E7A4BD7BE3EDD469D5B7831B7FA894317D337313CD19335F1493EC22C18C40E8
Path : D:\a\redis-windows\redis-windows\Redis-7.4.1-Windows-x64-msys2.zip

Algorithm : SHA256
Hash : 37ECAF785CB72F933E13538C043AB49C7F97F6BCA1DE0EDB69A16BFB05788FA6
Path : D:\a\redis-windows\redis-windows\Redis-7.4.1-Windows-x64-msys2-with-Service.zip

Algorithm : SHA256
Hash : D1B87CA1F622FC4A7B5AAED4CC052FE9F9560CCA8B661AC77C178EAFBC11B4B1
Path : D:\a\redis-windows\redis-windows\Redis-7.4.1-Windows-x64-cygwin.zip

Algorithm : SHA256
Hash : 041D1B3327D868873DD4214C1534FC5E8E748F0BF3202FB7BB8F829E94E08D03
Path : D:\a\redis-windows\redis-windows\Redis-7.4.1-Windows-x64-cygwin-with-Service.zip

From workflow: https://github.com/redis-windows/redis-windows/actions/runs/11154679931

Redis 7.2.6 for Windows

Upgrade urgency SECURITY: See security fixes below.

Security fixes

  • (CVE-2024-31449) Lua library commands may lead to stack overflow and potential RCE.
  • (CVE-2024-31227) Potential Denial-of-service due to malformed ACL selectors.
  • (CVE-2024-31228) Potential Denial-of-service due to unbounded pattern matching.

Bug fixes

  • Fixed crashes in cluster mode (redis/redis#13315)

Hashes

Algorithm : SHA256
Hash : CEBC7403E05B6F1BDE5BEC50910F8447945E3DEFE58E6E36521AE7A392E0A478
Path : D:\a\redis-windows\redis-windows\Redis-7.2.6-Windows-x64-msys2.zip

Algorithm : SHA256
Hash : 544BECB529B706D0633C3BB9C451963B6F9DA14ED9E22D1C362687C43BE81843
Path : D:\a\redis-windows\redis-windows\Redis-7.2.6-Windows-x64-msys2-with-Service.zip

Algorithm : SHA256
Hash : F72CDADDD773157E726963C3A785116D2A8F1A4D339B3C93D95DA51869658B66
Path : D:\a\redis-windows\redis-windows\Redis-7.2.6-Windows-x64-cygwin.zip

Algorithm : SHA256
Hash : A365CC9CB1831BDB139AFE1394D29C8187292BD10D0CC6F177EA4561F811C85F
Path : D:\a\redis-windows\redis-windows\Redis-7.2.6-Windows-x64-cygwin-with-Service.zip

From workflow: https://github.com/redis-windows/redis-windows/actions/runs/11154005410

Redis 6.2.16 for Windows

Upgrade urgency SECURITY: See security fixes below.

Security fixes

  • (CVE-2024-31449) Lua library commands may lead to stack overflow and potential RCE.
  • (CVE-2024-31228) Potential Denial-of-service due to unbounded pattern matching.

Hashes

Algorithm : SHA256
Hash : EB3732D63F09CC4A1A4234119C3D1CBA0D62CC0CC1E9CB3E6DD15CB314CED7A6
Path : D:\a\redis-windows\redis-windows\Redis-6.2.16-Windows-x64-msys2.zip

Algorithm : SHA256
Hash : 1BE1799ECCAABE14DA5F474B2EC7CBAF0C902154DFE47B59F8F1EEE10BAA092D
Path : D:\a\redis-windows\redis-windows\Redis-6.2.16-Windows-x64-msys2-with-Service.zip

Algorithm : SHA256
Hash : 893D7FE23133DF257BFDE9E53D6993D4BC793A186FD4BEB13CD4D46BC7073135
Path : D:\a\redis-windows\redis-windows\Redis-6.2.16-Windows-x64-cygwin.zip

Algorithm : SHA256
Hash : 2ED6BFE6EDB7FA5E3F9175AC0D82D655A99D1433135D875C291C47CE90F44D57
Path : D:\a\redis-windows\redis-windows\Redis-6.2.16-Windows-x64-cygwin-with-Service.zip

From workflow: https://github.com/redis-windows/redis-windows/actions/runs/11154000759

Redis for Windows 5.0.14.1

This is a bugfix/maintenance release that works around issue #130 related to usage of modules during asynchronous save operations. If you are not using modules there is no need to upgrade.

Redis 5.0.14 for Windows

Redis 5.0.10 for Windows

This is a bugfix/maintenance release of Redis 5.0.10 for Windows ported from redis/5.010 release. Please refer to original Release Notes for a full list of changes.

NOTE: activedefrag feature (active memory defragmentation) is switched off as it needs further investigation to work properly.

Redis 5.0.9 for Windows

First release of Redis 5.x for Windows, updated to be in sync with antirez/5.0.9.

Redis 4.0.14.2 for Windows

This is a hotfix release of 4.0.14 branch that fixes #50 related to running in Sentinel mode.

Redis 4.0.14.1 for Windows

This is a hotfix release of 4.0.14 branch that fixes 2 Windows-specific issues:

  • #46 — added support for older Windows versions (prior Windows 8 and Windows Server 2012)
  • #47 — fixed problem with parsing command-line arguments.

Redis 4.0.14 for Windows

Redis 4.0.2.3 for Windows (alpha)

Redis for Windows 4.0.2.3 (alpha)

This 4.0.2.3 release is still an alpha version, but contains enhancements and fixes for:

  • #14: decrease logging verbosity of some cluster-related messages
  • #23: ZRANK/ZREVRANK bugfix (win-port only)
  • failed unit tests (bdcf80e).

Alpha version of Redis 4.0.2 for Windows.

Redis 4.0.2 for Windows is a merge of Windows-specific changes from latest (unsupported) 3.2.100 release from MSOpenTech and Redis 4.0.2 and this alpha release consists of:

  • all Redis 4.0.2 features except modules,
  • all executables of Redis (redis-server, redis-cli, redis-benchmark, redis-check-aof, redis-check-rdb).

Main difference to official Redis 4.0.2 (except no support for modules at the moment) is old version of jemalloc-win dependency, which is planned to be updated to the same version in beta release.

Redis 4.0.2.2 for Windows (alpha)

Redis for Windows 4.0.2.2 (alpha)

This 4.0.2.2 release is still an alpha version, but contains a fix to issue #12 (crash when rewriting AOF file — this issue was specific to Windows port only).

Alpha version of Redis 4.0.2 for Windows.

Redis 4.0.2 for Windows is a merge of Windows-specific changes from latest (unsupported) 3.2.100 release from MSOpenTech and Redis 4.0.2 and this alpha release consists of:

  • all Redis 4.0.2 features except modules,
  • all executables of Redis (redis-server, redis-cli, redis-benchmark, redis-check-aof, redis-check-rdb).

Main difference to official Redis 4.0.2 (except no support for modules at the moment) is old version of jemalloc-win dependency, which is planned to be updated to the same version in beta release.

Redis 4.0.2.1 for Windows (alpha)

Redis for Windows 4.0.2.1 (alpha)

This 4.0.2.1 release is still an alpha version, but contains a fix to issue #11, which was related to sending back larger amounts of data to Redis clients (this issue was specific to Windows port only).

Note: If you have installed the previous 4.0.2 version — please back up your config files and uninstall it first.

Alpha version of Redis 4.0.2 for Windows.

Redis 4.0.2 for Windows is a merge of Windows-specific changes from latest (unsupported) 3.2.100 release from MSOpenTech and Redis 4.0.2 and this alpha release consists of:

  • all Redis 4.0.2 features except modules,
  • all executables of Redis (redis-server, redis-cli, redis-benchmark, redis-check-aof, redis-check-rdb).

Main difference to official Redis 4.0.2 (except no support for modules at the moment) is old version of jemalloc-win dependency, which is planned to be updated to the same version in beta release.

Redis — это система управления базами данных, которая хранит данные в формате «ключ-значение»: уникальному ключу в БД соответствует некоторое значение. Данные в этой базе данных хранятся в оперативной памяти, благодаря чему запросы обрабатываются быстро. 

Согласно рейтингу DB-Engines.com, Redis — это самая популярная СУБД «ключ-значение». Благодаря этому типу, архитектура базы и запросы к ней проще, чем в реляционных баз данных. Однако использовать привычный SQL на стандартном Redis не получится: придется работать с Lua-скриптами или устанавливать модифицированные версии, например RediSQL.

Redis лучше всего использовать в проектах, где нужна база данных с быстрым доступом к данным и простой схемой.

Чтобы вы могли комфортно использовать эту СУБД в своих проектах, мы подготовили материал по установке Redis на три операционные системы: на Windows, Ubuntu и CentOS. По завершении установки мы настроим Redis, после чего СУБД будет готова к работе.

Базы данных

Redis: установка на Windows

Есть два варианта установки Redis на Windows:

  • установка портированной версии;
  • установка в WSL или Docker.

В этом разделе мы разберем установку портированной версии. Если вы хотите установить в WSL, то:

  • руководство по установке и настройке WSL в Windows 10 вы найдете в материале «Как установить Node.js на Windows» в разделе «Установка WSL»;
  • инструкция по установке на Ubuntu описана чуть ниже в разделе «Установка на Ubuntu».

Портированная версия для Windows вышла довольно давно: в 2016 году. Она размещена на github и доступна для скачивания всем пользователями. Преимущества установки этой версии заключается в её простоте: для установки не потребуется дополнительная «прослойка» в виде Docker или WSL. Выбирайте порт для Windows, если не хотите усложнять процесс установки и вас устраивает 6-летняя версия.

Установка Redis на Windows

Шаг 1 — заходим в репозиторий на GitHub портированной версии по ссылке: https://github.com/microsoftarchive/redis

Шаг 2 — переходим на вкладку «Releases».

Шаг 3 — выбираем последний релиз.

Шаг 4 — скачиваем файл с расширением .msi. На изображении он выделен синим цветом:

Image2

Шаг 5 — после загрузки откройте файл. Начнется установка.

Шаг 6 — во время установки инсталлятор предложит вам добавить Redis в PATH. Если хотите использовать СУБД из командной строки, проставьте галочку напротив этого пункта.

Шаг 7 — во время выбора порта рекомендуется оставить стандартное значение 6379.

Шаг 8 — после установки необходимо перезагрузить компьютер.

После загрузки компьютера проверим работоспособность Redis. Для этого в командной строке выполняем команду redis-server

При её выполнении может возникнуть ошибка со следующим сообщением:

Image7


Проблема заключается в том, что Windows в автоматическом режиме после установки регистрирует службу, к которой привязывает порт 6379. Когда выполняется команда redis-server, исполнитель обращается к файлу конфигурации и использует порт по-умолчанию, т.е. 6379. Из-за этого возникает ошибка.

Чтобы её решить открываем командную строку и делаем следующее:

  • переходим в каталог Redis командой cd;
  • запускаем redis-cli.exe;
  • выключаем сервер командой shutdown;
  • выходим командой exit.

Вот набор команд для стандартного каталога:

Image3

После этих действий команда redis-server успешно выполнилась:

Image1

Настройки Redis описываются в двух файлах: redis.windows.conf и redis.windows-service.conf. 

  1. Redis.windows-service.conf описывает настройки СУБД, запущенной в качестве службы. Этот формат подразумевает работу в фоновом режиме под управлением операционной системы (запуск при перезагрузке, перезапуск при сбоях и т.п).
  2. Redis.windows.conf относится к использованию СУБД из командной строки с помощью redis-cli. Это же относится и к использованию СУБД в своих скриптах.

Настройка этих файлов приведет к изменению работы Redis. В нашем случае настроек минимальное количество: СУБД прослушивает любые подключения. Это не совсем безопасно, поэтому позволим подключение к Redis только с localhost. Для этого в файлах конфигурации находим задокументированную строку #bind 127.0.0.1 и удаляем решетку «#»:

Image5

Установка Redis: Ubuntu 22.04

Устанавливать Redis на Ubuntu мы будем из официального репозитория. Также, эта инструкция подойдет для установки Redis на Debian

Шаг 1 — в первую очередь обновим индексы пакетов apt:

sudo apt update

Шаг 2 — загружаем Redis:

sudo apt install redis-server -y

Проверить работоспособность можно командой sudo systemctl status redis:

Image4

Служба активна. 

Установка Redis: CentOS 7

Устанавливать Redis будем на CentOS 7. В первую очередь установим EPEL (Extra Packages for Enterprise Linux) — это пакет с дополнительными репозиториями, которые не включены в стандартную версию CentOS. Установим их:

sudo yum install epel-release

Теперь мы можем установить redis:

sudo yum install redis -y

Через несколько минут редис будет установлен на компьютер. Чтобы включить редис в автозагрузку, выполняем следующую команду:

sudo systemctl enable redis

Настройка Redis осуществляется через изменение конфигурационных файлов. Они для всех версий будут одинаковыми. Поэтому, для наглядной настройки, мы настроим Redis на операционной системе Ubuntu и удаленно подключимся к ней с Windows.

Для осуществления базовой настройки нам необходимо изменить 2 параметра: открыть удаленное подключение и установить пароль.

Шаг 1 — генерируем пароль:

openssl rand 25 | openssl base64 -A

Вывод:

/37DQhAt5MBq/34Lj24Ppn5LI/UZksAZJQ==

Злоумышленники могут перебирать до 150 тысяч паролей в секунду, поэтому важно выбрать надежный пароль. Копируем полученный результат и переходим к конфигурационному файлу.

Шаг 2 — открываем конфигурационный файл:

sudo nano /etc/redis/redis.conf

Шаг 3 — изменяем конфигурацию.

Найдем в конфигурационном файле строку «bind 127.0.0.1 ::1» и закомментируем её с помощью #. Не закрывая файл, найдем строку «protected-mode yes» и заменим её на «protected-mode no». В раздел «Security» после строки #requirepass foobared добавляем строку со сгенерированным паролем:

requirepass /37DQhAt5MBq/34Lj24Ppn5LI/UZksAZJQ==

Закрываем файл и сохраняем все изменения.

Шаг 4 — перезапускаем Redis, чтобы изменения вступили в силу:

sudo systemctl restart redis.service

Шаг 5 — с помощью netstat проверяем, какие сетевые интерфейсы прослушивает Redis:

sudo netstat -lnp | grep redis

Image6

Шаг 6 — подключаемся удаленно. Попробуем подключиться к базе данных из командной строки Windows:

redis-cli -h 192.168.43.37 -p 6379 -a /37DQhAt5MBq/34Lj24Ppn5LI/UZksAZJQ==

Пропингуем СУБД:

192.168.43.37:6379> ping
PONG

И вставим кортеж:

192.168.43.37:6379> set key test
OK
192.168.43.37:6379> get key
"test"

Redis как DBaaS

DBaaS (database as a service) — это база данных, размещенная в облаке. Этот сервис похож на аренду сервера, только вместо виртуальной машины вы получаете базу данных. Такой вариант обладает рядом преимуществ:

  • меньшее количество административных хлопот: не нужно обновлять СУБД и обслуживать оборудование;
  • легкое масштабирование базы данных: если для вашего проекта потребовалась более производительная БД, то это легко сделать в панели управления;
  • быстрый старт: СУБД будет установлена на старте;
  • бесперебойная работа.

Заключение

В Timeweb.cloud есть услуга «Облачные базы данных» — уже готовое и настроенное решение. Если вы не хотите отягощать себя административными манипуляциями, то вы можете арендовать базу данных на Redis у Timeweb Cloud. Помимо Redis, Timeweb Cloud может предложить в качестве СУБД MySQL, PostgreSQL и MongoDB.

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

«License» shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

«Licensor» shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

«Legal Entity» shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
«control» means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

«You» (or «Your») shall mean an individual or Legal Entity
exercising permissions granted by this License.

«Source» form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

«Object» form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

«Work» shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

«Derivative Works» shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

«Contribution» shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, «submitted»
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as «Not a Contribution.»

«Contributor» shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a «NOTICE» text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an «AS IS» BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets «[]»
replaced with your own identifying information. (Don’t include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same «printed page» as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the «License»);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an «AS IS» BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Соно не запускается на windows 10
  • Raspberry pi pico sdk для windows
  • Как выключить dhcp на windows 10
  • Discord canary download windows
  • Как зайти в безопасности режим windows 10 на ноутбуке