# 新服务器搭建问题

**URL:** https://meta.discourse.org/t/problems-building-a-new-server/271944
**Category:** Self-hosting
**Created:** [2023年七月18日 07:39 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944 "2023-07-18T07:39:15Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [2023年七月18日 07:39 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/1 "2023-07-18T07:39:15Z")

</div>

我花了一段时间才找到一个便宜的服务器，但在安装时，它无法安装，运行了很长时间后就断开了连接，我不明白为什么

````plaintext
Configuration file at containers/app.yml updated successfully!

Updates successful. Rebuilding in 5 seconds.
Building app
x86_64 arch detected.
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
2.0.20230711-0100: Pulling from discourse/base
Digest: sha256:9c1157d9e106f7c891648fea201cb10ac40b374925bf6b26f5bfa549e2c10f4c
Status: Image is up to date for discourse/base:2.0.20230711-0100
docker.io/discourse/base:2.0.20230711-0100
/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2023-07-18T07:20:31.767084 #1] INFO -- : Reading from stdin
I, [2023-07-18T07:20:31.793958 #1] INFO -- : > locale-gen $LANG && update-locale
I, [2023-07-18T07:20:32.019517 #1] INFO -- : Generating locales (this might take a while)...
Generation complete.

I, [2023-07-18T07:20:32.020652 #1] INFO -- : > mkdir -p /shared/postgres_run
I, [2023-07-18T07:20:32.030245 #1] INFO -- :
I, [2023-07-18T07:20:32.031381 #1] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2023-07-18T07:20:32.040590 #1] INFO -- :
I, [2023-07-18T07:20:32.042002 #1] INFO -- : > chmod 775 /shared/postgres_run
I, [2023-07-18T07:20:32.047709 #1] INFO -- :
I, [2023-07-18T07:20:32.049046 #1] INFO -- : > rm -fr /var/run/postgresql
I, [2023-07-18T07:20:32.065284 #1] INFO -- :
I, [2023-07-18T07:20:32.067750 #1] INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2023-07-18T07:20:32.077791 #1] INFO -- :
I, [2023-07-18T07:20:32.079627 #1] INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2023/07/18 07:20:32 socat[19] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): No such file or directory
I, [2023-07-18T07:20:32.106475 #1] INFO -- :
I, [2023-07-18T07:20:32.107379 #1] INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2023-07-18T07:20:32.119624 #1] INFO -- :
I, [2023-07-18T07:20:32.120153 #1] INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2023-07-18T07:20:32.132718 #1] INFO -- :
I, [2023-07-18T07:20:32.133565 #1] INFO -- : > mkdir -p /shared/postgres_run/13-main.pg_stat_tmp
I, [2023-07-18T07:20:32.139615 #1] INFO -- :
I, [2023-07-18T07:20:32.140993 #1] INFO -- : > chown postgres:postgres /shared/postgres_run/13-main.pg_stat_tmp
I, [2023-07-18T07:20:32.151587 #1] INFO -- :
I, [2023-07-18T07:20:32.168249 #1] INFO -- : File > /etc/service/postgres/run chmod: +x chown:
I, [2023-07-18T07:20:32.181857 #1] INFO -- : File > /etc/service/postgres/log/run chmod: +x chown:
I, [2023-07-18T07:20:32.195468 #1] INFO -- : File > /etc/runit/3.d/99-postgres chmod: +x chown:
I, [2023-07-18T07:20:32.204314 #1] INFO -- : File > /root/upgrade_postgres chmod: +x chown:
I, [2023-07-18T07:20:32.205247 #1] INFO -- : > chown -R root /var/lib/postgresql/13/main
I, [2023-07-18T07:20:35.544754 #1] INFO -- :
I, [2023-07-18T07:20:35.545754 #1] INFO -- : > [! -e /shared/postgres_data] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/13/bin/initdb -D /shared/postgres_data || exit 0
I, [2023-07-18T07:20:35.551542 #1] INFO -- :
I, [2023-07-18T07:20:35.552298 #1] INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2023-07-18T07:20:35.644962 #1] INFO -- :
I, [2023-07-18T07:20:35.646393 #1] INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2023-07-18T07:20:35.656200 #1] INFO -- :
I, [2023-07-18T07:20:35.657734 #1] INFO -- : > /root/upgrade_postgres
I, [2023-07-18T07:20:35.683335 #1] INFO -- :
I, [2023-07-18T07:20:35.684776 #1] INFO -- : > rm /root/upgrade_postgres
I, [2023-07-18T07:20:35.695826 #1] INFO -- :
I, [2023-07-18T07:20:35.703076 #1] INFO -- : Replacing data_directory = '/var/lib/postgresql/13/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/13/main/postgresql.conf
I, [2023-07-18T07:20:35.705066 #1] INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/13/main/postgresql.conf
I, [2023-07-18T07:20:35.706158 #1] INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/13/main/postgresql.conf
I, [2023-07-18T07:20:35.707013 #1] INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/13/main/postgresql.conf
I, [2023-07-18T07:20:35.707926 #1] INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/13/main/postgresql.conf
I, [2023-07-18T07:20:35.708906 #1] INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/13/main/postgresql.conf
I, [2023-07-18T07:20:35.710022 #1] INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2023-07-18T07:20:35.720021 #1] INFO -- :
I, [2023-07-18T07:20:35.723036 #1] INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/13/main/postgresql.conf
I, [2023-07-18T07:20:35.724284 #1] INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/13/main/postgresql.conf
I, [2023-07-18T07:20:35.725498 #1] INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/13/main/postgresql.conf
I, [2023-07-18T07:20:35.727899 #1] INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres peer in /etc/postgresql/13/main/pg_hba.conf
I, [2023-07-18T07:20:35.729886 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2023-07-18T07:20:35.731825 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2023-07-18T07:20:35.732577 #1] INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main
I, [2023-07-18T07:20:35.737408 #1] INFO -- : > sleep 5
2023-07-18 07:20:35.956 UTC [42] LOG: starting PostgreSQL 13.11 (Debian 13.11-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2023-07-18 07:20:35.959 UTC [42] LOG: listening on IPv4 address "0.0.0.0", port 5432
2023-07-18 07:20:35.959 UTC [42] LOG: listening on IPv6 address "::", port 5432
2023-07-18 07:20:35.964 UTC [42] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-07-18 07:20:35.979 UTC [45] LOG: database system was shut down at 2023-07-18 07:19:20 UTC
2023-07-18 07:20:35.990 UTC [42] LOG: database system is ready to accept connections
I, [2023-07-18T07:20:40.747110 #1] INFO -- :
I, [2023-07-18T07:20:40.747982 #1] INFO -- : > su postgres -c 'createdb discourse' || true
2023-07-18 07:20:41.178 UTC [55] postgres@postgres ERROR: database "discourse" already exists
2023-07-18 07:20:41.178 UTC [55] postgres@postgres STATEMENT: CREATE DATABASE discourse;
createdb: error: database creation failed: ERROR: database "discourse" already exists
I, [2023-07-18T07:20:41.183941 #1] INFO -- :
I, [2023-07-18T07:20:41.184403 #1] INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2023-07-18 07:20:41.411 UTC [59] postgres@discourse ERROR: role "discourse" already exists
2023-07-18 07:20:41.411 UTC [59] postgres@discourse STATEMENT: create user discourse;
ERROR: role "discourse" already exists
I, [2023-07-18T07:20:41.419164 #1] INFO -- :
I, [2023-07-18T07:20:41.420200 #1] INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
I, [2023-07-18T07:20:41.515696 #1] INFO -- : GRANT

I, [2023-07-18T07:20:41.516557 #1] INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
I, [2023-07-18T07:20:41.691035 #1] INFO -- : ALTER SCHEMA

I, [2023-07-18T07:20:41.691603 #1] INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists hstore;"'
NOTICE: extension "hstore" already exists, skipping
I, [2023-07-18T07:20:41.903095 #1] INFO -- : CREATE EXTENSION

I, [2023-07-18T07:20:41.904320 #1] INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists pg_trgm;"'
NOTICE: extension "pg_trgm" already exists, skipping
I, [2023-07-18T07:20:42.063447 #1] INFO -- : CREATE EXTENSION

I, [2023-07-18T07:20:42.065027 #1] INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists vector;"'
NOTICE: extension "vector" already exists, skipping
I, [2023-07-18T07:20:42.207308 #1] INFO -- : CREATE EXTENSION

I, [2023-07-18T07:20:42.209331 #1] INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists hstore;"'
NOTICE: extension "hstore" already exists, skipping
I, [2023-07-18T07:20:42.319538 #1] INFO -- : CREATE EXTENSION

I, [2023-07-18T07:20:42.321631 #1] INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists pg_trgm;"'
NOTICE: extension "pg_trgm" already exists, skipping
I, [2023-07-18T07:20:42.455895 #1] INFO -- : CREATE EXTENSION

I, [2023-07-18T07:20:42.456795 #1] INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists vector;"'
NOTICE: extension "vector" already exists, skipping
I, [2023-07-18T07:20:42.645308 #1] INFO -- : CREATE EXTENSION

I, [2023-07-18T07:20:42.646875 #1] INFO -- : > sudo -u postgres psql discourse
I, [2023-07-18T07:20:42.653227 #1] INFO -- : update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = 'discourse' AND encoding = pg_char_to_encoding('SQL_ASCII');

I, [2023-07-18T07:20:42.967449 #1] INFO -- : File > /var/lib/postgresql/take-database-backup chmod: +x chown: postgres:postgres
I, [2023-07-18T07:20:42.980161 #1] INFO -- : File > /var/spool/cron/crontabs/postgres chmod: chown:
I, [2023-07-18T07:20:42.981146 #1] INFO -- : > echo postgres installed!
I, [2023-07-18T07:20:42.992907 #1] INFO -- : postgres installed!

I, [2023-07-18T07:20:43.015614 #1] INFO -- : File > /etc/service/redis/run chmod: +x chown:
I, [2023-07-18T07:20:43.034164 #1] INFO -- : File > /etc/service/redis/log/run chmod: +x chown:
I, [2023-07-18T07:20:43.053622 #1] INFO -- : File > /etc/runit/3.d/10-redis chmod: +x chown:
I, [2023-07-18T07:20:43.055079 #1] INFO -- : Replacing daemonize yes with in /etc/redis/redis.conf
I, [2023-07-18T07:20:43.057030 #1] INFO -- : Replacing (?-mix:^pidfile.*$) with in /etc/redis/redis.conf
I, [2023-07-18T07:20:43.058579 #1] INFO -- : > install -d -m 0755 -o redis -g redis /shared/redis_data
I, [2023-07-18T07:20:43.065729 #1] INFO -- :
I, [2023-07-18T07:20:43.066932 #1] INFO -- : Replacing (?-mix:^logfile.*$) with logfile "" in /etc/redis/redis.conf
I, [2023-07-18T07:20:43.068198 #1] INFO -- : Replacing (?-mix:^bind .*$) with in /etc/redis/redis.conf
I, [2023-07-18T07:20:43.069206 #1] INFO -- : Replacing (?-mix:^dir .*$) with dir /shared/redis_data in /etc/redis/redis.conf
I, [2023-07-18T07:20:43.070149 #1] INFO -- : Replacing (?-mix:^protected-mode yes) with protected-mode no in /etc/redis/redis.conf
I, [2023-07-18T07:20:43.071046 #1] INFO -- : Replacing # io-threads 4 with io-threads $redis_io_threads in /etc/redis/redis.conf
I, [2023-07-18T07:20:43.072023 #1] INFO -- : > echo redis installed
I, [2023-07-18T07:20:43.076436 #1] INFO -- : redis installed

I, [2023-07-18T07:20:43.077243 #1] INFO -- : > cat /etc/redis/redis.conf | grep logfile
I, [2023-07-18T07:20:43.084825 #1] INFO -- : logfile ""

I, [2023-07-18T07:20:43.085568 #1] INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2023-07-18T07:20:43.088373 #1] INFO -- : > sleep 10
111:C 18 Jul 2023 07:20:43.106 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
111:C 18 Jul 2023 07:20:43.106 # Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=111, just started
111:C 18 Jul 2023 07:20:43.106 # Configuration loaded
111:M 18 Jul 2023 07:20:43.108 * monotonic clock: POSIX clock_gettime
111:M 18 Jul 2023 07:20:43.109 * Running mode=standalone, port=6379.
111:M 18 Jul 2023 07:20:43.109 # Server initialized
111:M 18 Jul 2023 07:20:43.110 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
111:M 18 Jul 2023 07:20:43.110 * Loading RDB produced by version 7.0.7
111:M 18 Jul 2023 07:20:43.110 * RDB age 83 seconds
111:M 18 Jul 2023 07:20:43.111 * RDB memory usage when created 1.43 Mb
111:M 18 Jul 2023 07:20:43.112 * Done loading RDB, keys loaded: 32, keys expired: 0.
111:M 18 Jul 2023 07:20:43.112 * DB loaded from disk: 0.002 seconds
111:M 18 Jul 2023 07:20:43.112 * Ready to accept connections
I, [2023-07-18T07:20:53.097394 #1] INFO -- :
I, [2023-07-18T07:20:53.098363 #1] INFO -- : > thpoff echo "thpoff is installed!"
I, [2023-07-18T07:20:53.110927 #1] INFO -- : thpoff is installed!

I, [2023-07-18T07:20:53.112864 #1] INFO -- : > /usr/local/bin/ruby -e 'if ENV["DISCOURSE_SMTP_ADDRESS"] == "smtp.example.com"; puts "Aborting! Mail is not configured!"; exit 1; end'
I, [2023-07-18T07:20:53.370880 #1] INFO -- :
I, [2023-07-18T07:20:53.373398 #1] INFO -- : > /usr/local/bin/ruby -e 'if ENV["DISCOURSE_HOSTNAME"] == "discourse.example.com"; puts "Aborting! Domain is not configured!"; exit 1; end'
I, [2023-07-18T07:20:53.582231 #1] INFO -- :
I, [2023-07-18T07:20:53.582730 #1] INFO -- : > /usr/local/bin/ruby -e 'if (ENV["DISCOURSE_CDN_URL"] || "")[0..1] == "//"; puts "Aborting! CDN must have a protocol specified. Once fixed you should rebake your posts now to correct all posts."; exit 1; end'
I, [2023-07-18T07:20:53.696659 #1] INFO -- :
I, [2023-07-18T07:20:53.697305 #1] INFO -- : > rm -f /etc/cron.d/anacron
I, [2023-07-18T07:20:53.703640 #1] INFO -- :
I, [2023-07-18T07:20:53.708923 #1] INFO -- : File > /etc/cron.d/anacron chmod: chown:
I, [2023-07-18T07:20:53.718910 #1] INFO -- : File > /etc/runit/1.d/copy-env chmod: +x chown:
I, [2023-07-18T07:20:53.727068 #1] INFO -- : File > /etc/service/unicorn/run chmod: +x chown:
I, [2023-07-18T07:20:53.734174 #1] INFO -- : File > /etc/service/nginx/run chmod: +x chown:
I, [2023-07-18T07:20:53.747905 #1] INFO -- : File > /etc/runit/3.d/01-nginx chmod: +x chown:
I, [2023-07-18T07:20:53.763210 #1] INFO -- : File > /etc/runit/3.d/02-unicorn chmod: +x chown:
I, [2023-07-18T07:20:53.764279 #1] INFO -- : Replacing # postgres with sv start postgres || exit 1 in /etc/service/unicorn/run
I, [2023-07-18T07:20:53.765392 #1] INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2023-07-18T07:20:53.779798 #1] INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git reset --hard
138:C 18 Jul 2023 07:20:53.810 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
138:C 18 Jul 2023 07:20:53.811 # Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=138, just started
138:C 18 Jul 2023 07:20:53.812 # Configuration loaded
138:M 18 Jul 2023 07:20:53.817 * monotonic clock: POSIX clock_gettime
138:M 18 Jul 2023 07:20:53.818 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
138:M 18 Jul 2023 07:20:53.820 # Failed listening on port 6379 (TCP), aborting.
Updating files: 100% (33425/33425), done.
I, [2023-07-18T07:21:07.274920 #1] INFO -- : HEAD is now at 3140a4b2c DEV: invert pretty-text build logic (#22524)

I, [2023-07-18T07:21:07.275550 #1] INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git clean -f
I, [2023-07-18T07:21:07.628163 #1] INFO -- :
I, [2023-07-18T07:21:07.628510 #1] INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse bash -c '
  set -o errexit
  if [$(git rev-parse --is-shallow-repository) == "true"]; then
      git remote set-branches --add origin main
      git remote set-branches origin tests-passed
      git fetch --depth 1 origin tests-passed
  else
      git fetch --tags --prune-tags --prune --force origin
  fi
'
From https://github.com/discourse/discourse
 - [deleted] (none) -> origin/avatar-utils
 - [deleted] (none) -> origin/capabilities-outside-service
 - [deleted] (none) -> origin/dependabot/npm_and_yarn/app/assets/javascripts/uppy/aws-s3-multipart-3.4.1
 - [deleted] (none) -> origin/dev/add-last-message-id-to-chat-channel-and-thread
 - [deleted] (none) -> origin/dev/make-sure-we-stream-data-to-csv-files-when-running-exports
 - [deleted] (none) -> origin/dev/make-sure-we-stream-data-to-csv-files-when-running-exports-2
 - [deleted] (none) -> origin/feature/status-on-mentions-on-updated-chat-messages
 - [deleted] (none) -> origin/feature/tracking-unread-thread-in-sidebar
 - [deleted] (none) -> origin/fix/hide-alternate-email-button
 - [deleted] (none) -> origin/update-history-modal
 - [deleted] (none) -> origin/upgrade-group-default-notifcations-modal
 - [deleted] (none) -> origin/ux_user_tips
   3140a4b2c..f76a9aab2 main -> origin/main
   a18f9e59c..a879fdf8a 0-bulk -> origin/0-bulk
 * [new branch] 0-fast-edit -> origin/0-fast-edit
 * [new branch] beta-version-bump -> origin/beta-version-bump
 * [new branch] dependabot/npm_and_yarn/app/assets/javascripts/uppy/aws-s3-multipart-3.5.0 -> origin/dependabot/npm_and_yarn/app/assets/javascripts/uppy/aws-s3-multipart-3.5.0
 * [new branch] dependabot/npm_and_yarn/app/assets/javascripts/uppy/utils-5.4.1 -> origin/dependabot/npm_and_yarn/app/assets/javascripts/uppy/utils-5.4.1
 + d06ce80d6...c742e6722 dependabot/npm_and_yarn/app/assets/javascripts/uppy/xhr-upload-3.3.1 -> origin/dependabot/npm_and_yarn/app/assets/javascripts/uppy/xhr-upload-3.3.1 (forced update)
 * [new branch] dev/add-chrome-options-system-specs -> origin/dev/add-chrome-options-system-specs
 * [new branch] dev/generate-random-actions -> origin/dev/generate-random-actions
   6bb18917d..7b01b9b6b dev/minio-s3-system-specs -> origin/dev/minio-s3-system-specs
 * [new branch] dev/no-need-to-wrap-export-methods-into-enumerator-anymore -> origin/dev/no-need-to-wrap-export-methods-into-enumerator-anymore
   bc08b4040..e097c1ad7 dev/user-that-cant-chat-shouldnt-be-able-to-join-channel -> origin/dev/user-that-cant-chat-shouldnt-be-able-to-join-channel
 * [new branch] dev/using-find-each-in-csv-exports -> origin/dev/using-find-each-in-csv-exports
 * [new branch] discovery-named-outlets -> origin/discovery-named-outlets
 * [new branch] edition-octane -> origin/edition-octane
 * [new branch] ember-5x-transition-to-route-on-controller -> origin/ember-5x-transition-to-route-on-controller
 * [new branch] ember-5x-update-replace-with -> origin/ember-5x-update-replace-with
 * [new branch] ember-5x-update-transition-to -> origin/ember-5x-update-transition-to
 * [new branch] ember-5x-upgrade-replace-route-on-controller -> origin/ember-5x-upgrade-replace-route-on-controller
 + e0d06354e...190f80e7c feature/resolve-outdated-translation -> origin/feature/resolve-outdated-translation (forced update)
   2be34487f..f16c32353 feature/show-status-on-mentions-when-user-havent-used-autocomplete -> origin/feature/show-status-on-mentions-when-user-havent-used-autocomplete
   d9a139fe0..af4da6e18 glimmer-lightbox -> origin/glimmer-lightbox
 * [new branch] issue/bookmark-no-method-disabled-error -> origin/issue/bookmark-no-method-disabled-error
 * [new branch] issue/double-ups-thread-list -> origin/issue/double-ups-thread-list
 + 6c044ab81...414ae2fdc loic-migrate-chat-message-creator-to-a-service -> origin/loic-migrate-chat-message-creator-to-a-service (forced update)
 * [new branch] onebox-srcset -> origin/onebox-srcset
 * [new branch] pr-to-discourse-4115 -> origin/pr-to-discourse-4115
 * [new branch] pr/22593 -> origin/pr/22593
   cec7c05da..461966e02 stable -> origin/stable
   3140a4b2c..f76a9aab2 tests-passed -> origin/tests-passed
 * [new branch] unsilence-modal-deprecation -> origin/unsilence-modal-deprecation
 * [new branch] upgrade-create-invite-bulk-modal -> origin/upgrade-create-invite-bulk-modal
 t [tag update] beta -> beta
 t [tag update] latest-release -> latest-release
 * [new tag] v3.0.5 -> v3.0.5
 * [new tag] v3.1.0.beta6 -> v3.1.0.beta6
I, [2023-07-18T07:21:09.606648 #1] INFO -- :
I, [2023-07-18T07:21:09.606965 #1] INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse bash -c '
  set -o errexit
  if [[$(git symbolic-ref --short HEAD) == tests-passed]] ; then
      git pull
  else
      git -c advice.detachedHead=false checkout tests-passed
  fi
'
Switched to a new branch 'tests-passed'
I, [2023-07-18T07:21:16.184613 #1] INFO -- : Branch 'tests-passed' set up to track remote branch 'tests-passed' from 'origin'.

I, [2023-07-18T07:21:16.187511 #1] INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git config user.discourse-version tests-passed
I, [2023-07-18T07:21:16.212351 #1] INFO -- :
I, [2023-07-18T07:21:16.213268 #1] INFO -- : > cd /var/www/discourse && mkdir -p tmp
I, [2023-07-18T07:21:16.222197 #1] INFO -- :
I, [2023-07-18T07:21:16.223313 #1] INFO -- : > cd /var/www/discourse && chown discourse:www-data tmp
I, [2023-07-18T07:21:16.233253 #1] INFO -- :
I, [2023-07-18T07:21:16.233945 #1] INFO -- : > cd /var/www/discourse && mkdir -p tmp/pids
I, [2023-07-18T07:21:16.242401 #1] INFO -- :
I, [2023-07-18T07:21:16.243169 #1] INFO -- : > cd /var/www/discourse && mkdir -p tmp/sockets
I, [2023-07-18T07:21:16.249820 #1] INFO -- :
I, [2023-07-18T07:21:16.250358 #1] INFO -- : > cd /var/www/discourse && touch tmp/.gitkeep
I, [2023-07-18T07:21:16.258656 #1] INFO -- :
I, [2023-07-18T07:21:16.259512 #1] INFO -- : > cd /var/www/discourse && mkdir -p /shared/log/rails
I, [2023-07-18T07:21:16.268451 #1] INFO -- :
I, [2023-07-18T07:21:16.269195 #1] INFO -- : > cd /var/www/discourse && bash -c "touch -a /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log"
I, [2023-07-18T07:21:16.281321 #1] INFO -- :
I, [2023-07-18T07:21:16.281832 #1] INFO -- : > cd /var/www/discourse && bash -c "ln -s /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log /var/www/discourse/log"
I, [2023-07-18T07:21:16.297333 #1] INFO -- :
I, [2023-07-18T07:21:16.298037 #1] INFO -- : > cd /var/www/discourse && bash -c "mkdir -p /shared/{uploads,backups}"
I, [2023-07-18T07:21:16.307057 #1] INFO -- :
I, [2023-07-18T07:21:16.307285 #1] INFO -- : > cd /var/www/discourse && bash -c "ln -s /shared/{uploads,backups} /var/www/discourse/public"
I, [2023-07-18T07:21:16.314905 #1] INFO -- :
I, [2023-07-18T07:21:16.315207 #1] INFO -- : > cd /var/www/discourse && bash -c "mkdir -p /shared/tmp/{backups,restores}"
I, [2023-07-18T07:21:16.327453 #1] INFO -- :
I, [2023-07-18T07:21:16.327923 #1] INFO -- : > cd /var/www/discourse && bash -c "ln -s /shared/tmp/{backups,restores} /var/www/discourse/tmp"
I, [2023-07-18T07:21:16.337563 #1] INFO -- :
I, [2023-07-18T07:21:16.338041 #1] INFO -- : > cd /var/www/discourse && chown -R discourse:www-data /shared/log/rails /shared/uploads /shared/backups /shared/tmp
I, [2023-07-18T07:21:16.361820 #1] INFO -- :
I, [2023-07-18T07:21:16.362419 #1] INFO -- : > cd /var/www/discourse && [! -d public/plugins] || find public/plugins/ -maxdepth 1 -xtype l -delete
I, [2023-07-18T07:21:16.368095 #1] INFO -- :
I, [2023-07-18T07:21:16.385351 #1] INFO -- : Replacing # redis with sv start redis || exit 1 in /etc/service/unicorn/run
I, [2023-07-18T07:21:16.386357 #1] INFO -- : > cd /var/www/discourse/plugins && git clone https://github.com/discourse/docker_manager.git
Cloning into 'docker_manager'...
I, [2023-07-18T07:21:17.897337 #1] INFO -- :
I, [2023-07-18T07:21:17.898152 #1] INFO -- : > cp /var/www/discourse/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf
I, [2023-07-18T07:21:17.912590 #1] INFO -- :
I, [2023-07-18T07:21:17.919972 #1] INFO -- : > rm /etc/nginx/sites-enabled/default
I, [2023-07-18T07:21:17.936043 #1] INFO -- :
I, [2023-07-18T07:21:17.936400 #1] INFO -- : > mkdir -p /var/nginx/cache
I, [2023-07-18T07:21:17.944092 #1] INFO -- :
I, [2023-07-18T07:21:17.945746 #1] INFO -- : Replacing pid /run/nginx.pid; with daemon off; in /etc/nginx/nginx.conf
I, [2023-07-18T07:21:17.947171 #1] INFO -- : Replacing (?m-ix:upstream[^\}]+\}) with upstream discourse { server 127.0.0.1:3000; } in /etc/nginx/conf.d/discourse.conf
I, [2023-07-18T07:21:17.948443 #1] INFO -- : Replacing (?-mix:server_name.+$) with server_name _ ; in /etc/nginx/conf.d/discourse.conf
I, [2023-07-18T07:21:17.949618 #1] INFO -- : Replacing (?-mix:client_max_body_size.+$) with client_max_body_size $upload_size ; in /etc/nginx/conf.d/discourse.conf
I, [2023-07-18T07:21:17.950700 #1] INFO -- : Replacing (?-mix:worker_connections.+$) with worker_connections $nginx_worker_connections ; in /etc/nginx/nginx.conf
I, [2023-07-18T07:21:17.951540 #1] INFO -- : > echo "done configuring web"
I, [2023-07-18T07:21:17.957300 #1] INFO -- : done configuring web

I, [2023-07-18T07:21:17.958285 #1] INFO -- : > cd /var/www/discourse && gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' Gemfile.lock)
I, [2023-07-18T07:21:20.144662 #1] INFO -- : Successfully installed bundler-2.4.13
1 gem installed

I, [2023-07-18T07:21:20.144850 #1] INFO -- : > cd /var/www/discourse && find /var/www/discourse ! -user discourse -exec chown discourse {} \+
I, [2023-07-18T07:21:39.950404 #1] INFO -- :
I, [2023-07-18T07:21:39.951223 #1] INFO -- : > cd /var/www/discourse && if ["tests-passed" != "tests-passed"]; then
  rm -rf app/assets/javascripts/node_modules
fi
I, [2023-07-18T07:21:39.957453 #1] INFO -- :
I, [2023-07-18T07:21:39.957605 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'yarn install --frozen-lockfile && yarn cache clean'
warning " > @mixer/parallel-prettier@2.0.3" has unmet peer dependency "prettier@^2.0.0".
warning Resolution field "babel-plugin-ember-template-compilation@2.0.0" is incompatible with requested version "babel-plugin-ember-template-compilation@^2.0.1"
warning Resolution field "unset-value@2.0.1" is incompatible with requested version "unset-value@^1.0.0"
2023-07-18 07:24:36.093 UTC [42] LOG: lock file "postmaster.pid" contains wrong PID: 2953 instead of 42
2023-07-18 07:24:36.093 UTC [42] LOG: performing immediate shutdown because data directory lock file is invalid
2023-07-18 07:24:36.093 UTC [42] LOG: received immediate shutdown request
2023-07-18 07:24:36.156 UTC [49] WARNING: terminating connection because of crash of another server process
2023-07-18 07:24:36.156 UTC [49] DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2023-07-18 07:24:36.156 UTC [49] HINT: In a moment you should be able to reconnect to the database and repeat your command.
2023-07-18 07:24:36.160 UTC [369] WARNING: terminating connection because of crash of another server process
2023-07-18 07:24:36.160 UTC [369] DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2023-07-18 07:24:36.160 UTC [369] HINT: In a moment you should be able to reconnect to the database and repeat your command.
2023-07-18 07:24:36.187 UTC [42] LOG: database system is shut down
warning " > babel-plugin-debug-macros@0.4.0-pre1" has unmet peer dependency "@babel/core@^7.0.0".
warning "workspace-aggregator-1d4e40b4-d39e-4d17-9c25-b2c1596e5705 > discourse > @uppy/aws-s3@3.0.6" has incorrect peer dependency "@uppy/core@^3.1.2".
warning "workspace-aggregator-1d4e40b4-d39e-4d17-9c25-b2c1596e5705 > discourse > @uppy/aws-s3-multipart@3.1.3" has incorrect peer dependency "@uppy/core@^3.1.2".
warning "workspace-aggregator-1d4e40b4-d39e-4d17-9c25-b2c1596e5705 > discourse > @uppy/xhr-upload@3.1.1" has incorrect peer dependency "@uppy/core@^3.1.2".
warning "workspace-aggregator-1d4e40b4-d39e-4d17-9c25-b2c1596e5705 > discourse > @uppy/aws-s3 > @uppy/xhr-upload@3.3.0" has incorrect peer dependency "@uppy/core@^3.2.1".
I, [2023-07-18T07:26:44.621322 #1] INFO -- : yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
$ yarn --cwd app/assets/javascripts $(node -e 'if(JSON.parse(process.env.npm_config_argv).original.includes(`--frozen-lockfile`)){console.log(`--frozen-lockfile`)}')
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
$ patch-package
patch-package 7.0.2
Applying patches...
@ember/jquery@2.0.0 ✔
ember-source@3.28.12 ✔
virtual-dom@2.1.1 ✔
Done in 122.73s.
Done in 265.36s.
yarn cache v1.22.19
success Cleared cache.
Done in 37.30s.

I, [2023-07-18T07:26:44.629706 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle config --local deployment true'
I, [2023-07-18T07:26:45.991719 #1] INFO -- :
I, [2023-07-18T07:26:45.992992 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle config --local without "development test"'
I, [2023-07-18T07:26:46.363234 #1] INFO -- : You are replacing the current local value of without, which is currently "test:development"

我的更新过程中出现了错误

```ruby
api_key = "a quick brown fox"
fetch("https://api.example.com/data", headers: { 'Authorization' => api_key })

````

请帮我修复它。

```plaintext
I, [2023-07-18T07:26:46.363569 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --retry 3 --jobs 4'
I, [2023-07-18T07:26:55.829031 #1] INFO -- : 正在从 https://rubygems.org/......... 获取 gem 元数据
使用 rake 13.0.6
使用 concurrent-ruby 1.2.2
使用 erubi 1.12.0
使用 crass 1.0.6
使用 racc 1.7.1
使用 builder 3.2.4
使用 minitest 5.18.1
使用 mini_mime 1.1.2
使用 date 3.3.3
使用 timeout 0.4.0
使用 aws-eventstream 1.2.0
使用 aws-partitions 1.583.0
使用 jmespath 1.6.2
使用 msgpack 1.7.1
使用 bundler 2.4.13
使用 byebug 11.1.3
使用 rack 2.2.7
使用 cgi 0.3.6
使用 cbor 0.5.9.6
正在获取 public_suffix 5.0.3
使用 coderay 1.1.3
使用 chunky_png 1.4.0
使用 colored2 3.1.2
使用 connection_pool 2.4.1
使用 openssl 3.1.0
使用 cppjieba_rb 0.4.2
使用 google-protobuf 3.23.4 (x86_64-linux)
使用 method_source 1.0.0
使用 thor 1.2.2
使用 zeitwerk 2.6.8
使用 tilt 2.2.0
使用 diffy 3.4.2
使用 digest 3.1.1
使用 discourse-fonts 0.0.9
使用 email_reply_trimmer 0.1.13
使用 excon 0.100.0
使用 faraday-net_http 3.0.2
使用 ruby2_keywords 0.0.5
使用 fast_blank 1.0.1
使用 execjs 2.8.1
使用 exifr 1.4.0
使用 fast_xs 0.8.0
使用 fastimage 2.2.7
使用 ffi 1.15.5
使用 fspath 3.1.2
使用 gc_tracer 1.5.1
使用 guess_html_encoding 0.0.11
使用 hana 1.3.7
使用 hashie 5.0.0
使用 highline 2.1.0
使用 htmlentities 4.3.4
使用 hkdf 1.0.0
使用 image_size 3.3.0
使用 http_accept_language 2.1.1
使用 in_threads 1.6.0
使用 json 2.6.3
使用 progress 3.6.0
使用 regexp_parser 2.8.1
使用 unf_ext 0.0.8.2
使用 jwt 2.7.1
使用 kgio 2.11.4
使用 libv8-node 18.16.0.0 (x86_64-linux)
使用 logstash-event 1.2.02
使用 lru_redux 1.1.0
使用 logster 2.12.2
使用 lz4-ruby 0.3.3
使用 memory_profiler 1.0.1
使用 redis 4.8.1
使用 multi_json 1.15.0
使用 multi_xml 0.6.0
使用 mustache 1.1.1
使用 uri 0.12.2
使用 maxminddb 0.1.22
使用 mini_sql 1.4.0
使用 nio4r 2.5.9
使用 version_gem 1.1.3
使用 oj 3.15.0
使用 optimist 3.0.1
使用 raindrops 0.20.1
使用 rchardet 1.8.0
使用 rexml 3.2.5
使用 rinku 2.0.6
使用 rotp 6.2.2
使用 rqrcode_core 1.2.0
使用 pg 1.4.6
使用 sshkey 2.0.0
使用 stackprof 0.2.25
使用 webrick 1.7.0
使用 i18n 1.14.1
使用 tzinfo 2.0.6
使用 nokogiri 1.15.3 (x86_64-linux)
使用 net-protocol 0.2.1
使用 rack-test 2.1.0
使用 rubyzip 2.3.2
使用 aws-sigv4 1.5.0
使用 sprockets 3.7.2 来自 https://github.com/rails/sprockets (位于 3.x@f4d3dae)
使用 bootsnap 1.16.0
使用 request_store 1.5.1
使用 message_bus 4.3.7
使用 rack-mini-profiler 3.1.0
使用 rack-protection 3.0.6
使用 openssl-signature_algorithm 1.3.0
使用 sass-embedded 1.63.6 (x86_64-linux-gnu)
使用 pry 0.14.2
使用 faraday 2.7.10
使用 uglifier 4.2.0
使用 mini_suffix 0.3.3
使用 omniauth 1.9.2
使用 logstash-logger 0.26.1
使用 mini_racer 0.8.0
使用 web-push 3.0.0
使用 image_optim 0.31.3
使用 unf 0.1.4
使用 sidekiq 6.5.9
使用 redis-namespace 1.11.0
使用 net-http 0.3.2
使用 activesupport 7.0.5.1
使用 puma 6.3.0
使用 oauth-tty 1.0.5
使用 snaky_hash 2.0.1
使用 rbtrace 0.4.14
使用 rqrcode 2.2.0
使用 rss 0.2.9
使用 ruby-readability 0.7.0
使用 sanitize 6.0.2
使用 tzinfo-data 1.2023.3
使用 unicorn 6.1.0
使用 net-imap 0.3.6
使用 net-pop 0.1.2
使用 net-smtp 0.3.3
使用 aws-sdk-core 3.130.2
使用 cose 1.3.0
使用 loofah 2.21.3
使用 faraday-retry 2.2.0
使用 oauth2 1.4.11
使用 pry-byebug 3.10.1
使用 pry-rails 0.3.9
使用 dartsass-ruby 3.0.1
使用 rtlcss 0.2.1
使用 mini_scheduler 0.16.0
使用 rails-dom-testing 2.1.1
使用 simpleidn 0.2.1
使用 globalid 1.1.0
使用 activemodel 7.0.5.1
使用 mail 2.8.1
使用 aws-sdk-kms 1.56.0
使用 oauth 1.1.0
使用 rails-html-sanitizer 1.6.0
使用 omniauth-oauth2 1.7.3
使用 json_schemer 1.0.3
使用 activejob 7.0.5.1
使用 actionview 7.0.5.1
使用 active_model_serializers 0.8.4
使用 activerecord 7.0.5.1
使用 aws-sdk-s3 1.114.0
使用 omniauth-facebook 9.0.0
使用 aws-sdk-sns 1.53.0
使用 omniauth-google-oauth2 0.8.2
使用 omniauth-github 1.4.0
使用 omniauth-oauth 1.2.0
使用 actionview_precompiler 0.2.3
使用 discourse-seed-fu 2.3.12
使用 actionpack 7.0.5.1
使用 omniauth-twitter 1.4.0
使用 railties 7.0.5.1
使用 actionmailer 7.0.5.1
使用 lograge 0.12.0
使用 rails_multisite 5.0.0
使用 rails_failover 2.0.1
使用 sprockets-rails 3.4.2
使用 dartsass-sprockets 3.0.0
正在安装 public_suffix 5.0.3
使用 addressable 2.8.4
使用 css_parser 1.14.0
Bundle 完成！137 个 Gemfile 依赖项，173 个 gem 已安装。
未安装 'development' 和 'test' 组中的 gems。
捆绑的 gems 已安装到 `./vendor/bundle`

I, [2023-07-18T07:26:55.832305 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all'
I, [2023-07-18T07:27:11.807532 #1] INFO -- : docker_manager 已是最新兼容版本

I, [2023-07-18T07:27:11.808507 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
111:M 18 Jul 2023 07:27:20.508 * 100 changes in 300 seconds. Saving...
111:M 18 Jul 2023 07:27:20.509 * Background saving started by pid 510
510:C 18 Jul 2023 07:27:20.540 * DB saved on disk
510:C 18 Jul 2023 07:27:20.541 * Fork CoW for RDB: current 1 MB, peak 1 MB, average 0 MB
111:M 18 Jul 2023 07:27:20.611 * Background saving terminated with success
I, [2023-07-18T07:27:21.950341 #1] INFO -- :
I, [2023-07-18T07:27:21.950742 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile'
检测到 Node.js heap_size_limit 较低。使用 --max-old-space-size=1024。
- 正在构建
- 正在构建
- 正在构建...
client_loop: send disconnect: Connection reset
PS C:\Users\dnfoz> o

```

---

<div class="post-metadata">

### Author: ![piffy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/piffy/32/254198_2.png) [@piffy](https://meta.discourse.org/u/piffy)
#### Post date: [2023年七月18日 07:48 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/2 "2023-07-18T07:48:51Z")

</div>

错误消息是“client\_loop: send disconnect: Connection reset”。这是一个 SSH 错误消息，表明您的计算机与服务器的连接已断开。

最可能的原因是您的互联网连接中断或服务器资源不足（内存或磁盘空间不足）并终止了连接。

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [2023年七月18日 07:51 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/3 "2023-07-18T07:51:33Z")

</div>

您能分享一下您服务器的配置（CPU、内存、磁盘大小）吗？

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [2023年七月18日 11:00 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/5 "2023-07-18T11:00:27Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/b/6/f/b6f2f8b56c3478b8f2ec4e945b61e8bb6ba58752.png)

你好，是那个配置吗？

我的天哪，但我的服务器有这个配置

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/6/f/b6f2f8b56c3478b8f2ec4e945b61e8bb6ba58752.png)

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [2023年七月18日 11:08 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/6 "2023-07-18T11:08:01Z")

</div>

您至少需要 1G 的交换空间——您有吗？

```plaintext
free

```

可以告诉您。

编辑：我建议您也阅读  
[MKJ 的主观性部署配置](https://meta.discourse.org/t/mkjs-opinionated-discourse-deployment-configuration/193355)。您有这个警告，这对于内存小的系统来说是不好的

> [@danielabc](#):
>
> `43.110 # WARNING Memory overcommit must be enabled`

请参阅内核配置部分——您需要这些效果，尽管具体命令可能取决于您运行的发行版：

> [@mcdanlj](#):
>
> ## Kernel configuration
> 
> Redis（Discourse 的关键组件之一）强烈建议禁用透明大页，我也允许内存过载。
> 
> ```plaintext
> echo 'sys.kernel.mm.transparent_hugepage.enabled=never' > /etc/sysctl.d/10-huge-pages.conf
> echo 'vm.overcommit_memory=1' > /etc/sysctl.d/90-vm_overcommit_memory.conf
> sysctl --system
> 
> ```

编辑：您可以通过以下方式在运行的服务器上检查这两个重要设置

```plaintext
# cat /proc/sys/vm/overcommit_memory
1
# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]

```

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [2023年七月18日 15:55 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/7 "2023-07-18T15:55:36Z")

</div>

抱歉，我使用的是谷歌翻译，我没有正确理解，什么是交换空间？我的服务器没有这个交换空间？

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [2023年七月18日 16:23 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/8 "2023-07-18T16:23:02Z")

</div>

好的，请在命令行中尝试 `free` 命令并发布输出。

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [2023年七月21日 05:19 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/10 "2023-07-21T05:19:43Z")

</div>

我最终购买了另一台更强大、更强大的服务器，4 vCPU 核心。8 GB RAM，50 GB NVMe，结果当我尝试在上面安装 discourse 时，所有步骤都运行正常，没有出现错误，但当我尝试访问我的网站地址时，会出现以下消息“ERR\_CONNECTION\_TIMED\_OUT”。当我输入 discourse doctor 命令时，它总是卡在那个屏幕上，再也无法退出。

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/4/6/d46ad88f5097621a58f2328a97565a8c805e4af5.png)

我已经重新安装了服务器，我已经重新安装了 discourse，我再次执行了所有步骤，但总是发生这种情况，我不知道还能做什么。

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [2023年七月21日 14:02 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/11 "2023-07-21T14:02:04Z")

</div>

出现以下消息

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/7/7/577a330f38bbc6b533e92f9f6e0bf6ac5abb3b31.png)

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [2023年七月21日 14:06 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/12 "2023-07-21T14:06:10Z")

</div>

好的。所以，确实，你没有交换空间，这可能是导致问题不断出现的原因。（但是，嗯，你有 8G 的内存，这通常应该足够了。）

[这些](https://github.com/discourse/discourse_docker/blob/aa9d0a11edd58a31fcca0d0fce856155e5b389d5/discourse-setup#L207C1-L217C1) 是官方安装脚本在决定创建交换空间时会执行的步骤：

```plaintext
      ##
      ## derived from https://meta.discourse.org/t/13880
      ##
      install -o root -g root -m 0600 /dev/null /swapfile
      fallocate -l 2G /swapfile
      mkswap /swapfile
      swapon /swapfile
      echo "/swapfile swap swap auto 0 0" | tee -a /etc/fstab
      sysctl -w vm.swappiness=10
      echo 'vm.swappiness = 10' > /etc/sysctl.d/30-discourse-swap.conf

```

我建议你仔细地，逐一地粘贴这些命令。然后发布所有命令和所有输出的记录。

然后再次尝试 `free` 命令。

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [2023年七月21日 14:07 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/13 "2023-07-21T14:07:46Z")

</div>

请参考我之前发布的命令，并发布结果：

> [@Ed\_S](#):
>
> 这两个重要设置

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [2023年七月21日 14:40 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/14 "2023-07-21T14:40:06Z")

</div>

这是你放置代码的方式吗？

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/a/1/fa1ef558fa8228eaa6c2180de970a95d4d82e947.png)

但是，我更换了服务器，购买了一个更强大的服务器，我正常进行安装，没有看到任何错误，但当我访问网站时，它显示“ERR\_CONNECTION\_TIMED\_OUT”，并且 discourse doctor 卡在那个屏幕上。

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [2023年七月21日 14:40 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/15 "2023-07-21T14:40:45Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/d/4/6/d46ad88f5097621a58f2328a97565a8c805e4af5.png)

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [2023年七月21日 16:15 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/16 "2023-07-21T16:15:41Z")

</div>

您可能还没有更新您的 DNS 指向新服务器？

此时，医生正在尝试访问您论坛上的“隐私”页面。如果医生停止且没有进展，我认为是因为它无法连接。（不过，应该有 3 秒的超时，所以这可能不是问题。）

试试这个

```plaintext
wget -q --no-check-certificate --timeout=3 https://localhost/privacy -O - |egrep generator

```

然后告诉我们您看到了什么。

Let’s Encrypt 续订证书有速率限制——您可能已经达到了该限制，在这种情况下您需要等待一周。

您最近一次安装时，是否再次看到这个，与您在第一个帖子中报告的一样？

```plaintext
client_loop: send disconnect: Connection reset

```

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [2023年七月21日 17:52 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/17 "2023-07-21T17:52:38Z")

</div>

当我尝试该命令时，没有任何反应

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/9/0/290dfdbc9591c4d715c065b552d5de1ea752e53e.png)

我不记得它是否再次出现，所以我要等一周吗？有没有其他方法可以防止这种情况发生？

```plaintext
client_loop: send disconnect: Connection reset

```

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [2023年七月21日 18:10 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/18 "2023-07-21T18:10:02Z")

</div>

不确定该建议什么——标准安装的说明应该总是成功的。某处一定出了问题，而您没有看到，或者您没有分享。当我们看不到时，很难提供帮助。

我注意到您更改了 `wget` 命令——您没有粘贴确切的命令。因此，我认为我们无法从中学习到任何东西。也许您应该再试一次。

您没有回答关于 DNS 的问题。您应该尝试 ping 您的完全限定域名

```plaintext
ping -c2 your.full.domain.name.com

```

当然，要使用您自己的域名。您应该检查报告的 IP 地址是否与您的服务器的 IP 地址完全相同。

分享完整的会话输出将会有所帮助——当然，请先删除任何私人信息。

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2023年七月21日 19:10 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/19 "2023-07-21T19:10:43Z")

</div>

您是否运行了 `discourse-setup`？它将检查您的 DNS 是否指向您的服务器。

如果您的 DNS 正确并且指向您的服务器，那么您的问题很可能是因为在 DNS 不工作时尝试了多次，并且达到了 Let’s Encrypt 的速率限制。简单的解决方法是等待一周或使用不同的子域名。一个更难的解决方法是使用 [Set up Let’s Encrypt with multiple domains / redirects](https://meta.discourse.org/t/set-up-let-s-encrypt-with-multiple-domains/56685) 请求一个包含多个域名的证书，但既然您已经遇到了麻烦，我建议您在弄清楚问题之前先使用不同的子域名。

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [2023年七月21日 19:14 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/20 "2023-07-21T19:14:19Z")

</div>

抱歉，我正在使用谷歌翻译，很多东西对我来说翻译得很奇怪，我无法理解，但我执行了您要求的命令，并且出现了这个，我隐藏了我的 IP

```plaintext

root@vmi1371983:~# ping -c2 dex-forum.com
PING dex-forum.com 56(84) bytes of data.
64 bytes from vmi1371983.contaboserver.net : icmp_seq=1 ttl=64 time=0.464 ms
64 bytes from vmi1371983.contaboserver.net : icmp_seq=2 ttl=64 time=0.066 ms

--- dex-forum.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1021ms
rtt min/avg/max/mdev = 0.066/0.265/0.464/0.199 ms
root@vmi1371983:~#

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2023年七月21日 19:17 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/21 "2023-07-21T19:17:50Z")

</div>

`ssh dex-forum.com` 是否会将您登录到当前正在使用的同一服务器？如果是，请尝试为 `www.dex-forum.com` 或 `forum.dex-forum.com` 创建一个新的 `A` 记录，然后改用该记录。我建议使用 `www.dex-forum.com` 和 `forcewww.com` 来重定向您的顶点域，而不是使用 `dex-forum.com`。

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [2023年七月21日 21:28 UTC](https://meta.discourse.org/t/problems-building-a-new-server/271944/22 "2023-07-21T21:28:03Z")

</div>

当我使用命令ssh root@myip时，我可以正常访问我的服务器，但当我使用命令ssh dex-forum.com并输入密码时，它显示“Permission denied, please try again.”。这不应该是同一个密码吗？

[下一頁](https://meta.discourse.org/t/problems-building-a-new-server/271944.md?page=2)
