Redis timeseries with python : ResponseError: unknown command 'TS.CREATE'
Asked Answered
N

1

5

I am trying to create a timeseries in Redis using python like so:

    import redis
    connection_redis = redis.Redis(host='127.0.0.1', port=6379)
    connection_redis.ts().create('ts', retention_msecs=0)

but I get the following error: ResponseError: unknown command 'TS.CREATE'.

I have been searching for a way to solve this problem but I haven't found anything. I am running redis in a docker.

Thank you :)!

Nonrepresentational answered 27/7, 2022 at 9:8 Comment(0)
D
8

The Redis docker image does not contain any Redis module.

You can use the Redis Stack docker image.

redis/redis-stack-server contains the RediSearch, RedisJSON, RedisGraph, RedisTimeSeries, and RedisBloom modules. redis/redis-stack also contains RedisInsight.

Update, October 2024

From a Redis Blog Post:

Redis 8 introduces seven new data structures —JSON, time series, and five probabilistic types— along with the fastest and most scalable Redis query engine to date. These capabilities, previously only available separately through Redis Stack or our Software and Cloud offerings, are now built natively into Redis Community Edition.

You can now simply use Redis docker image (version 8.0-M01 or later).

Distribution answered 27/7, 2022 at 9:44 Comment(1)
I'm using redis/redis-stack-server:7.4.0-v0, still getting the error.Exportation

© 2022 - 2024 — McMap. All rights reserved.