当前位置: 首页 > wzjs >正文

网站建设什么科目我想做百度推广

网站建设什么科目,我想做百度推广,工商登记网站,数字营销实训报告前置文章: windows通用网线连接ubuntu实现ssh登录、桌面控制、文件共享Ubuntu挂载HDD迁移存储PostgreSQL数据 背景: 启动实体Ubuntu机器后后很大的概率PostgreSQL不会成功启动,查看日志: Ubuntu启动时间: rootPine…

前置文章:

  • windows通用网线连接ubuntu实现ssh登录、桌面控制、文件共享
  • Ubuntu挂载HDD迁移存储PostgreSQL数据

背景:

启动实体Ubuntu机器后后很大的概率PostgreSQL不会成功启动,查看日志:
Ubuntu启动时间:

root@Pine-Tree:~# uptime -s
2025-04-19 09:52:24

查看PostgreSQL运行状态


root@Pine-Tree:~# sudo systemctl status postgresql@15-main
× postgresql@15-main.service - PostgreSQL Cluster 15-mainLoaded: loaded (/lib/systemd/system/postgresql@.service; enabled; vendor preset: enabled)Active: failed (Result: protocol) since Sat 2025-04-19 09:52:26 CST; 15min agoProcess: 700 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 15-main start (code=exited, status=1/FAILURE)CPU: 41ms419 09:52:26 Pine-Tree systemd[1]: Starting PostgreSQL Cluster 15-main...
419 09:52:26 Pine-Tree postgresql@15-main[700]: Error: /mnt/pgdata/main is not accessible or does not exist
419 09:52:26 Pine-Tree systemd[1]: postgresql@15-main.service: Can't open PID file /run/postgresql/15-main.pid (yet?) after start: Operation not permitted
4月 19 09:52:26 Pine-Tree systemd[1]: postgresql@15-main.service: Failed with result 'protocol'.
419 09:52:26 Pine-Tree systemd[1]: Failed to start PostgreSQL Cluster 15-main.

可知在系统启动2秒后就开始尝试启动PostgreSQL了,但是挂载目录/mnt/pgdata/main还无法访问,导致PostgreSQL启动失败。
查询相关资料发现冷启动HDD通过USB3.0连接从开机到系统检测完毕大概需要3-20秒 。

解决思路:

使用systemctl edit调整启动策略

方案一、设置PostgreSQL延迟5秒启动

创建文件夹用于systemctl edit配置
sudo mkdir -p /etc/systemd/system/postgresql@15-main.service.d
新增片段覆盖文件
sudo nano /etc/systemd/system/postgresql@15-main.service.d/override.conf
在打开的编辑器中添加以下内容
[Service]
ExecStartPre=/bin/sleep 5
保存并退出,然后重新加载systemd配置
sudo systemctl daemon-reload
重新启动验证
reboot
确认PostgreSQL运行状况

启动成功:

root@Pine-Tree:~# sudo systemctl status postgresql@15-main
● postgresql@15-main.service - PostgreSQL Cluster 15-mainLoaded: loaded (/lib/systemd/system/postgresql@.service; enabled; vendor preset: enabled)Drop-In: /etc/systemd/system/postgresql@15-main.service.d└─override.confActive: active (running) since Sat 2025-04-19 11:20:15 CST; 2min 14s agoProcess: 814 ExecStartPre=/bin/sleep 5 (code=exited, status=0/SUCCESS)Process: 1440 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 15-main start (code=exited, status=0/SUCCESS)Main PID: 1446 (postgres)

Ubuntu启动时间:

root@Pine-Tree:~# uptime -s
2025-04-19 11:19:56

确认PostgreSQL启动时间,可知延迟启动生效

root@Pine-Tree:~# ps -eo pid,lstart,cmd | grep postgres | grep -v grep1446 Sat Apr 19 11:20:05 2025 /usr/lib/postgresql/15/bin/postgres -D /mnt/pgdata/main -c config_file=/etc/postgresql/15/main/postgresql.conf1483 Sat Apr 19 11:20:08 2025 postgres: 15/main: checkpointer 1484 Sat Apr 19 11:20:08 2025 postgres: 15/main: background writer 1486 Sat Apr 19 11:20:10 2025 postgres: 15/main: walwriter 1487 Sat Apr 19 11:20:10 2025 postgres: 15/main: autovacuum launcher 1488 Sat Apr 19 11:20:10 2025 postgres: 15/main: logical replication launcher 1838 Sat Apr 19 11:22:32 2025 postgres: 15/main: postgres dbname 192.168.125.2(6139) idle

方案二、PostgreSQL开机自启动失败后重试2次(间隔10秒)

修改override.conf
sudo nano /etc/systemd/system/postgresql@15-main.service.d/override.conf

配置调整为:

[Service]
Restart=on-failure
RestartSec=10s
StartLimitBurst=2
保存并退出,然后重新加载systemd配置
sudo systemctl daemon-reload
重新启动验证
reboot
确认PostgreSQL运行状况

启动成功:

root@Pine-Tree:~# sudo systemctl status postgresql@15-main
● postgresql@15-main.service - PostgreSQL Cluster 15-mainLoaded: loaded (/lib/systemd/system/postgresql@.service; enabled; vendor preset: enabled)Drop-In: /etc/systemd/system/postgresql@15-main.service.d└─override.confActive: active (running) since Sat 2025-04-19 12:30:06 CST; 7min agoProcess: 1479 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 15-main start (code=exited, status=0/SUCCESS)Main PID: 1487 (postgres)

Ubuntu启动时间:

root@Pine-Tree:~# uptime -s
2025-04-19 12:29:47

