How to use the Redis command-line tool with Azure Cache for Redis in windows Machine
How to use the Redis command-line tool with Azure Cache for Redis in windows Machine
- Redis cli 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.
Use the Redis command-line tool with Azure Cache for Redis in windows
Once you installed the redis cli (it is by default installed in C:\Program Files\Redis) .Before connecting to the azure redis cache you need 3 parameters those are
- Azure redis cache hostname
- Azure redics cache port 6379(without ssl) 6380 with ssl access
- Azure redis cache access keys
To Get the Azure Redis properties follow the below screenshots
Once you get the 3 properties just go to the installation directly of redis cli and type the below command.
redis-cli.exe -h Your hostname -p 6379 -a you access key
Once it is done you are connected to cloud azure redis cache.
Most used commands in redis cli
DEL key : This command deletes the key, if it exists.
DEL KEY_NAME
DUMP key : This command returns a serialized version of the value stored at the specified key.
DUMP KEY_NAME
EXISTS key : This command checks whether the key exists or not.
EXISTS KEY_NAME
EXPIRE key seconds : Sets the expiry of the key after the specified time.
Expire KEY_NAME TIME_IN_SECONDS
EXPIREAT key timestamp : Sets the expiry of the key after the specified time. Here time is in Unix timestamp format.
Expireat KEY_NAME TIME_IN_UNIX_TIMESTAMP
PEXPIRE key milliseconds : Set the expiry of key in milliseconds.
PEXPIRE KEY_NAME TIME_IN_MILLISECONDS
PEXPIREAT key milliseconds-timestamp : Sets the expiry of the key in Unix timestamp specified as milliseconds.
PEXPIREAT KEY_NAME TIME_IN_MILLISECONDS_IN_UNIX_TIMESTAMP
KEYS pattern : Finds all keys matching the specified pattern.
KEYS PATTERN
MOVE key db : Moves a key to another database.
MOVE KEY_NAME DESTINATION_DATABASE
PERSIST key : Removes the expiration from the key.
SET Name redis
PTTL key : Gets the remaining time in keys expiry in milliseconds.
SET Nmae redis
TTL key : Gets the remaining time in keys expiry.
TTL KEY_NAME
RANDOMKEY : Returns a random key from Redis.
RANDOMKEY
RENAME key newkey : Changes the key name.
RENAME OLD_KEY_NAME NEW_KEY_NAME
RENAMENX key newkey : Renames the key, if a new key doesn't exist.
RENAMENX OLD_KEY_NAME NEW_KEY_NAME
TYPE key : Returns the data type of the value stored in the key.
TYPE KEY_NAME
Nice explanation thanks for the article.
ReplyDeleteThank You for your Feedback
DeleteIf you are looking for any kind of software so you must this website get into pc
ReplyDeleteJumpinggoose.com, a premier digital marketing agency specializing in branding and brand building, is making waves in the industry by providing top-notch services to fashion and lifestyle brands looking to amplify their online presence.
ReplyDeleteWebsite: Jumpinggoose.com