Unhandled exception. System.IO.IOException: The configured user limit (128) on the number of inotify instances
asp.net core 利用 systemd unit 启动,并且调用matlab 运行时,如果出现 /usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.12/mclmcrrt9_8.dll: cannot open shared object file: No such file or directory,
那么在unit 文件中[service] 节设置matlab运行时环境变量即可解决,
如下:
[Service]
Environment=LD_LIBRARY_PATH=/usr/local/MATLAB/MATLAB_Runtime/v98/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v98/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v98/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v98/extern/bin/glnxa64
linux 下LD_LIBRARY_PATH 的说明如下:
https://blog.csdn.net/SoaringLee_fighting/article/details/78758318
asp.net core grpc server ubuntu 20.04上部署后,应用本地连接提示:
IOException: An HTTP/2 connection could not be established because the server did not complete the HTTP/2 handshake. HttpProtocolException: The HTTP/2 server closed the connection. HTTP/2 error code 'HTTP_1_1_REQUIRED' (0xd).",
其实官方文档说了,如果不用https连接,那么必须将kestrel协议设置为http2协议。
代码如下:
builder.WebHost.ConfigureKestrel((context, serverOptions) =>
{
serverOptions.ListenAnyIP(0, m =>
{
//需要将端点的默认协议设置为http2
m.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http2;
});
});
以下内容来自asp.net core 官方文档,加粗部分就是解决上述问题的方案,有时候阅读理解官方文档真的很重要。
Protocol negotiation
TLS is used for more than securing communication. The TLS Application-Layer Protocol Negotiation (ALPN) handshake is used to negotiate the connection protocol between the client and the server when an endpoint supports multiple protocols. This negotiation determines whether the connection uses HTTP/1.1 or HTTP/2.
If an HTTP/2 endpoint is configured without TLS, the endpoint's ListenOptions.Protocols must be set to HttpProtocols.Http2
. An endpoint with multiple protocols, such as HttpProtocols.Http1AndHttp2
for example, can't be used without TLS because there's no negotiation. All connections to the unsecured endpoint default to HTTP/1.1, and gRPC calls fail.
For more information on enabling HTTP/2 and TLS with Kestrel, see Kestrel endpoint configuration.
微软官方文档关于该部分内容说明:https://learn.microsoft.com/en-us/aspnet/core/grpc/aspnetcore?view=aspnetcore-7.0&tabs=visual-studio
nlog 动态设置日志目录路径可以用:NLog.GlobalDiagnosticsContext.Set("logDirectory", "C:/Temp/"); 的方式,然后在nlog.config中添加
1 docker load -i 镜像.tar 加载从windows上的压缩包出现问题时,请用 docker save -o 镜像名.tar iamge1 image2 ,也就是用-o参数。
2 docker compose 中的定义的服务镜像,统一用 docker save -o 镜像名.tar image1 image2这种形式。
3 compose.yaml 复制到linux 上后,要将应用构建的定义改为引用app镜像,和其他镜像一样。