重建群晖 pgsql 后丢失 autoupdate 数据库

接上集:重建群晖 pgsql 数据库

在重建 pgsql 后,我在 /var/log/message 内发现了异常的日志:

2024-03-28T23:04:29+08:00 Synology sshd[0000]: error: kex_exchange_identification: banner line contains invalid characters
2024-03-28T23:04:29+08:00 Synology sshd[0000]: error: kex_exchange_identification: banner line contains invalid characters
2024-03-28T23:05:11+08:00 Synology sshd[0000]: pam_syno_ipblocklist(sshd:auth): DB Error: Failed to connect database: FATAL: database "autoupdate" does not exist
2024-03-28T23:05:11+08:00 Synology sshd[0000]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=255.255.255.255 user=root

日志提示丢失 autoupdate 数据库,应该是之前重建时没能自动创建这个数据库。

从另一台群晖 dump 后导入,完成后重启就解决了。

--
-- PostgreSQL database dump
--

-- Dumped from database version 11.11
-- Dumped by pg_dump version 11.11

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'SQL_ASCII';
SET standard_conforming_strings = off;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET row_security = off;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: syno_abuser_blocklist; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.syno_abuser_blocklist (
    ipaddr inet NOT NULL
);


ALTER TABLE public.syno_abuser_blocklist OWNER TO postgres;

--
-- Name: syno_abuser_blocklist syno_abuser_blocklist_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.syno_abuser_blocklist
    ADD CONSTRAINT syno_abuser_blocklist_pkey PRIMARY KEY (ipaddr);


--
-- PostgreSQL database dump complete
--

将以上内容保存为 autoupdate.sql,然后执行:

createdb -U postgres autoupdate
psql -U postgres autoupdate < autoupdate.sql

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据