Closed pableess closed 1 year ago
Update:
I figured out that this issue was caused by 2 things.
return siloBuilder.Configure<EndpointOptions>(e =>
{
e.SiloPort = siloPort;
e.GatewayPort = gatewayPort;
e.AdvertisedIPAddress = endpointAddress;
e.GatewayListeningEndpoint = new IPEndPoint(IPAddress.Loopback, gatewayPort);
e.SiloListeningEndpoint = new IPEndPoint(IPAddress.Loopback, siloPort);
});
Now the app starts, however when I scale out, the nodes cannot communicate with each over over the VNET. My guess is because the linux container that app services uses does not expose the WEBSITE_PRIVATE_PORTS. I am wondering if maybe this can be done with a custom container but I am still not sure if it is possible to expose the WEBSITE_PRIVATE_PORTS to the VNET?
Do you know if this scenario is possible?
Hi @pableess ,
I''ve managed to run an .NET 6 with Orleans v4.3 example on App Service Linux: https://github.com/windperson/OrleansUrlShortener/tree/AzureWebApp-Linux
There are many tweaks for silo hosting builder code than the Windows App Service:
ClusterMembershipOptions
:
https://github.com/windperson/OrleansUrlShortener/blob/AzureWebApp-Linux/src/UrlShortener.Infra.Silo/AzureAppServiceRunningExtensions.cs#L26
The ClusterMembershipOptions.DefunctSiloExpiration property part is the most tricky one, it must set shorten then default value. I set it as double time of the underlying Linux App Service restart time which is recorded as WEBSITES_CONTAINER_START_TIME_LIMIT environment variable.listenOnAnyHostAddress
parameter to true in calling siloBuilder.ConfigureEndpoints()
extension method:
https://github.com/windperson/OrleansUrlShortener/blob/AzureWebApp-Linux/src/UrlShortener.Infra.Silo/ConfigureSiloExtensions.cs#L91I've wrote an article contains detail explanations, but it is currently only Chinese version available: https://ithelp.ithome.com.tw/articles/10310277
I have been able to successfully run orleans based app on Linux App Service.
My fork of this repository is here which I used to test.
https://github.com/pableess/Orleans-Cluster-on-Azure-App-Service
This issue is for a: (mark with an
x
)Minimal steps to reproduce
param appName string param location string param vnetSubnetId string param appInsightsInstrumentationKey string param appInsightsConnectionString string param storageConnectionString string
resource appServicePlan 'Microsoft.Web/serverfarms@2021-03-01' = { name: '${appName}-plan' location: location kind: 'linux' sku: { name: 'S1' capacity: 1 } properties:{ reserved: true } }
resource appService 'Microsoft.Web/sites@2021-03-01' = { name: appName location: location properties: { serverFarmId: appServicePlan.id virtualNetworkSubnetId: vnetSubnetId httpsOnly: true siteConfig: {
linuxFxVersion: 'DOTNETCORE|6.0'
vnetPrivatePortsCount: 2 webSocketsEnabled: true netFrameworkVersion: 'v6.0' appSettings: [ { name: 'APPINSIGHTS_INSTRUMENTATIONKEY' value: appInsightsInstrumentationKey } { name: 'APPLICATIONINSIGHTS_CONNECTION_STRING' value: appInsightsConnectionString } { name: 'ORLEANS_AZURE_STORAGE_CONNECTION_STRING' value: storageConnectionString } ] alwaysOn: true } } }
resource appServiceConfig 'Microsoft.Web/sites/config@2021-03-01' = { name: '${appService.name}/metadata' properties: { CURRENT_STACK: 'dotnet' } }
Any log messages given by the failure
2023-02-16T07:06:15.725052008Z at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
2023-02-16T07:06:15.725055908Z at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
2023-02-16T07:06:15.725059608Z at System.Net.Sockets.Socket.Bind(EndPoint localEP)
2023-02-16T07:06:15.725063408Z at Orleans.Networking.Shared.SocketConnectionListener.Bind() in /_/src/Orleans.Core/Networking/Shared/SocketConnectionListener.cs:line 63
2023-02-16T07:06:15.725081809Z at Orleans.Networking.Shared.SocketConnectionListenerFactory.BindAsync(EndPoint endpoint, CancellationToken cancellationToken) in /_/src/Orleans.Core/Networking/Shared/SocketConnectionListenerFactory.cs:line 41
2023-02-16T07:06:15.725086209Z at Orleans.Runtime.Messaging.ConnectionListener.BindAsync(CancellationToken cancellationToken) in /_/src/Orleans.Runtime/Networking/ConnectionListener.cs:line 72
2023-02-16T07:06:15.725090009Z at Orleans.Runtime.Messaging.SiloConnectionListener.OnRuntimeInitializeStart(CancellationToken cancellationToken) in /_/src/Orleans.Runtime/Networking/SiloConnectionListener.cs:line 76
2023-02-16T07:06:15.725093709Z at Orleans.Runtime.SiloLifecycleSubject.MonitoredObserver.OnStart(CancellationToken ct) in /_/src/Orleans.Runtime/Lifecycle/SiloLifecycleSubject.cs:line 116
2023-02-16T07:06:15.734193978Z fail: Orleans.Runtime.SiloLifecycleSubject[100450]
Expected/desired behavior
OS and Version?
Versions
Mention any other details that might be useful