zoukankan      html  css  js  c++  java
  • Net Core linux docker 部署异常

    环境:

      .NET Core 3.1

      Linux + Docker

    问题:

    近期发布后发现,服务经常需要多次重启才能启动。观察日志发现异常:

      Unhandled exception. System.IO.IOException: The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.

    尝试网上很多方法后,还是出现了问题,通过断点发现 Configuration 的 ReloadOnChange 不管怎么样都是 true,后面通过如下方法解决了

      

      webBuilder.ConfigureAppConfiguration((hostingContext, config) =>
                        {
                            IHostEnvironment env = hostingContext.HostingEnvironment;
    
                  //调用Clear 会报错,因时间就没有深查了 config.Sources.ForEach(source
    => { if (source is JsonConfigurationSource) { var jsonConfigurationSource = (JsonConfigurationSource)source; jsonConfigurationSource.ReloadOnChange = false; } }); config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: false) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: false); if (env.IsDevelopment() && !string.IsNullOrEmpty(env.ApplicationName)) { var appAssembly = Assembly.Load(new AssemblyName(env.ApplicationName)); if (appAssembly != null) { config.AddUserSecrets(appAssembly, optional: true); } } config.AddEnvironmentVariables(); if (args != null) { config.AddCommandLine(args); } }).UseStartup<Startup>();
  • 相关阅读:
    yum之镜像加速
    MySQL5.7安装
    销售订单的批量审批/反审
    MM06E005 EXIT_SAPMM06E_013 采购订单增强
    直接用代码查找增强Enhancement
    SAP相关业务表
    模拟会计凭证审批 OO ALV(屏幕跳转、定位行数据、审批按钮)
    spark 和 fink
    说说spark
    golang server端的epoll
  • 原文地址:https://www.cnblogs.com/zhihang/p/14803698.html
Copyright © 2011-2022 走看看