今天重启游戏服务器在连接redis数据库时突然报错:MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error. 究其原因是因为强制把redis快照关闭了导致不能持久化的问题,在网上查了一些相关解决方案,通过stop-writes-on-bgsave-error值设置为no即可避免这种问题。 有两种修改方法,一种是通过redis命令行修改,另一种是直接修改redis.conf配置文件 命令行修改方式示例: 127.0.0.1:6379> config set stop-writes-on-bgsave-error no 修改redis.conf文件:vi打开redis-server配置的redis.conf文件,然后使用快捷匹配模式:/stop-writes-on-bgsave-error定位到stop-writes-on-bgsave-error字符串所在位置,接着把后面的yes设置为no即可。 from:https://blog.csdn.net/qq_31766907/article/details/78715935
View Details问题背景 Win8.1 Docker-toolbox版本为18.03.0,在解决了上文这个问题后:Docker安装问题2 This computer doesn’t have VT-X/AMD-v enabled,启动Docker Quick Terminal时,报下面的错;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
(default) Image cache directory does not exist, creating it at C:\Users\libin\.d ocker\machine\cache... (default) No default Boot2Docker ISO found locally, downloading the latest relea se... (default) Latest release for github.com/boot2docker/boot2docker is v18.06.1-ce (default) Downloading C:\Users\libin\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v18.06.1-ce/boot2do cker.iso... (default) 0%....10%....20%..Error removing file: Error removing temporary downlo ad file: remove C:\Users\libin\.docker\machine\cache\boot2docker.iso.tmp46992358 7: The process cannot access the file because it is being used by another proces s. (default) Error with pre-create check: "read tcp 218.197.228.182:49406->52.216.160.179:443 : wsarecv: An existing connection was forcibly closed by the remote host." |
问题原因 启动时如果检测到没有 Boot2Docker,就会去下载,在下载过程中法出现了网络连接上的错误,导致启动失败。 解决方案 先删除已下载的临时文件,我的目录是:C:\Users\libin.docker\machine\cache. 用其他工具去下载对应的 boot2docker.iso 文件,下载链接:https://github.com/boot2docker/boot2docker/releases/download/v18.06.1-ce/boot2docker.iso 注意: 这里的链接地址其实就在上面的报错信息中,直接复制也可以。 将下载好的文件放到1中的目录下(不需要解压) from:https://blog.csdn.net/lililuni/article/details/83243062
View Details最近项目有个新同事,每个API接口里返回的时间格式中都带T如:【2019-06-06T10:59:51.1860128+08:00】,其实这个主要是ASP.Net Core自带时间格式列化时间格式设置的,我们只需要替换序格式化时间格式就可以; 一、先建一个控制器测试:
|
1 2 3 4 5 6 7 8 9 10 |
public IActionResult Get() { UserInfo userInfo = new UserInfo() { Name = "lxsh", BirthDay = DateTime.Now }; return Ok(userInfo); } |
二、没有替换格式化时间之前效果: 三、可以在注入mvc服务的时候设置格式化参数,在Startup类的ConfigureServices方法中指定
|
1 2 3 4 |
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2).AddJsonOptions(options => { options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; }); |
四、替换后的格式时间效果如下: from:https://www.cnblogs.com/lxshwyan/p/10983974.html
View Details【问题】网站 项目里经常用到DateTime类型变量,要求所有日期时间类型格式标准为“yyyy-MM-dd HH:mm:ss”,但默认Tostring格式为 yyyy-M-d H:m:s ,没有前置0, 需要修改 【分析】 1、修改代码里所有DateTime类型的Tostring为 ToString("yyyy-MM-dd HH:mm:ss"),不方便 2、找见统一的修改地方, Thread.CurrentThread.CurrentCulture = new CultureInfo("zh-CN", true) { DateTimeFormat = { ShortDatePattern = "yyyy-MM-dd", FullDateTimePattern = "yyyy-MM-dd HH:mm:ss" }; 发现不起作用 经分析DateTimeFormat 类的属性,发现 LongTimePattern 起作用 【结论】 增加 LongTimePattern 属性
|
1 2 3 |
Thread.CurrentThread.CurrentCulture = new CultureInfo("zh-CN", true) { DateTimeFormat = { ShortDatePattern = "yyyy-MM-dd", FullDateTimePattern = "yyyy-MM-dd HH:mm:ss", LongTimePattern ="HH:mm:ss"} }; |
from:https://blog.csdn.net/onemetre/article/details/52042907
View Details把终端显示改为英文: 1、先备份语言配置文件 cp /etc/locale.conf /home/locale.conf.backup 2、打开配置文件 vim /etc/locale.conf 3、把“zh_CN.UTF-8”修改为“en_US.UTF-8” 4、esc :wq 保存并退出 5、shutdown -r now 重启 from:https://www.cnblogs.com/nnniki/p/10359229.html
View Details1、从微软下载net core https://download.visualstudio.microsoft.com/download/pr/dd164132-d4c4-4c1a-8233-a4fc7e157935/bffa5312d613cab1a14f0858f947a6fc/dotnet-runtime-2.1.11-linux-x64.tar.gz 2、将安装包上传至linux中 3、解压 tar -vxf dotnet-runtime-2.1.11-linux-x64.tar.gz 4、创建链接,使所有目录下都可以访问到dotnet命令(这里是解压后放在/home/dotnetcore目录下) ln -s /home/dotnetcore/dotnet /usr/local/bin 5、测试验证是否成功 任意目录下:dotnet --info 最后,使用dotnet+dll名称,测试软件是否可以运行,如果无法运行,则安装相应的软件包即可 参考: 1、.NET Core 指南:https://docs.microsoft.com/zh-cn/dotnet/core/ 2、net core下载中心:https://dotnet.microsoft.com/download/dotnet-core from:https://blog.csdn.net/dqcoffee/article/details/91353543
View Details在部署的时候,如果您不想在您的Linux服务器上安装.Net Core SDK,您可以只安装Runtime,接下来我们看看该如何安装运行时Runtime。 下载运行时文件 下载页面:https://www.microsoft.com/net/download/linux 先获取一下对应的下载链接,可以使用浏览器点击链接来获取具体文件的下载链接 获取完链接以后,就可以使用命令下获取和安装了 以Centos 7,Ubuntu 16.04为例安装ASP.Net Core 2.0.5的运行时:
|
1 2 3 4 5 |
wget -O dotnet-runtime.tar.gz https://download.microsoft.com/download/1/1/0/11046135-4207-40D3-A795-13ECEA741B32/dotnet-runtime-2.0.5-linux-x64.tar.gz wget -O aspnetcore-store.tar.gz https://download.microsoft.com/download/1/1/0/11046135-4207-40D3-A795-13ECEA741B32/aspnetcore-store-2.0.5-linux-x64.tar.gz mkdir dotnet tar zxf dotnet-runtime.tar.gz -C dotnet tar zxf aspnetcore-store.tar.gz -C dotnet |
还需要安装 libunwind Centos 7
|
1 |
yum update -y && yum install libunwind libicu -y |
Ubuntu 16.04
|
1 |
apt-get update -y && apt-get install libunwind-dev -y |
原文地址:https://www.zkea.net/codesnippet/detail/post-85 from:https://www.cnblogs.com/seriawei/p/8438126.html
View Details最近在技术博客和技术交流群遇到很多小伙伴们在Linux下更新或者安装.Net Core SDK后dotnet命令无法识别等问题,现如下解决: 卸载SDK命令
|
1 |
sudo yum remove dotnet-sdk-* |
|
1 |
sudo yum remove libunwind libicu |
|
1 |
sudo yum remove /etc/yum.repos.d/dotnetdev.repo |
从新安装即可 from:https://www.cnblogs.com/yangzhili/p/9217083.html
View DetailsCentOS修改IP地址 # ifconfig eth0 192.168.1.80 这样就把IP地址修改为192.168.1.80(如果发现上不了网了,那么你可能需要把网关和DNS也改一下,后面会提到),但是当你重新启动系统或网卡之后,还是会变回原来的地址,这种修改方式只适用于需要临时做IP修改。要想永久性修改,就要修改/etc/sysconfig/network-scripts/ifcfg-eth0这个文件,这个文件的主要内容如下(你的文件中没有的项,你可以手动添加): # vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 #描述网卡对应的设备别名 BOOTPROTO=static #设置网卡获得ip地址的方式,选项可以为为static,dhcp或bootp BROADCAST=192.168.44.255 #对应的子网广播地址 HWADDR="00:0C:29:6B:2E:7B"#对应的网卡物理地址 IPADDR=192.168.44.137 #只有网卡设置成static时,才需要此字段 NETMASK=255.255.255.0 #网卡对应的网络掩码 NETWORK=192.168.44.0 #网卡对应的网络地址,也就是所属的网段 ONBOOT=yes #系统启动时是否设置此网络接口,设置为yes时,系统启动时激活此设备 CentOS修改网关 # route add default gw 192.168.1.1 dev eth0 这样就把网关修改为192.168.1.1了,这种修改只是临时的,当你重新启动系统或网卡之后,还是会变回原来的网关。要想永久性修改,就要修改/etc/sysconfig/network 这个文件,这个文件的主要内容如下(你的文件中没有的项,你可以手动添加): # vi /etc/sysconfig/network NETWORKING=yes #表示系统是否使用网络,一般设置为yes。如果设为no,则不能使用网络。 HOSTNAME=centos #设置本机的主机名,这里设置的主机名要和/etc/hosts中设置的主机名对应 GATEWAY=192.168.1.1 #设置本机连接的网关的IP地址。 **********上面的文件修改完要重新启动一下网卡才会生效:# service network restart ******** CentOS修改DNS 上面的都修改完之后,当你ping一个域名是肯能不通,但ping对应的IP地址是同的,这时我们需要修改一下DNS。修改DNS要通过修改/etc/resolv.conf这个文件: # vi /etc/resolv.conf nameserver 8.8.8.8 #google域名服务器 nameserver 8.8.4.4 #google域名服务器 通过上面的所有设置,系统应该可以上网了。 如果centos系统建立在虚拟机之上,那么在设置虚拟机的网络时请选择‘网桥适配器’连接。 from:https://www.cnblogs.com/liuys635/p/11335594.html
View Details|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
2019-05-09 10:27:01,330 线程ID:[80] 日志级别:ERROR 出错类:WebApp.HttpGlobalExceptionFilter property:[(null)] - 错误描述:System.TypeInitializationException: The type initializer for 'System.DrawingCore.GDIPlus' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'gdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgdiplus: cannot open shared object file: No such file or directory at System.DrawingCore.GDIPlus.GdiplusStartup(UInt64& token, GdiplusStartupInput& input, GdiplusStartupOutput& output) at System.DrawingCore.GDIPlus..cctor() --- End of inner exception stack trace --- at System.DrawingCore.GDIPlus.GdipGetGenericFontFamilySansSerif(IntPtr& fontFamily) at System.DrawingCore.FontFamily..ctor(GenericFontFamilies genericFamily) at System.DrawingCore.FontFamily.get_GenericSansSerif() at System.DrawingCore.Font.CreateFont(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte charSet, Boolean isVertical) at Common.VerifyCodeHelper.CreateByteByImgVerifyCode(String verifyCode, Int32 width, Int32 height) in F:\src\WebApp\Common\VerifyCodeHelper.cs:line 206 at WebApp.Controllers.VerifyCodeController.NumberVerifyCode() in F:\src\WebApp\Controllers\VerifyCodeController.cs:line 27 at lambda_method(Closure , Object , Object[] ) at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters) at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync() |
解决方法 Centos 7 yum install libgdiplus-devel from:https://www.cnblogs.com/asd14828/p/10837140.html?utm_source=tuicool
View Details