Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to wipe Heroku Redis?

Tags:

redis

heroku

I have some information stored in my RedisToGo instance in Heroku and I want to wipe it so the Redis store is clean. Any idea how to do this?

like image 845
kidcapital Avatar asked Feb 04 '12 01:02

kidcapital


People also ask

How do I wipe Redis?

Redis Commands There are two major commands to delete the keys present in Redis: FLUSHDB and FLUSHALL. We can use the Redis CLI to execute these commands. The FLUSHDB command deletes the keys in a database. And the FLUSHALL command deletes all keys in all databases.

Is heroku Redis persistent?

Persistence. The hobby tier for Heroku Data for Redis doesn't persist instance data. If the instance must reboot or a failure occurs, the data on instance is lost.

Is heroku Redis free?

Reliable and powerful Redis as a service. Starting at $0/mo.

How connect heroku to Redis?

To connect from an external system or client, retrieve the Redis connection string using either of the following methods: Running the heroku redis:credentials CLI command (for more information, see redis:credentials) Inspecting your app's config vars by running the command heroku config:get REDIS_URL -a example-app .


2 Answers

You can do this with redis-cli.

RedisToGo gives you a url in the form:

redis://redistogo:[email protected]:9402 

So this command will empty your db:

redis-cli -h catfish.redistogo.com -p 9402 -a d20739cffb0c0a6fff719acc2728c236 flushall 
like image 97
ty. Avatar answered Sep 24 '22 19:09

ty.


You can install the heroku-redis-cli plugin

Installation

Requirements:

  • The heroku gem — gem install heroku

  • A local installation of redis (or at least the redis-cli utility) — apt-get install redis-server

To install:

  • heroku plugins:install https://github.com/rapportive-oss/heroku-redis-cli.git

Usage

  • heroku redis:info — get run-time statistics from your redis.

  • heroku redis:monitor — monitor commands being sent to your redis in real time.

  • heroku redis:cli — execute custom commands against redis.

Then you could simply do:

$ heroku redis:cli $ flushall 

Steps taken from readme file on the github repo: https://github.com/rapportive-oss/heroku-redis-cli

like image 26
esbanarango Avatar answered Sep 25 '22 19:09

esbanarango