redis_open()

Read(5095) Label: redis database connection,

Description:

Connect to the Redis database.

Syntax:

redis_open(url,password)

Note:

The RedisCli external library function (See External Library Guide) connects to the Redis database according to the Redis server’s URL. According to different deployment mode – Standalone mode, Sentinel mode, Cluster mode, you can select the corresponding connection type.

Parameter:

url 

A Redis server’s URL.

password

The password to access the Redis server

Return value:

Cursor

Example:

 

A

 

1

=redis_open("127.0.0.1:6379","000000")

Connect to Redis external library via the standalone mode.

2

=redis_open("sentinel://mymaster@127.0.0.1:26379,127.0.0.1:26380", "rootpwd")

The Sentinel mode connection.

3

=redis_open("cluster://127.0.0.1:6380,127.0.0.1:6381,127.0.0.1:6382", "rootpwd")

The Cluster mode connection.