服务器
选用的是华为云的Flexus云服务器X实例
- 4核8G
- 5M带宽
- SSD存储
- 操作系统Huawei Cloud EulerOS 2.0

后台
通过FinalShell,登录服务器后台。

JDK
从oracle官网下载jdk21

将下载好后的压缩包,通过FinalShell上传到服务器并解压
1
| tar -zxvf jdk-21_linux-x64_bin.tar.gz
|
下面开始配置环境变量
编辑/etc/profile
文件以设置Java环境变量
在文件末尾添加以下内容
1 2 3
| export JAVA_HOME=/root/jdk/jdk-21.0.6 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
|
激活配置
验证安装
Fabric
访问fabric官网,下载服务器核心,并上传到服务器上

首次启动
执行以下指令,启动服务端
1 2 3
|
java -Xmx7G -jar fabric-server.jar nogui
|
首次启动会失败,并会生成eula.txt
文件,需要我们编辑同意协议。
1 2
| # 将eula=false修改为true eula=true
|
配置规则
通过修改server.properties
来配置服务器规则
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
accepts-transfers=false
allow-flight=false
allow-nether=true
broadcast-console-to-ops=true
broadcast-rcon-to-ops=true
bug-report-link=
difficulty=hard
enable-command-block=false
enable-jmx-monitoring=false
enable-query=false
enable-rcon=false
enable-status=true
enforce-secure-profile=true
enforce-whitelist=false
entity-broadcast-range-percentage=100
force-gamemode=false
function-permission-level=2
gamemode=survival
generate-structures=true
generator-settings={}
hardcore=false
hide-online-players=false
initial-disabled-packs=
initial-enabled-packs=vanilla
level-name=world
level-seed=11311638121115121
level-type=minecraft\:normal
log-ips=true
max-chained-neighbor-updates=1000000
max-players=20
max-tick-time=60000
max-world-size=29999984
motd=A Minecraft Server
network-compression-threshold=256
online-mode=true
op-permission-level=4
pause-when-empty-seconds=60
player-idle-timeout=0
prevent-proxy-connections=false
pvp=true
query.port=25565
rate-limit=0
rcon.password=
rcon.port=25575
region-file-compression=deflate
require-resource-pack=false
resource-pack=
resource-pack-id=
resource-pack-prompt=
resource-pack-sha1=
server-ip=
server-port=25565
simulation-distance=10
spawn-monsters=true
spawn-protection=16
sync-chunk-writes=true
text-filtering-config=
text-filtering-version=0
use-native-transport=true
view-distance=10
white-list=false
|
一键运行
新建一个start.sh
,写入启动指令
1
| java -Xmx7G -jar fabric-server.jar nogui
|
后续只要执行sh start.sh
但是此时如果关掉后台,服务器就停掉了。只需通过nohup
挂在后台即可。
安全组
如果在游戏中,搜索不到服务器,检查一下服务器安全组策略是否允许25565
端口
