我尝试安装 Discourse,但遇到了“启动失败(FAILED TO BOOTSTRAP)”错误。
以下是日志:
按 Enter 继续,按 'n' 重试,按 Ctrl+C 退出:
启用 Let's Encrypt
web.ssl.template.yml 已启用
letsencrypt.ssl.template.yml 已启用
配置文件已更新成功!
更新成功。将在 5 秒后重新构建。
正在构建应用
确保启动器为最新版本
正在获取 origin
启动器已是最新版本
cd /pups && git pull && /pups/bin/pups --stdin
已是最新版本。
I, [2020-07-24T18:55:58.464935 #1] INFO -- : 正在加载 --stdin
I, [2020-07-24T18:55:58.473367 #1] INFO -- : > locale-gen $LANG && update-locale
I, [2020-07-24T18:55:58.506619 #1] INFO -- : 正在生成区域设置(这可能需要一些时间)...
生成完成。
I, [2020-07-24T18:55:58.506995 #1] INFO -- : > mkdir -p /shared/postgres_run
I, [2020-07-24T18:55:58.509890 #1] INFO -- :
I, [2020-07-24T18:55:58.510432 #1] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2020-07-24T18:55:58.512373 #1] INFO -- :
I, [2020-07-24T18:55:58.512886 #1] INFO -- : > chmod 775 /shared/postgres_run
I, [2020-07-24T18:55:58.515262 #1] INFO -- :
I, [2020-07-24T18:55:58.515771 #1] INFO -- : > rm -fr /var/run/postgresql
I, [2020-07-24T18:55:58.517798 #1] INFO -- :
I, [2020-07-24T18:55:58.518308 #1] INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2020-07-24T18:55:58.520717 #1] INFO -- :
I, [2020-07-24T18:55:58.521218 #1] INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres 已在运行,停止容器 ; exit 1
2020/07/24 18:55:58 socat[26] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): 没有那个文件或目录
I, [2020-07-24T18:55:58.532831 #1] INFO -- :
I, [2020-07-24T18:55:58.533118 #1] INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2020-07-24T18:55:58.535580 #1] INFO -- :
I, [2020-07-24T18:55:58.535885 #1] INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2020-07-24T18:55:58.538318 #1] INFO -- :
I, [2020-07-24T18:55:58.538610 #1] INFO -- : > mkdir -p /shared/postgres_run/12-main.pg_stat_tmp
I, [2020-07-24T18:55:58.540691 #1] INFO -- :
I, [2020-07-24T18:55:58.541137 #1] INFO -- : > chown postgres:postgres /shared/postgres_run/12-main.pg_stat_tmp
I, [2020-07-24T18:55:58.542920 #1] INFO -- :
I, [2020-07-24T18:55:58.547145 #1] INFO -- : 文件 > /etc/service/postgres/run chmod: +x chown:
I, [2020-07-24T18:55:58.551140 #1] INFO -- : 文件 > /etc/service/postgres/log/run chmod: +x chown:
I, [2020-07-24T18:55:58.555034 #1] INFO -- : 文件 > /etc/runit/3.d/99-postgres chmod: +x chown:
I, [2020-07-24T18:55:58.558937 #1] INFO -- : 文件 > /root/upgrade_postgres chmod: +x chown:
I, [2020-07-24T18:55:58.559391 #1] INFO -- : > chown -R root /var/lib/postgresql/12/main
I, [2020-07-24T18:56:05.381806 #1] INFO -- :
I, [2020-07-24T18:56:05.382562 #1] INFO -- : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/12/bin/initdb -D /shared/postgres_data || exit 0
I, [2020-07-24T18:56:05.385503 #1] INFO -- :
I, [2020-07-24T18:56:05.385920 #1] INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2020-07-24T18:56:05.394083 #1] INFO -- :
I, [2020-07-24T18:56:05.394491 #1] INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2020-07-24T18:56:05.396516 #1] INFO -- :
I, [2020-07-24T18:56:05.396943 #1] INFO -- : > /root/upgrade_postgres
I, [2020-07-24T18:56:05.403490 #1] INFO -- :
I, [2020-07-24T18:56:05.403830 #1] INFO -- : > rm /root/upgrade_postgres
I, [2020-07-24T18:56:05.405807 #1] INFO -- :
I, [2020-07-24T18:56:05.406414 #1] INFO -- : 在 /etc/postgresql/12/main/postgresql.conf 中将 data_directory = '/var/lib/postgresql/12/main' 替换为 data_directory = '/shared/postgres_data'
I, [2020-07-24T18:56:05.407666 #1] INFO -- : 在 /etc/postgresql/12/main/postgresql.conf 中将 (?-mix:#?listen_addresses *=.*) 替换为 listen_addresses = '*'
I, [2020-07-24T18:56:05.408137 #1] INFO -- : 在 /etc/postgresql/12/main/postgresql.conf 中将 (?-mix:#?synchronous_commit *=.*) 替换为 synchronous_commit = $db_synchronous_commit
I, [2020-07-24T18:56:05.408917 #1] INFO -- : 在 /etc/postgresql/12/main/postgresql.conf 中将 (?-mix:#?shared_buffers *=.*) 替换为 shared_buffers = $db_shared_buffers
I, [2020-07-24T18:56:05.409490 #1] INFO -- : 在 /etc/postgresql/12/main/postgresql.conf 中将 (?-mix:#?work_mem *=.*) 替换为 work_mem = $db_work_mem
I, [2020-07-24T18:56:05.410066 #1] INFO -- : 在 /etc/postgresql/12/main/postgresql.conf 中将 (?-mix:#?default_text_search_config *=.*) 替换为 default_text_search_config = '$db_default_text_search_config'
I, [2020-07-24T18:56:05.410701 #1] INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2020-07-24T18:56:05.414314 #1] INFO -- :
I, [2020-07-24T18:56:05.414961 #1] INFO -- : 在 /etc/postgresql/12/main/postgresql.conf 中将 (?-mix:#?checkpoint_segments *=.*) 替换为 checkpoint_segments = $db_checkpoint_segments
I, [2020-07-24T18:56:05.415521 #1] INFO -- : 在 /etc/postgresql/12/main/postgresql.conf 中将 (?-mix:#?logging_collector *=.*) 替换为 logging_collector = $db_logging_collector
I, [2020-07-24T18:56:05.416016 #1] INFO -- : 在 /etc/postgresql/12/main/postgresql.conf 中将 (?-mix:#?log_min_duration_statement *=.*) 替换为 log_min_duration_statement = $db_log_min_duration_statement
I, [2020-07-24T18:56:05.416731 #1] INFO -- : 在 /etc/postgresql/12/main/pg_hba.conf 中将 (?-mix:^#local +replication +postgres +peer$) 替换为 local replication postgres peer
I, [2020-07-24T18:56:05.417184 #1] INFO -- : 在 /etc/postgresql/12/main/pg_hba.conf 中将 (?-mix:^host.*all.*all.*127.*$) 替换为 host all all 0.0.0.0/0 md5
I, [2020-07-24T18:56:05.417700 #1] INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/12/bin/postmaster -D /etc/postgresql/12/main
I, [2020-07-24T18:56:05.418973 #1] INFO -- : > sleep 5
2020-07-24 18:56:05.434 GMT [49] LOG: 0 8kB 超出了参数 "shared_buffers" 的有效范围 (16 .. 1073741823)
2020-07-24 18:56:05.435 UTC [49] FATAL: 配置文件 "/etc/postgresql/12/main/postgresql.conf" 包含错误
I, [2020-07-24T18:56:10.424189 #1] INFO -- :
I, [2020-07-24T18:56:10.424518 #1] INFO -- : > su postgres -c 'createdb discourse' || true
createdb: 错误:无法连接到数据库 template1:无法连接到服务器:没有那个文件或目录
服务器是否在本地运行并正在接受
Unix 域套接字 "/var/run/postgresql/.s.PGSQL.5432" 上的连接?
I, [2020-07-24T18:56:10.470398 #1] INFO -- :
I, [2020-07-24T18:56:10.470767 #1] INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
psql: 错误:无法连接到服务器:无法连接到服务器:没有那个文件或目录
服务器是否在本地运行并正在接受
Unix 域套接字 "/var/run/postgresql/.s.PGSQL.5432" 上的连接?
I, [2020-07-24T18:56:10.520451 #1] INFO -- :
I, [2020-07-24T18:56:10.520909 #1] INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
psql: 错误:无法连接到服务器:无法连接到服务器:没有那个文件或目录
服务器是否在本地运行并正在接受
Unix 域套接字 "/var/run/postgresql/.s.PGSQL.5432" 上的连接?
I, [2020-07-24T18:56:10.569147 #1] INFO -- :
I, [2020-07-24T18:56:10.569513 #1] INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
psql: 错误:无法连接到服务器:无法连接到服务器:没有那个文件或目录
服务器是否在本地运行并正在接受
Unix 域套接字 "/var/run/postgresql/.s.PGSQL.5432" 上的连接?
I, [2020-07-24T18:56:10.624778 #1] INFO -- :
I, [2020-07-24T18:56:10.625306 #1] INFO -- : 正在终止异步进程
失败
--------------------
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' 执行失败,返回状态 #<Process::Status: pid 75 exit 2>
失败位置:/pups/lib/pups/exec_command.rb:112:in `spawn'
执行失败,参数为 "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
88ef1f69c68375f34f7ed80b11cbe2b1fac59a79a226118cb3205f0dc0ea5276
** 启动失败 ** 请向上滚动日志,查找更早的错误消息,可能不止一条。
./discourse-doctor 可能有助于诊断问题。
看起来主要错误是无法连接到服务器,但我不太理解其中的原因……
su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' psql: 错误:无法连接到服务器:无法连接到服务器:没有那个文件或目录 服务器是否在本地运行并正在接受 Unix 域套接字 "/var/run/postgresql/.s.PGSQL.5432" 上的连接?
有人能帮忙吗?
谢谢