查看PostgreSQL历史启动记录,可知12:29:50s首次启动PostgreSQL失败,10秒过后启动成功:

 root@Pine-Tree:~# sudo journalctl -u postgresql@15-main --no-pager -n 50-- Boot 0ba0937613c14ba8b47c6bb17de28bcd --
419 12:29:50 Pine-Tree systemd[1]: Starting PostgreSQL Cluster 15-main...
419 12:29:50 Pine-Tree postgresql@15-main[794]: Error: /mnt/pgdata/main is not accessible or does not exist
419 12:29:50 Pine-Tree systemd[1]: postgresql@15-main.service: Can't open PID file /run/postgresql/15-main.pid (yet?) after start: Operation not permitted
4月 19 12:29:50 Pine-Tree systemd[1]: postgresql@15-main.service: Failed with result 'protocol'.
419 12:29:50 Pine-Tree systemd[1]: Failed to start PostgreSQL Cluster 15-main.
419 12:30:00 Pine-Tree systemd[1]: postgresql@15-main.service: Scheduled restart job, restart counter is at 1.
419 12:30:00 Pine-Tree systemd[1]: Stopped PostgreSQL Cluster 15-main.
419 12:30:00 Pine-Tree systemd[1]: Starting PostgreSQL Cluster 15-main...
419 12:30:06 Pine-Tree systemd[1]: Started PostgreSQL Cluster 15-main.

方案三、设置PostgreSQL延迟5秒启动同时设置启动失败后重试2次(间隔10秒 )

修改override.conf后重新验证

sudo nano /etc/systemd/system/postgresql@15-main.service.d/override.conf

配置调整为:

[Service]
ExecStartPre=/bin/sleep 5
Restart=on-failure
RestartSec=10s
StartLimitBurst=2
保存并退出,然后重新加载systemd配置

大部分情况下,延迟5秒即可保证启动成功,不会走到重试逻辑

sudo systemctl daemon-reload

问题汇总

sudo systemctl edit postgresql@15-main编辑后保存失败,提示文件不存在

root@Pine-Tree:~# sudo systemctl edit postgresql@15-main
Editing "/etc/systemd/system/postgresql@15-main.service.d/override.conf" canceled: temporary file is empty.

解决措施:
创建文件夹用于systemctl edit配置

sudo mkdir -p /etc/systemd/system/postgresql@15-main.service.d

新增片段覆盖文件,然后编辑

sudo nano /etc/systemd/system/postgresql@15-main.service.d/override.conf

文章转载自:

http://aA1IQaxg.hbfqm.cn
http://3lghGc7n.hbfqm.cn
http://WLTeBp0B.hbfqm.cn
http://VgeVGT98.hbfqm.cn
http://As3aCl4O.hbfqm.cn
http://fLLK6feD.hbfqm.cn
http://TkL01W7t.hbfqm.cn
http://J3cDFome.hbfqm.cn
http://sTpqlN2I.hbfqm.cn
http://oLoIasYo.hbfqm.cn
http://Es3MV9o6.hbfqm.cn
http://SCC9dDb9.hbfqm.cn
http://2ElM8U0o.hbfqm.cn
http://HPtFOkBB.hbfqm.cn
http://T3vBVWY7.hbfqm.cn
http://crwVG4sR.hbfqm.cn
http://W6w89gqv.hbfqm.cn
http://vI2k7ADY.hbfqm.cn
http://BqY9hJJ6.hbfqm.cn
http://d7S3nxzW.hbfqm.cn
http://zLyb0HZm.hbfqm.cn
http://TLSeACEN.hbfqm.cn
http://s5f0Ds6W.hbfqm.cn
http://BdMVlygx.hbfqm.cn
http://hcMlNfPl.hbfqm.cn
http://M6I2aCe4.hbfqm.cn
http://biKvrO7f.hbfqm.cn
http://lnlEHW5e.hbfqm.cn
http://lm2iMOP8.hbfqm.cn
http://B91dgQLE.hbfqm.cn
http://www.dtcms.com/wzjs/629931.html

相关文章:

  • 微网站模板 餐饮主题wordpress
  • 网站设置英文怎么说装修图库大全图片
  • 做网站运营的股票wordpress图片pin按钮
  • 金融交易网站建设有了网站源码怎么建站
  • 广州小程序定制开发上海市网站seo公司
  • 一个空间两个php网站上海注册设计公司网站
  • 宝塔面板加wordpress建站中小企业网络规划与设计方案
  • 百达翡丽手表网站快速学制作网站
  • 注册网站电子游戏送钱了38如何在手机上建立自己的网站
  • 正能量网站入口直接进入下载中文 wordpress 主题
  • 厦门网上房地产官网查询seo前线
  • 广州市律师网站建设公司织梦做的的网站首页显示空白
  • 网深圳网站优化武钢建工集团建设分公司网站
  • 长沙建网站的wordpress for ipad
  • 网站数据分析工具做网站需要哪些成本
  • 网站如何微信支付建站seo赚钱
  • 遂宁市建设局网站wordpress中文购物主题
  • ppt模板怎么做 下载网站wordpress自定义栏目调用
  • 有哪些公司建设网站知名设计公司
  • 公司网站制作导航seo广告平台
  • 建设的网站深圳石岩网站建设
  • 上杭县城乡规划建设局网站wordpress怎么改模板
  • 网站开发管理学什么网站建设 河南
  • 网站js下载襄阳购物网站开发设计
  • 网站建设与设计毕业shej网站建设 模板
  • 南宁营销型网站建设公司网站后台的制作
  • 本地搭建php网站wordpress 无法搜索结果
  • 网站优化关键词排名怎么做多少钱要交税
  • 手机网站分页设计福州网站建设网络公司
  • 网站建设维保合同范本想学网络运营怎么开始