I just signed up for the free account on RedisLabs.com. I got the endpoint from their website after getting it set up (by clicking "Database" on left hamburger/drop-down menu), then clicking the "checkbox" to the right of my database/server, then there was a field called "endpoint". Best I can tell, it is up and running; I didn't see and start/stop, or enable/disable. My database (or server?) name is just "Demo"; I don't think I need to specify that in the Python code as long as as I have the endpoint, correct?
I couldn't find any place I was supposed to whitelist IP Addreses, but suspect that might be the issue. Since the host was after the colon on the end, I didn't specify "host=" in my connection in the code below.
My Python test program (I used the endpoint they gave me, but in the code below I just put their sample one).
import redis
import json
import pprint
host_info = "redis.us-east-1-1.ec2.cloud.redislabs.com:18274"
redisObj = redis.Redis(host=host_info, password='xxx')
capitals = {
"Lebanon": "Beirut",
"Norway": "Oslo",
"France": "Paris"
}
print ("capitals - before call to Redis")
pprint.pprint(capitals)
print ("call to Redis")
redisObj.execute_command('JSON.SET', 'doc', ',', json.dumps(capitals))
print("Data Saved, now fetch data back from redis")
reply = json.loads(redisObj.execute_command('JSON.GET', 'doc'))
print ("reply from Redis get")
pprint.pprint(reply)
Error:
File "C:\Users\nwalt\.virtualenvs\TDAmeritradeGetQuotes\lib\site-packages\redis\connection.py", line 563, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 11001 connecting to redis.us-east-1-1.ec2.cloud.redislabs.com:18274:6379. getaddrinfo failed.
From the command line, I also tried: redis-cli -h redis.us-east-1-1.ec2.cloud.redislabs.com:18274
It gives error: Could connect to Redis at ..... can't resolve: ....