我在安装 Discourse 时并没有使用 IP 地址,而是使用了一个在公共 DNS 上可解析的正规域名。
我的意思是,每当我在创建虚拟机时通过 Ubuntu ISO 镜像启动并尝试运行安装程序时,Ubuntu 安装程序总会崩溃。无论是 Ubuntu Server 19.10 还是 20.04 LTS 都会出现这种情况,并且在两次安装过程中,系统都会报告无法配置网络接口。如果就这样跳过,安装可以顺利完成,但我没有任何方法将网络接口启动起来以进行任何操作。我成功执行了以下命令: ip address add <ip>/<mask> dev <interface>
但随后我无法通过运行以下命令将其启动: ifup <interface>
之后,我将 ISO 挂载为回环设备并配置为软件源,然后尝试运行以下命令,但系统提示该命令在 ISO 中找不到: apt install net-tools
如果在安装过程中手动设置带有网络详情的接口,这两个版本都会崩溃。
顺便提一下,我是在 ESXi 7.0 上执行此操作,使用的 ISO 文件如下:
ubuntu-20.04-live-server-amd64.iso
ubuntu-19.10-live-server-amd64.iso
rebuild)
if [ "$(git symbolic-ref --short HEAD)" == "master" ]; then
echo "Ensuring launcher is up to date"
git remote update
LOCAL=$(git rev-parse HEAD)
REMOTE=$(git rev-parse @{u})
BASE=$(git merge-base HEAD @{u})
if [ $LOCAL = $REMOTE ]; then
echo "Launcher is up-to-date"
elif [ $LOCAL = $BASE ]; then
echo "Updating Launcher..."
git pull || (echo 'failed to update' && exit 1)
echo "Launcher updated, restarting..."
exec "$0" "${SAVED_ARGV[@]}"
elif [ $REMOTE = $BASE ]; then
echo "Your version of Launcher is ahead of origin"
else
echo "Launcher has diverged source, this is only expected in Dev mode"
fi
fi
set_existing_container
if [ ! -z $existing ]
then
echo "Stopping old container"
(
set -x
$docker_path stop -t 60 $config
)
fi
run_bootstrap
if [ ! -z $existing ]
then
echo "Removing old container"
(
set -x
$docker_path rm $config
)
fi
run_start
exit 0
;;
[root@uat discourse]# pwd
/var/discourse
[root@uat discourse]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@uat discourse]# docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@uat discourse]# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
discourse/base 2.0.20200724-1815 6ba1506bf822 9 days ago 2.38GB
centos latest 831691599b88 6 weeks ago 215MB
alpine latest a24bb4013296 2 months ago 5.57MB
[root@uat discourse]# ./launcher rebuild app
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
cd /pups && git pull && /pups/bin/pups --stdin
Already up to date.
......................................................................
I, [2020-08-03T06:54:22.114365 #1] INFO -- : > echo "Beginning of custom commands"
I, [2020-08-03T06:54:22.116739 #1] INFO -- : Beginning of custom commands
I, [2020-08-03T06:54:22.116996 #1] INFO -- : > echo "End of custom commands"
I, [2020-08-03T06:54:22.119862 #1] INFO -- : End of custom commands
I, [2020-08-03T06:54:22.119983 #1] INFO -- : Terminating async processes
I, [2020-08-03T06:54:22.120021 #1] INFO -- : Sending INT to 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 pid: 49
I, [2020-08-03T06:54:22.120086 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 166
166:signal-handler (1596437662) Received SIGTERM scheduling shutdown...
2020-08-03 06:54:22.120 UTC [49] LOG: received fast shutdown request
2020-08-03 06:54:22.121 UTC [49] LOG: aborting any active transactions
2020-08-03 06:54:22.128 UTC [49] LOG: background worker "logical replication launcher" (PID 58) exited with exit code 1
2020-08-03 06:54:22.128 UTC [53] LOG: shutting down
2020-08-03 06:54:22.154 UTC [49] LOG: database system is shut down
166:M 03 Aug 2020 06:54:22.176 # User requested shutdown...
166:M 03 Aug 2020 06:54:22.176 * Saving the final RDB snapshot before exiting.
166:M 03 Aug 2020 06:54:22.184 * DB saved on disk
166:M 03 Aug 2020 06:54:22.184 # Redis is now ready to exit, bye bye...
sha256:7b8e9281c49ba3dc37e0743a765cddc13ab73aae5486bd30722c696c2e1443b1
ce327c6e37246e63331f03b07d64f4882efa68e88cb1516c6343a9dddbbd59df
+ /usr/bin/docker run --shm-size=512m -d --restart=always -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=4 -e UNICORN_SIDEKIQS=1 -e RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 -e RUBY_GC_HEAP_GROWTH_MAX_SLOTS=40000 -e RUBY_GC_HEAP_INIT_SLOTS=400000 -e RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.5 -e DISCOURSE_DB_SOCKET=/var/run/postgresql -e DISCOURSE_DB_HOST= -e DISCOURSE_DB_PORT= -e LETSENCRYPT_DIR=/shared/letsencrypt -e DISCOURSE_HOSTNAME=uat.xxxxxx.com -e DISCOURSE_DEVELOPER_EMAILS=support@xxxxxx.com -e DISCOURSE_SMTP_ADDRESS=smtp-relay.xxxxxx.com -e DISCOURSE_SMTP_PORT=587 -e DISCOURSE_SMTP_USER_NAME=support@xxxxxx.com -e DISCOURSE_SMTP_PASSWORD=support@xxxxxx.com -e LETSENCRYPT_ACCOUNT_EMAIL=me@example.com -h uat-app -e DOCKER_HOST_IP=172.17.0.1 --name app -t -p 80:80 -p 443:443 -v /var/discourse/shared/standalone:/shared -v /var/discourse/shared/standalone/log/var-log:/var/log --mac-address 02:fe:39:ba:65:e1 local_discourse/app /sbin/boot
44c604ccbda4bfb4d48722e1cbbf70e3b067531acda41175f6bdaaa013cc6d18
确认镜像已构建且 Docker 正在运行
[root@uat discourse]# docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
44c604ccbda4 local_discourse/app "/sbin/boot" 7 minutes ago Up 7 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp app
[root@uat discourse]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
44c604ccbda4 local_discourse/app "/sbin/boot" 7 minutes ago Up 7 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp app
[root@uat discourse]# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
local_discourse/app latest 7b8e9281c49b 8 minutes ago 2.66GB
discourse/base 2.0.20200724-1815 6ba1506bf822 9 days ago 2.38GB
centos latest 831691599b88 6 weeks ago 215MB
alpine latest a24bb4013296 2 months ago 5.57MB