[英]How to simulate Azure Cosmos DB and Azure Redis regional failure scenarios using reverse proxy mechanism?
To simulate regional failure, using Fiddler below custom rules has been created under "OnBeforeResponse" function.为了模拟区域故障,在“OnBeforeResponse”function 下创建了自定义规则下方的 Fiddler。
I can able to intercept http calls to Azure storage account successfully and able to inject failed response where as https calls to Azure Cosmos DB calls I can't able to intercept why? I can able to intercept http calls to Azure storage account successfully and able to inject failed response where as https calls to Azure Cosmos DB calls I can't able to intercept why? Am I missing anything?
我错过了什么吗?
I can't even able to intercept Azure redis related calls but I can understand the reason that Redis is not using HTTP communication but why I cant able to intercept https calls to Azure Cosmos DB calls, no idea and needs expertise opinion. I can't even able to intercept Azure redis related calls but I can understand the reason that Redis is not using HTTP communication but why I cant able to intercept https calls to Azure Cosmos DB calls, no idea and needs expertise opinion.
Also need advice on how to intercept Redis calls and to inject artificial failure response code?还需要有关如何拦截 Redis 调用和注入人工故障响应代码的建议? to simulate Azure Redis regional failure situation.
模拟Azure Redis区域故障情况。
static function OnBeforeResponse(oSession: Session) {
if (m_Hide304s && oSession.responseCode == 304) {
oSession["ui-hide"] = "true";
}
// az storage account call manipulated response
if (oSession.hostname == "mystorageaccount.blob.core.windows.net")
{
oSession.responseCode = 503;
}
// az cosmos db account call manipulated response -- not working
if (oSession.hostname == "mydocdb.documents.azure.com")
{
oSession.responseCode = 503;
}
// az redis call manipulated response -- not working
if (oSession.hostname == "myrediscache.redis.cache.windows.net")
{
oSession.responseCode = 503;
}
PS: At the moment we are using cosmos db SDK v2 whether cosmos db SDK v2 by default uses HTTP or TCP? PS: At the moment we are using cosmos db SDK v2 whether cosmos db SDK v2 by default uses HTTP or TCP? as per fiddler it is HTTP.
根据提琴手,它是 HTTP。
I don't know what Redis does but you can do failover testing in Cosmos by manually failing a region over to your secondary region.我不知道 Redis 做了什么,但您可以通过手动将区域故障转移到辅助区域来在 Cosmos 中进行故障转移测试。 This can be done in the portal or with PS, CLI, Templates or using Azure Management SDK.
这可以在门户中或使用 PS、CLI、模板或使用 Azure 管理 SDK 来完成。
Can learn more here, Perform a manual failover on a Cosmos DB account可以在此处了解更多信息, 对 Cosmos DB 帐户执行手动故障转移
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.