在Raspberry Pi 4上运行Minecraft服务器

“使用AWS建立Minecraft服务器”

根据这个经验,我打算用树莓派4来创建一个Minecraft服务器。

环境

    • Raspberry Pi 4 Model B 4GB (Raspberry Pi 3 Model B でも検証したが厳しい感じ)

 

    • 2020-02-13-raspbian-buster-lite.zip

 

    有線接続LAN

安装

使用这种方法来写入Micro SD卡。

使用Ubuntu Linux将Raspian ZIP文件写入microSD卡

另外,在/boot目录下创建一个SSH文件。

初始设定

登录后的初始设置


$ sudo apt update
$ sudo apt upgrade

之后,


$ sudo raspi-config

作为

在CUI上进行树莓派的初始设置(如果有显示器和键盘的话)。

我进行了与…相似的行动。

顺便提一下,如果使用SSH进行操作的话,感觉无法进行键盘设置。

IP地址的静态化

当您将其用作服务器时,固定IP地址会更方便。


sudo vi /etc/dhcpcd.conf

作为这样的补充,我会把以下内容追加到文件末尾。


interface eth0
static ip_address=192.168.42.104/24
static routers=192.168.42.1
static domain_name_servers=192.168.42.1

保存完成后,使用以下方法重新启动。


$ sudo reboot

将重新登录到102.168.42.104。

安装Java

我使用了Raspbian中提供的最新版本。


sudo apt install openjdk-11-jre

开动

以以下方式启动。


$ java -Xmx1024M -Xms1024M -jar server.jar nogui

在进行测试等情况下,可以按照这个方式进行,但如果需要长期运行或其他操作,建议在末尾加上 “&”,或使用 screen 会话,或者考虑进行自动启动设置或服务化。

使用树莓派4模型B (4G) 运行后,启动仅需大约2分钟,步骤如下:


[20:29:36] [main/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[20:29:36] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[20:29:36] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[20:29:36] [main/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[20:29:36] [main/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[20:29:36] [Server thread/INFO]: Starting minecraft server version 1.15.2
[20:29:36] [Server thread/INFO]: Loading properties
[20:29:36] [Server thread/INFO]: Default game type: SURVIVAL
[20:29:36] [Server thread/INFO]: Generating keypair
[20:29:37] [Server thread/INFO]: Starting Minecraft server on *:25565
[20:29:38] [Server thread/INFO]: Using default channel type
[20:29:38] [Server thread/INFO]: Preparing level "world"
[20:29:39] [Server thread/INFO]: Reloading ResourceManager: Default
[20:30:10] [Server thread/INFO]: Loaded 6 recipes
[20:30:27] [Server thread/INFO]: Loaded 825 advancements
[20:30:28] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:34] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:35] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:36] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:36] [Server thread/INFO]: Preparing spawn area: 0%
[20:30:36] [Server thread/INFO]: Preparing spawn area: 48%
[20:30:49] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:49] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:49] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:50] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:53] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:54] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:54] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:54] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:55] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:55] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:56] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:56] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:57] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:30:57] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:30:58] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:58] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:30:59] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:31:00] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:31:00] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:31:00] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:31:01] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:31:01] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:31:02] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:31:02] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:31:03] [Server-Worker-1/INFO]: Preparing spawn area: 83%
[20:31:03] [Server-Worker-2/INFO]: Preparing spawn area: 83%
[20:31:04] [Server-Worker-3/INFO]: Preparing spawn area: 83%
[20:31:04] [Server-Worker-3/INFO]: Preparing spawn area: 84%
[20:31:05] [Server-Worker-3/INFO]: Preparing spawn area: 84%
[20:31:05] [Server-Worker-3/INFO]: Preparing spawn area: 86%
[20:31:06] [Server-Worker-2/INFO]: Preparing spawn area: 91%
[20:31:06] [Server-Worker-1/INFO]: Preparing spawn area: 91%
[20:31:07] [Server-Worker-1/INFO]: Preparing spawn area: 92%
[20:31:07] [Server-Worker-2/INFO]: Preparing spawn area: 93%
[20:31:08] [Server-Worker-3/INFO]: Preparing spawn area: 95%
[20:31:08] [Server-Worker-3/INFO]: Preparing spawn area: 98%
[20:31:09] [Server thread/INFO]: Preparing spawn area: 99%
[20:31:09] [Server thread/INFO]: Time elapsed: 41122 ms
[20:31:09] [Server thread/INFO]: Done (90.443s)! For help, type "help"
[20:31:13] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 2008ms or 40 ticks behind

