问题
I have this django locator project deployed in azure. My redis cache host name(DNS) is mycompany.azure.microsoft.net. I created it in azure, but not sure where i can find the password for the redis server. I have got this as my configuration in my settings.py. I am using redis as a broker for my celery setup in project.
BROKER_URL = 'redis://:passwordAzureAccessKey=@mycompany.redis.cache.windows.net:6380/0'
I could not connect. Is there anyplace different, I need to put password or username to connect to the above server ? Also where can i find the password in Azure. Or is it due to the fact that I am trying to contact the Azure redis from localhost ?
回答1:
You can find your redis services keys in Azure portal, click Settings=>Access keys, you can select either primary or secondary key as your password in the redis connection string.
And addtionally, you can try to enable the non-ssl endpoint of your redis service, as mentioned at https://azure.microsoft.com/en-us/documentation/articles/cache-python-get-started/#enable-the-non-ssl-endpoint.
It seems that you are using celery
, you can use celery cli command to test your redis serivice. E.G.
celery inspect ping -b redis://:{password}@{redis_service_name}.redis.cache.wi
ndows.net:6379/0
来源:https://stackoverflow.com/questions/39616701/how-to-configure-celery-redis-in-django-project-on-microsoft-azure