2025年6月7日

Linux sync同步数据到磁盘

摘要: 先创建好文件a.log内容是test2,再执行以下脚本。 echo "test3" > a.log cat a.log # 触发系统崩溃重启 bash -c "echo c > /proc/sysrq-trigger" 发现重启后还是test2。 触发系统崩溃重启前执行sync,保证文件内容是tes 阅读全文

posted @ 2025-06-07 18:46 王景迁 阅读(30) 评论(0) 推荐(0)

go 基于不同Host访问不同服务

摘要: 不同于其他语言,go语言通过request.Host字段来指定主机域名,而不是headers里面"Host"。在Nginx中,server_name对应http请求中的Host。 docker run --network host -d nginx:1.23 # 修改配置文件 vim /etc/ng 阅读全文

posted @ 2025-06-07 17:31 王景迁 阅读(21) 评论(0) 推荐(0)

导航