让我试试玩一下。

试着动一动,确认没有问题。

将网络内容公开在互联网之外

只需将TCP25565和UDP25565的端口在路由器等设备上进行配置,即可实现公开。

在使用Raspberry Pi 3时产生的日志附赠。

另外,第一次在Raspberry Pi 3上运行时,虽然能够正常工作,但看起来相当吃力。


[19:23:59] [main/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[19:23:59] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9,
 0 0 0]
[19:24:00] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[19:24:00] [main/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[19:24:00] [main/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[19:24:00] [Server thread/INFO]: Starting minecraft server version 1.15.2
[19:24:00] [Server thread/INFO]: Loading properties
[19:24:00] [Server thread/INFO]: Default game type: SURVIVAL
[19:24:00] [Server thread/INFO]: Generating keypair
[19:24:07] [Server thread/INFO]: Starting Minecraft server on *:25565
[19:24:07] [Server thread/INFO]: Using default channel type
[19:24:08] [Server thread/INFO]: Preparing level "world"
[19:24:10] [Server thread/INFO]: Found new data pack vanilla, loading it automatically
[19:24:10] [Server thread/INFO]: Reloading ResourceManager: Default
[19:26:04] [Server thread/INFO]: Loaded 6 recipes
[19:26:06] [Server thread/INFO]: Loaded 825 advancements
[19:26:56] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
[19:26:57] [Server-Worker-2/INFO]: Preparing spawn area: 0%
[19:26:57] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:26:57] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:26:58] [Server-Worker-2/INFO]: Preparing spawn area: 0%
[19:26:58] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:26:59] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:26:59] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:00] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:01] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:01] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:01] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:02] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:02] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:03] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:03] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:04] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:04] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:05] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:05] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:06] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:06] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:07] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:07] [Server-Worker-1/INFO]: Preparing spawn area: 0%
[19:27:08] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:08] [Server-Worker-3/INFO]: Preparing spawn area: 0%
[19:27:09] [Server-Worker-2/INFO]: Preparing spawn area: 0%
[19:27:09] [Server-Worker-2/INFO]: Preparing spawn area: 0%
[19:27:10] [Server-Worker-2/INFO]: Preparing spawn area: 0%
[19:27:10] [Server-Worker-2/INFO]: Preparing spawn area: 0%
[19:27:11] [Server-Worker-2/INFO]: Preparing spawn area: 1%
[19:27:11] [Server-Worker-3/INFO]: Preparing spawn area: 1%
[19:27:12] [Server-Worker-3/INFO]: Preparing spawn area: 1%
[19:27:12] [Server-Worker-2/INFO]: Preparing spawn area: 1%
・
・
・
[19:29:27] [Server-Worker-2/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-2/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-2/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-3/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-2/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-3/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-3/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-3/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-2/INFO]: Preparing spawn area: 92%
[19:29:27] [Server-Worker-2/INFO]: Preparing spawn area: 92%
[19:29:30] [Server-Worker-3/INFO]: Preparing spawn area: 97%
[19:29:30] [Server-Worker-1/INFO]: Preparing spawn area: 97%
[19:29:30] [Server-Worker-3/INFO]: Preparing spawn area: 97%
[19:29:30] [Server-Worker-2/INFO]: Preparing spawn area: 97%
[19:29:30] [Server-Worker-1/INFO]: Preparing spawn area: 97%
[19:29:30] [Server thread/INFO]: Time elapsed: 153775 ms
[19:29:30] [Server thread/INFO]: Done (321.899s)! For help, type "help"
[19:29:32] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 2159ms or 43 ticks behind
[19:30:05] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 17806ms or 356 ticks behind
[19:34:58] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 7821ms or 156 ticks behind
・
・
・

广告
将在 10 秒后关闭
bannerAds