我刚刚在美国西部创建了一个地址空间为10.0.0.0/16的新VNET,但在Azure门户网站上发出警告说,地址空间'10 .0.0.0/16'与虚拟网络xxx中的'10 .0.0.0/16'重叠.VNET xxx之前是在另一个地区创建的.
这真的是一个问题吗?
我使用事件中心处理器主机来接收和处理来自事件中心的事件。为了获得更好的性能,我每 3 分钟调用一次检查点,而不是每次接收事件时调用检查点:
public async Task ProcessEventAsync(context, messages)
{
foreach (var eventData in messages)
{
// do something
}
if (checkpointStopWatth.Elapsed > TimeSpan.FromMinutes(3);
{
await context.CheckpointAsync();
}
}
Run Code Online (Sandbox Code Playgroud)
但问题是,如果没有新事件发送到事件中心,可能有些事件永远不会成为检查点,因为如果没有新消息,则不会调用 ProcessEventAsync。
有什么建议可以确保所有处理的事件都是检查点,但仍然每隔几分钟检查点?
更新:根据 Sreeram 的建议,我更新了代码,如下所示:
public async Task ProcessEventAsync(context, messages)
{
foreach (var eventData in messages)
{
// do something
}
this.lastProcessedEventsCount += messages.Count();
if (this.checkpointStopWatth.Elapsed > TimeSpan.FromMinutes(3);
{
this.checkpointStopWatch.Restart();
if (this.lastProcessedEventsCount > 0)
{
await context.CheckpointAsync();
this.lastProcessedEventsCount = 0;
}
}
}
Run Code Online (Sandbox Code Playgroud) 我需要您在实际场景中的索引设计方面的帮助。这可能是一个很长的问题,让我尝试尽可能简洁地解释它。
我们正在构建一个基于 Elasticsearch 的搜索平台,为我们的客户提供站点搜索体验,索引中的文档可能是这样的:
{ "Path":"http://www.foo.com/doc/abc/1", "Title":"Title 1", "Description":"The description of doc 1", ... }
{ "Path":"http://www.foo.com/doc/abc/2", "Title":"Title 2", "Description":"The description of doc 2", ... }
{ "Path":"http://www.foo.com/doc/abc/3", "Title":"Title 3", "Description":"The description of doc 3", ... }
...
Run Code Online (Sandbox Code Playgroud)
对于每个查询,返回的命中文档默认按相关性排序,但我们的客户还希望针对某些关键字提升某些特定文档,
它们为我们提供了以下内容,例如提升配置 XML:
<boost>
<Keywords value="keyword1">
<Path rank="10000">http://www.foo.com/doc/abc/1</Path>
</Keywords>
<Keywords value="keyword2">
<Path rank="10000">http://www.foo.com/doc/abc/2</Path>
<Path rank="9900">http://www.foo.com/doc/abc/1</Path>
</Keywords>
<Keywords value="keyword3">
<Path rank="10000">http://www.foo.com/doc/abc/3</Path>
<Path rank="9900">http://www.foo.com/doc/abc/2</Path>
<Path rank="9800">http://www.foo.com/doc/abc/1</Path>
</Keywords>
</boost>
Run Code Online (Sandbox Code Playgroud)
这意味着,如果用户搜索“keyword1”,则前 1 个命中的文档应该是 Path 字段值为“ www.foo.com/doc/abc/1 ”的文档,而不管该文档的相关性得分如何。类似地,如果搜索“KEYWORD3”,前3命中文件应是其路径值为“文件www.foo.com/doc/abc/3 ”,“ www.foo.com/doc/abc/2 ”和“ www.foo。 com/doc/abc/1 " 分别。
为了满足这个特殊的需求,我的设计是,首先将原来的boosting …
在我的EventHub处理器中,我得到了Microsoft.ServiceBus.Messaging.LeaseLostException的例外.
这个例外是什么意思?这个例外可能的根本原因是什么?
以下是堆栈跟踪:
在Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__24.MoveNext()\ r \n ---从抛出异常的上一个位置的堆栈跟踪结束---\r \n在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)\ r \n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)\ r \n在Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__25.MoveNext()\ r \n ---堆栈跟踪结束从抛出异常的先前位置---\r \n在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)\ r \n在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)\ r \n
在MyEventHub.EventProcessor`1.d__6.MoveNext()\ r \n\r \nMicrosoft.WindowsAzure.Storage.StorageException:\"远程服务器返回错误:(409)冲突.\":
at c:\ Program Files(x86)\ Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs中的Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync [T](IAsyncResult result):line 60\r \n在Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<> c__DisplayClass4.b__3(IAsyncResult ar)在c:\ Program Files(x86)\ Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\AsyncExtensions.cs:第115行\ r \n ---从抛出异常的上一个位置开始的堆栈跟踪结束---\r \n在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)\ r \n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)\ r \n在Microsoft.ServiceBus.Messaging.BlobLeaseManager.d__24.MoveNext()\ r \n\r \n \nSystem.Net.WebException:\"远程服务器返回错误:(409)冲突.\":在Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException [T](HttpStatusCo)de expectedStatusCode,HttpStatusCode actualStatusCode,T retVal,StorageCommandBase 1 cmd, Exception ex) in c:\\Program Files (x86)\\Jenkins\\workspace\\release_dotnet_master\\Lib\\Common\\Shared\\Protocol\\HttpResponseParsers.Common.cs:line 50\r\n
at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.<>c__DisplayClass33.<RenewLeaseImpl>b__32(RESTCommand
1 cmd,HttpWebResponse resp,Exception ex,OperationContext ctx)在c:\ Program Files(x86)\ Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlob.cs:line 3186\r \n在c:\ Program …
我有一个 .Net core Web App API,它接受来自前端的请求,然后将 HTTP POST 请求发送到 Azure 搜索以获取搜索结果。
我只是使用内置应用程序洞察记录请求和依赖项源中的基本信息,并且具有零日志记录代码。
现在,我想扩展默认的 Application Insights 依赖项表以将请求正文添加到 Azure 搜索。
用最少的代码最简单的方法是什么?
我正在使用按查询更新插件(https://github.com/yakaz/elasticsearch-action-updatebyquery/)按查询更新文档。就我而言,文档中有嵌套字段,映射是这样的:
"mappings": {
"mytype": {
"properties": {
"Myfield1": {
"type": "nested",
"properties": {
"field1": {
"type": "string"
},
"field2": {
"type": "long"
}
}
},
"Title": {
"type": "string"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
然后我想Myfield1
通过以下请求通过查询更新嵌套字段:
但不幸的是,它不起作用。
{
"query": {
"match": {
"Title": "elasticsearch"
}
},
"script": "ctx._source.Myfield1 = [{'nestfield1':'foo blabla...','nestfield2':100},{'nestfield1':'abc...','nestfield2':200}]"
}
Run Code Online (Sandbox Code Playgroud)
按查询更新是否支持嵌套对象?
顺便说一句:还有其他方法可以通过查询更新文档吗?
查询插件更新是唯一的选择吗?
我正在将我的一些云服务Web /工作者角色迁移到服务结构中。
将有许多(大约5个以上)服务结构服务(无状态或有状态)。我们应该将它们全部放入一个或多个服务结构集群吗?是否有关于集群计划的最佳实践?
另外,我将在我的服务上添加多租户支持。根据此Service Fabric多租户,我可以根据客户模式选择应用程序实例。
我想知道按客户模式选择集群是否是个好主意?