Skip to content

Commit a15870f

Browse files
Merge pull request #262507 from flang-msft/fxl-patch-51
Fxl---Revamped page to modernize and include Linux - US 26211256
2 parents 66d20d1 + 06b27a9 commit a15870f

File tree

5 files changed

+96
-66
lines changed

5 files changed

+96
-66
lines changed

articles/azure-cache-for-redis/cache-administration.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ author: flang-msft
55

66
ms.service: cache
77
ms.topic: conceptual
8-
ms.date: 09/29/2023
8+
ms.date: 01/05/2024
99
ms.author: franlanglois
1010
---
1111
# How to administer Azure Cache for Redis
1212

1313
This article describes how to do administration tasks such as [rebooting](#reboot) and [Update channel and Schedule updates](#update-channel-and-schedule-updates) for your Azure Cache for Redis instances.
1414

15-
[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)]
16-
1715
## Reboot
1816

1917
On the left, **Reboot** allows you to reboot one or more nodes of your cache. This reboot capability enables you to test your application for resiliency if there's a failure of a cache node.

articles/azure-cache-for-redis/cache-how-to-manage-redis-cache-powershell.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ ms.custom: devx-track-azurepowershell
1515
> [!div class="op_single_selector"]
1616
> * [PowerShell](cache-how-to-manage-redis-cache-powershell.md)
1717
> * [Azure CLI](cache-manage-cli.md)
18-
>
18+
>
1919
20-
[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)]
2120

2221
This article shows you how to create, update, and scale your Azure Cache for Redis instances. The article also shows how to regenerate access keys, and how to view information about your caches. For a complete list of Azure Cache for Redis PowerShell cmdlets, see [Azure Cache for Redis cmdlets](/powershell/module/az.rediscache).
2322

Lines changed: 75 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,114 @@
11
---
22
title: Use redis-cli with Azure Cache for Redis
3-
description: Learn how to use *redis-cli.exe* as a command-line tool for interacting with an Azure Cache for Redis as a client
3+
description: Learn how to use *redis-cli* as a command-line tool for interacting with an Azure Cache for Redis as a client
44
author: flang-msft
55
ms.author: franlanglois
66
ms.service: cache
77
ms.topic: conceptual
8-
ms.date: 01/25/2022
8+
ms.date: 01/04/2024
99
---
1010
# Use the Redis command-line tool with Azure Cache for Redis
1111

