내가 리눅스 서비스 패브릭 클러스터를 시도하면 다음과 같은 오류서비스 패브릭 패키지 활성화 오류
Error event: SourceId='System.Hosting',
Property='CodePackageActivation:Code:EntryPoint'.
There was an error during CodePackage activation.Service host failed to activate. Error:0x800700c1`
얻기 오류가 일부 변경됩니다. 그래서 Windows 클러스터는 entyPoint.sh 스크립트에서 실패합니다. 창에는 bash가 없습니다. 리눅스 클러스터는 초기화 코드의 어딘가에서 실패 했음에도 불구하고 겉으로 드러나지 만 여전히 찾을 수는 없다. 나는
<ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048"/>
을 추가 그리고 리눅스 박스에서 모든 로그를 다운로드했지만 거기에 콘솔에서 아무것도 표시되지.
Error event: SourceId='System.Hosting',
Property='CodePackageActivation:Code:EntryPoint'.
There was an error during CodePackage activation.The service host terminated with exit code:134
시작 클래스는
namespace MyApp
{
using System.Collections.Generic;
using System.Fabric;
using System.IO;
using System.Net.Http;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.ServiceFabric.Services.Communication.AspNetCore;
using Microsoft.ServiceFabric.Services.Communication.Runtime;
using Microsoft.ServiceFabric.Services.Runtime;
/// <summary>
/// The FabricRuntime creates an instance of this class for each service type instance.
/// </summary>
internal sealed class MyApp : StatelessService
{
public MyApp(StatelessServiceContext context)
: base(context)
{
}
/// <summary>
/// Optional override to create listeners (like tcp, http) for this service instance.
/// </summary>
/// <returns>The collection of listeners.</returns>
protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners()
{
return new ServiceInstanceListener[]
{
new ServiceInstanceListener(
serviceContext =>
new KestrelCommunicationListener(
serviceContext,
"ServiceEndpoint",
(url, listener) =>
{
ServiceEventSource.Current.ServiceMessage(serviceContext, $"Starting WebListener on {url}");
return new WebHostBuilder()
.UseKestrel()
.ConfigureServices(
services => services
.AddSingleton<ConfigSettings>(new ConfigSettings(serviceContext))
.AddSingleton<HttpClient>(new HttpClient())
.AddSingleton<FabricClient>(new FabricClient())
.AddSingleton<StatelessServiceContext>(serviceContext))
.UseContentRoot(Directory.GetCurrentDirectory())
.UseServiceFabricIntegration(listener, ServiceFabricIntegrationOptions.None)
.UseStartup<Startup>()
.UseUrls(url)
.Build();
}))
};
}
}
Program.cs가
namespace MyApp
{
using System;
using System.Diagnostics;
using System.Threading;
using CommandLine;
using Microsoft.AspNetCore.Hosting;
using Microsoft.ServiceFabric.Services.Runtime;
internal static class Program
{
/// <summary>
/// This is the entry point of the service host process.
/// </summary>
private static void Main(string[] args)
{
var parser = new Parser(with =>
{
with.HelpWriter = Console.Out;
});
var options = new Options();
var result = parser.ParseArguments(args, options);
if (options.Host.ToLower() == MyAppConstants.ServiceFabricHost)
{
try
{
// The ServiceManifest.XML file defines one or more service type names.
// Registering a service maps a service type name to a .NET type.
// When Service Fabric creates an instance of this service type,
// an instance of the class is created in this host process.
ServiceRuntime.RegisterServiceAsync(
"WebServiceType",
context => new MyApp(context)).GetAwaiter().GetResult();
ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(SnapNurse).Name);
// Prevents this host process from terminating so services keeps running.
Thread.Sleep(Timeout.Infinite);
}
catch (Exception e)
{
ServiceEventSource.Current.ServiceHostInitializationFailed(e.ToString());
throw;
}
}
else if (options.Host.ToLower() == MyAppConstants.SelfHost)
{
using (var host = WebHostBuilderHelper.GetWebHost(new WebHostBuilder(), options.Protocol, options.Port))
{
host.Run();
}
}
}
}
내가 오류에 대한 세부 사항을 찾을 수 없어, 그리고 서비스에 아무것도를 디버깅 할 수 없습니다 같습니다 패브릭 환경에서 실행되지 않습니다. 어떤 도움을 주셔서 감사합니다!
나는 PerfView를 실행했으며 패키지 정품 인증과 관련된 이벤트를 발견했지만 실제로 문제가 무엇인지에 대한 힌트는 찾지 못했습니다. 아무도 문제가 무엇인지 알지 못하더라도 더 많은 정보를 얻는 기술에 대한 도움만으로도 좋습니다!
이상하게 보이는 다른 점은 Main() 메소드의 모든 코드를 주석 처리하더라도 여전히 똑같은 오류가 발생한다는 것입니다. 마치 프레임 워크 DLL이나 그 종류에 도달하기 전에 거의 실패하는 것처럼 보이지만 모든 것이 .netcore2이고 서비스 패브릭을 가진 컴퓨터에 런타임이 설치되어 있습니다
시작 스크립트에 어떤 내용이 들어 있습니까? – Dismissile
옵션입니다 .Host. 서비스 패브릭 브랜치를 실행 해보십시오. – Mardoxx