你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzRedisCacheLink
获取 Redis 缓存的异地复制链接。
语法
Get-AzRedisCacheLink
-Name <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzRedisCacheLink
-PrimaryServerName <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzRedisCacheLink
-PrimaryServerName <String>
-SecondaryServerName <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzRedisCacheLink
-SecondaryServerName <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
可通过四种不同的方式获取异地复制链接详细信息。 提供参数名称或 PrimaryServerName 和/或 SecondaryServerName。 此时会提供名称,然后返回缓存存在的所有链接。 如果仅提供 PrimaryServerName,则将返回缓存是主节点的所有链接。 如果仅提供 SecondaryServerName,则返回缓存为辅助位置的所有链接。 如果同时提供 PrimaryServerName 和 SecondaryServerName,则会返回具有正确角色的特定链接。
示例
示例 1:使用参数集 AllLinksForCache
Get-AzRedisCacheLink -Name "mycache1"
PrimaryServerName : mycache1
SecondaryServerName : mycache2
ProvisioningState : Succeeded
LinkedRedisCacheLocation : East US
ServerRole : Secondary
PrimaryHostName : mycache1.redis.cache.windows.net
GeoReplicatedPrimaryHostName : mycache2.geo.redis.cache.windows.net
此命令获取名为 mycache1 的 Redis 缓存的所有异地复制链接。
示例 2:使用参数集 AllLinksForPrimaryCache
Get-AzRedisCacheLink -PrimaryServerName "mycache1"
PrimaryServerName : mycache1
SecondaryServerName : mycache2
ProvisioningState : Succeeded
LinkedRedisCacheLocation : East US
ServerRole : Secondary
PrimaryHostName : mycache1.redis.cache.windows.net
GeoReplicatedPrimaryHostName : mycache2.geo.redis.cache.windows.net
此命令获取名为 mycache1 的 Redis 缓存是主要位置的异地复制链接。
示例 3:使用参数集 AllLinksForSecondaryCache
Get-AzRedisCacheLink -SecondaryServerName "mycache2"
PrimaryServerName : mycache1
SecondaryServerName : mycache2
ProvisioningState : Succeeded
LinkedRedisCacheLocation : East US
ServerRole : Secondary
PrimaryHostName : mycache1.redis.cache.windows.net
GeoReplicatedPrimaryHostName : mycache2.geo.redis.cache.windows.net
此命令获取名为 mycache2 的 Redis 缓存是辅助位置的异地复制链接。
示例 4:使用参数集 SingleLink
Get-AzRedisCacheLink -PrimaryServerName "mycache1" -SecondaryServerName "mycache2"
PrimaryServerName : mycache1
SecondaryServerName : mycache2
ProvisioningState : Succeeded
LinkedRedisCacheLocation : East US
ServerRole : Secondary
PrimaryHostName : mycache1.redis.cache.windows.net
GeoReplicatedPrimaryHostName : mycache2.geo.redis.cache.windows.net
此命令获取一个异地复制链接,其中名为 mycache1 的 Redis 缓存是主要缓存,名为 mycache2 的 Redis 缓存是辅助缓存。
参数
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
redis 缓存的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-PrimaryServerName
链接中主要 redis 缓存的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-SecondaryServerName
链接中的辅助 redis 缓存的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |