The Linux system built by Minecraft my world server, recommended by my world server

Minecraft is a popular sandbox indie game first created by Swedish programmer Markus “Notch” Perssion and later developed and published by Mojang. This is a game about breaking and placing bricks. First, people build structures to resist the monsters of the night, and as the game progresses, players create fun and imaginative things together.

To set up a Minecraft minecraft server, you need to prepare:

1. A server that can be connected to the external network , with an external network IP
2. Install the Linux system on the server (personally recommend using Linux, because Linux occupies less memory and hard disk, and its performance is better than Windows)

minecraft server configuration requirements

Minecraft is divided into Bedrock Edition and Java Edition. The game content of the two versions is basically the same, but for developers, the server configuration requirements are different. The Java Edition has higher server memory requirements. It is recommended to start with 4G, and it is also related to the number of people online.
5 or fewer people need at least 512MB, 5-10 people need at least 1GB, 10-20 people need at least 2GB.
In addition to the memory size will affect the number of online users, the server bandwidth will also affect the number of online users.
In order to ensure the smooth and stable operation of the game, 10 people are recommended to choose 15M-20M bandwidth. If the online game can reach 60+ players, it is recommended to choose 50M bandwidth. The bandwidth here is different from the broadband we talk about in daily life. Bandwidth refers to the upstream bandwidth, and the downstream speed is not limited. Broadband is commonly referred to as downlink.

1. Determine the server memory size

free -m //Used to view server memory information

Note: Ignore comments when operating in the server.
The effect is as follows

The Linux system built by Minecraft my world server, recommended by my world server
Analysis: Mem: memory; Swap: swap partition; total: total; used: used part; free: free part
Unit: MB

2. Installation - Centos system

1. Update the YUM repository

In order to proceed to the next step smoothly, we need to update the yum repository first.

# yum update     //更新yum库和系统

2. Determine whether JDK is installed

SSH command line input

# java -version     //查看已安装的JDK版本

If the JDK is already installed, the JDK version will be output, such as:

The Linux system built by Minecraft my world server, recommended by my world server
Otherwise it will be:

The Linux system built by Minecraft my world server, recommended by my world server

3. Install JDK

If you have installed JDK, please go to the next step.
SSH command line input

# yum search jdk    //yum库搜索JDK

The effect is as follows

The Linux system built by Minecraft my world server, recommended by my world server
Select the JDK version you want to install (x86 system can only install x86 version, x64 system can only install x86_64 version), such as

# yum install java-1.8.0-openjdk-src.x86_64     //使用yum库安装java-1.8.0-openjdk-src.x86_64

[Format: yum install (add: the previous character here)]

Press Enter to start the installation (the time required depends on the performance of the device). You may be asked whether to continue during the installation, enter y to confirm after confirming the information. After the installation is complete, it is recommended to check the JDK version to prevent errors.

4. Install Screen

The Minecraft server version needs to run continuously in the background. If there is no Screen, the server will automatically disconnect after disconnecting the SSH connection.

SSH input

# yum install screen     //通过yum库安装Screen

5. Start to install the main program

# mkdir mcserver   //创建Minecraft运行目录(目录名可自定义)
# cd mcserver     //切换到运行目录

After creating and switching to the running directory, we can start installing the main program.

# wget -O minecraft_server.jar https://s3.amazonaws.com/Minecraft.Download/versions/1.11.2/minecraft_server.1.11.2.jar     //下载主程序包

[You can customize the version to be installed. The two '1.11.2' in the link can be modified to the version you need (the two must be synchronized). If you want to install a third-party version of the server (such as "bucket"), please manually upload the jar package to the machine /root/mcserver/ directory] If the returned HTTP status code is 404, such
as

The Linux system built by Minecraft my world server, recommended by my world server
then the version does not exist on the remote server. If the return status code is 403 or your machine cannot connect to the download site, please manually upload the package to the server /root/mcserver/ directory after downloading the program locally.

6. Run the main program

Open a Screen

# screen -S 'mcs'     //开启一个名为'mcs'的Screen

Next, start running the jar package

# java -Xmx256M -Xms1M -jar minecraft_server.jar nogui     //以最大256MB内存,最小1MB内存运行jar包

The values ​​after -Xmx and -Xms can be determined according to the server itself, and the unit is MB, and the maximum and minimum values ​​must not be reversed.

Some versions of Minecraft server software need to agree to eula.txt (User Agreement) first. Open eula.txt in the running directory, change eula=false to eula=true, and run the above command again to install it correctly.

3. Installation - Debian and Ubuntu systems

1. Update source

In order to ensure that the next step works correctly, we need to update the source.

# sudo apt-get update     //更新源

2. Determine whether JDK is installed

SSH command line input

# java -version     //查看已安装的JDK版本

If JDK has been installed, then the JDK version will be output, otherwise an error will be reported.

3. Install JDK

If you have installed JDK, please proceed to the next step.
SSH command line input

# sudo apt-get install default-jdk     //通过'源'安装JDK   

Press Enter to start the installation (the time required depends on the performance of the device). You may be asked whether to continue during the installation, press Y to confirm after confirming the information. After the installation is complete, it is recommended to check the JDK version to prevent errors.

4. Install Screen

The Minecraft server version needs to run continuously in the background. If there is no Screen, the server will automatically disconnect after disconnecting the SSH connection.

SSH input

# sudo apt-get install screen     //通过'源'安装Screen

5. Start to install the main program

# mkdir mcserver   //创建Minecraft运行目录(目录名可自定义)
# cd mcserver     //切换到运行目录

After creating and switching to the running directory, we can start installing the main program.

# wget -O minecraft_server.jar https://s3.amazonaws.com/Minecraft.Download/versions/1.11.2/minecraft_server.1.11.2.jar     //下载主程序包    

[You can customize the version to be installed. The two '1.11.2' in the link can be modified to the version you need (the two must be synchronized). If you want to install a third-party version of the server (such as "bucket"), please manually upload the jar package to the machine /root/mcserver/ directory] If the returned HTTP status code is 404, such
as

The Linux system built by Minecraft my world server, recommended by my world server
then the version does not exist on the remote server. If the return status code is 403 or your machine cannot connect to the download site, please manually upload the package to the server /root/mcserver/ directory after downloading the program locally.

6. Run the main program

Open a Screen

# screen -S 'mcs'     //开启一个名为'mcs'的Screen   

Next, start running the jar package

# java -Xmx256M -Xms1M -jar minecraft_server.jar nogui     //以最大256MB内存,最小1MB内存运行jar包    

The values ​​after -Xmx and -Xms can be determined according to the server itself, and the unit is MB, and the maximum and minimum values ​​must not be reversed.

Some versions of Minecraft server software need to agree to eula.txt (User Agreement) first. Open eula.txt in the running directory, change eula=false to eula=true, and run the above command again to install it correctly.

4. Configuration

Open Server.properties in the running directory and modify the configuration.

If you are running a non-genuine version of Minecraft (client, server), be sure to change online-mode=true to online-mode=false and type reload in SSH to reload the configuration file.

5. Set up the server founder (OP)

Enter in SSH

op <name>     //设置name为管理员

Typically, the SSH command line is the most powerful console for Minecraft. You can search for "minecraft console commands" to control the server.

6. Start the connection

Select "Multiplayer" in the corresponding version of Minecraft - add server, the address is your IP:25565.

Seven, restart the server

If your server restarts due to maintenance or crashes, you can simply execute the following command to start Minecraft.

# cd mcserver     //切换到运行目录
# screen -S 'mcs'     //开启一个名为'mcs'的Screen
# java -Xmx256M -Xms1M -jar minecraft_server.jar nogui     //以最大256MB内存,最小1MB内存运行jar包

8. Call Screen again

You can check the operation by calling Screen again.

# screen -ls     //列出已经开启的Screen    

The effect is as follows

The Linux system built by Minecraft my world server, recommended by my world server
We see that the number of Screen mc is 26442, write it down.

# screen -r <id>     //返回编号为id的Screen

Such as screen -r 123

At this point, you can enter commands to manage your server.

Thank you for reading, Server Base Camp will help you become a more professional server administrator!

Guess you like

Origin blog.csdn.net/JUFENG_FEI/article/details/131364402