本文介绍了如何在Microsoft Azure的Django项目中配置celery-redis?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在azure中部署了这个django locator项目。我的Redis缓存主机名(DNS)是mycompany.azure.microsoft.net。我以天蓝色创建它,但是不确定在哪里可以找到redis服务器的密码。我在settings.py中将其作为配置。我正在使用redis作为项目中我的芹菜设置的代理。

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://:[email protected]:6380/0'

我无法连接。是否有其他地方,我需要输入密码或用户名才能连接到上述服务器?此外,我在哪里可以找到Azure中的密码。还是由于我试图从本地主机联系Azure Redis?

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 ?

推荐答案

您可以找到您的Redis服务在Azure门户中,单击设置 => 访问键,可以在redis连接字符串中选择主键或辅助键作为密码。

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.

此外,您可以尝试启用redis服务的non-ssl端点,如 https:/ /azure.microsoft.com/zh-CN/documentation/articles/cache-python-get-started/#enable-the-non-ssl-endpoint 。

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.

似乎您正在使用 celery ,可以使用celery cli命令来测试您的redis服务。 EG

It seems that you are using celery, you can use celery cli command to test your redis serivice. E.G.

芹菜检查ping -b redis://:{password} @ {redis_service_name} .redis.cache.wi
ndows .net:6379/0

这篇关于如何在Microsoft Azure的Django项目中配置celery-redis?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 03:55