12-
Use the popular `redis-cli.exe` command-line tool to interact with an Azure Cache for Redis as a client. The tool is available for Windows platforms by downloading the [Redis command-line tools for Windows](https://github.com/MSOpenTech/redis/releases/).
12+
Use the [redis-cli command-line tool](https://redis.io/docs/connect/cli/) to interact with an Azure Cache for Redis as a client. Use this tool to directly interact with your Azure Cache for Redis instance and for debugging and troubleshooting.
1313

14-
If you want to run the command-line tool on another platform, download open-source Redis from [https://redis.io/download](https://redis.io/download).
14+
## Install redis-cli
1515

16-
## Gather cache access information
16+
The _redis-cli_ tool is installed automatically with the _Redis package_, which is available for multiple operating systems. See the open source [install Redis](https://redis.io/docs/install/install-redis/) guide for the most detailed documentation on your preferred operating system.
17+
18+
### Linux
19+
20+
The _redis-cli_ runs natively on Linux, and most distributions include a _Redis package_ that contains the _redis-cli_ tool. On Ubuntu, for instance, you install the _Redis package_ with the following commands:
1721

18-
[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)]
22+
```linux
23+
sudo apt-get update
24+
sudo apt-get install redis
25+
```
26+
27+
### Windows
1928

20-
You can gather the information needed to access the cache using three methods:
29+
The best way to use _redis-cli_ on a Windows computer is to install the [Windows Subsystem for Linux (WSL)](/windows/wsl/about). The Linux subsystem allows you to run linux tools directly on Windows. To install WSL, follow the [WSL installation instructions](/windows/wsl/install).
2130

22-
1. Azure CLI using [az redis list-keys](/cli/azure/redis#az-redis-list-keys)
23-
2. Azure PowerShell using [Get-AzRedisCacheKey](/powershell/module/az.rediscache/Get-AzRedisCacheKey)
24-
3. Using the Azure portal
31+
Once WSL is installed, you can install _redis-cli_ using whatever package management is available in the Linux distro you chose for WSL.
32+
33+
## Gather cache access information
34+
35+
You can gather the information needed to access the cache using these methods:
36+
37+
- Azure CLI using [az redis list-keys](/cli/azure/redis#az-redis-list-keys)
38+
- Azure PowerShell using [Get-AzRedisCacheKey](/powershell/module/az.rediscache/Get-AzRedisCacheKey)
39+
- Using the Azure portal
2540

2641
In this section, you retrieve the keys from the Azure portal.
2742

2843
[!INCLUDE [redis-cache-create](includes/redis-cache-access-keys.md)]
2944

30-
## Enable access for redis-cli.exe
45+
## Connect using redis-cli
3146

32-
With Azure Cache for Redis, only the TLS port (6380) is enabled by default. The `redis-cli.exe` command-line tool doesn't support TLS. You have two configuration choices to use it:
47+
Open up a shell or terminal on a computer with the _Redis package_ installed. If using WSL, you can [use the Windows Terminal](/windows/wsl/install#ways-to-run-multiple-linux-distributions-with-wsl) to open a Linux command line. Before connecting with redis-cli, check:
3348

34-
1. [Enable the non-TLS port (6379)](cache-configure.md#access-ports) - **This configuration is not recommended** because in this configuration, the access keys are sent via TCP in clear text. This change can compromise access to your cache. The only scenario where you might consider this configuration is when you’re just accessing a test cache.
49+
1. Whether TLS access is needed - By default, Azure Cache for Redis instances use [TLS](cache-remove-tls-10-11.md) encryption for connections. Whenever TLS is used on the server side, TLS on redis-cli must be enabled using the `--tls` option.
50+
1. The port used - All Enterprise and Enterprise Flash tier caches use port `10000`. Basic, Standard, and Premium tier caches, however, use either port `6379` for non-TLS connections or port `6380` for TLS connections.
51+
1. Whether the cache instance uses clustering - If you're using a Premium tier cache that uses clustering or an Enterprise/Enterprise Flash tier cache that is using OSS cluster policy, add the `-c`option to ensure all shards can be accessed.
3552

36-
2. Download and install [stunnel](https://www.stunnel.org/downloads.html).
53+
### Examples
3754

38-
Run **stunnel GUI Start** to start the server.
55+
1. Use the following command to connect to a Basic, Standard, or Premium tier Azure Cache for Redis instance using TLS:
3956

40-
Right-click the taskbar icon for the *stunnel* server and select **Show Log Window**.
57+
```console
58+
redis-cli.exe -p 6380 -h yourcachename.redis.cache.windows.net -a YourAccessKey --tls
59+
```
4160

42-
On the *stunnel* Log Window menu, select **Configuration** > **Edit Configuration** to open the current configuration file.
61+
1. Connect to a Basic, Standard, or Premium tier Azure Cache for Redis instance that doesn't use TLS:
4362

44-
Add the following entry for `redis-cli.exe` under the **Service definitions** section. Insert your actual cache name in place of `yourcachename`.
63+
```console
64+
redis-cli.exe -p 6379 -h yourcachename.redis.cache.windows.net -a YourAccessKey
65+
```
4566

46-
```properties
47-
[redis-cli]
48-
client = yes
49-
accept = 127.0.0.1:6380
50-
connect = yourcachename.redis.cache.windows.net:6380
67+
1. Connect to a Basic, Standard, or Premium tier Azure Cache for Redis instance using TLS and clustering:
68+
69+
```console
70+
redis-cli.exe -p 6380 -h yourcachename.redis.cache.windows.net -a YourAccessKey --tls -c
5171
```
5272

53-
Save and close the configuration file.
54-
55-
On the stunnel Log Window menu, select **Configuration** > **Reload Configuration**.
73+
1. Connect to an Enterprise or Enterprise Flash tier cache instance using Enterprise cluster policy with TLS:
5674

57-
## Connect using the Redis command-line tool.
75+
```console
76+
redis-cli.exe -p 10000 -h yourcachename.eastus.redisenterprise.cache.azure.net -a YourAccessKey --tls
77+
```
5878

59-
When using *stunnel*, run `redis-cli.exe`, and pass only your *port*, and *access key* (primary or secondary) to connect to the cache.
79+
1. Connect to an Enterprise or Enterprise Flash tier cache instance using OSS cluster policy without TLS:
6080

61-
```console
62-
redis-cli.exe -p 6380 -a YourAccessKey
63-
```
81+
```console
82+
redis-cli.exe -p 10000 -h yourcachename.eastus.redisenterprise.cache.azure.net -a YourAccessKey -c
83+
```
84+
85+
### Testing the connection
6486

65-
![Screenshot that shows that your connection to the cache is successful.](media/cache-how-to-redis-cli-tool/cache-redis-cli-stunnel.png)
87+
Once the connection is established, you can issue commands to your Azure Cache for Redis instance. One easy way to test the connection is to use the [`PING`](https://redis.io/commands/ping/) command. This command returns `PONG` in the console.
6688

67-
If you're using a test cache with the **unsecure** non-TLS port, run `redis-cli.exe` and pass your *host name*, *port*, and *access key* (primary or secondary) to connect to the test cache.
89+
```output
90+
yourcachename.redis.cache.windows.net:6380> PING
91+
PONG
92+
```
93+
94+
You can also run commands like `SET` and `GET`:
6895

69-
```console
70-
redis-cli.exe -h yourcachename.redis.cache.windows.net -p 6379 -a YourAccessKey
96+
```output
97+
yourcachename.redis.cache.windows.net:6380> SET hello world
98+
OK
99+
yourcachename.redis.cache.windows.net:6380> GET hello
100+
"world"
71101
```
72102

73-
![stunnel with redis-cli](media/cache-how-to-redis-cli-tool/cache-redis-cli-non-ssl.png)
103+
You're now connected to your Azure Cache for Redis instance using the _redis-cli_.
104+
105+
## redis-cli alternatives
106+
107+
While the _redis-cli_ is a useful tool, you can connect to your cache in other ways for troubleshooting or testing:
108+
109+
- Azure Cache for Redis offers a [Redis Console](cache-configure.md#redis-console) built into the Azure portal where you can issue commands without needing to install the command-line tool. The Redis Console feature is currently only available in the Basic, Standard, and Premium tiers.
110+
- [RedisInsight](https://redis.com/redis-enterprise/redis-insight/) is a rich open source graphical tool for issuing Redis commands and viewing the contents of a Redis instance. It works with Azure Cache for Redis and is supported on Linux, Windows, and macOS.
74111

75-
## Next steps
112+
## Related content
76113

77-
Learn more about using the [Redis Console](cache-configure.md#redis-console) to issue commands.
114+
Get started by creating a [new Enterprise-tier cache](quickstart-create-redis-enterprise.md) instance.

0 commit comments

Comments
 (0)