さくらの VPS でマルチプレイ用 Minecraft サーバーを立てる
手順
- root でログイン,不要なデーモン (マイクラサーバーを運用していく上で特に使用しないサービス) をOFFにする.
最後に再起動して設定を反映させる.$ chkconfig auditd off $ chkconfig haldaemon off $ chkconfig lvm2-monitor off $ chkconfig mdmonitor off $ chkconfig messagebus off $ chkconfig netfs off $ chkconfig restorecond off $ chkconfig smartd off $ reboot
これを実施することで CentOS 自体のメモリ使用量が 500MB 超から 100MB 程度になりました.
$ free total used free shared buffers cached Mem: 1020580 97964 922616 0 6972 32868 -/+ buffers/cache: 58124 962456 Swap: 2097144 0 2097144
マイクラサーバーを起動した状態でこんな感じ.
$ free total used free shared buffers cached Mem: 1020580 327952 692628 0 8012 57524 -/+ buffers/cache: 262416 758164 Swap: 2097144 0 2097144
- Java をインストール.
JDK のリンクは Oracleのサイト から入手可能です.$ wget http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-linux-x64.rpm?AuthParam=1354713154_7cab191ee6d836452cd9d23a0bc74f65 $ mv jdk-7u9-linux-x64.rpm?AuthParam=1354713154_7cab191ee6d836452cd9d23a0bc74f65 jdk-7u9-linux-x64.rpm $ sudo rpm -ivh ./jdk-7u9-linux-x64.rpm
- screen をインストール.
$ sudo yum install screen
- Minecraft Server をダウンロード.
ホームディレクトリにマイクラサーバー用のフォルダを作成し,その中にサーバー本体をダウンロードします.$ cd ~ $ mkdir minecraft $ cd minecraft $ wget https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar $ wget -O minecraft "http://www.minecraftwiki.net/wiki/Tutorials/Server_startup_script/Script?action=raw" $ chmod a+x ./minecraft
- Minecraft Server を起動.
$ ./minecraft start
- Minecraft Server を停止.
$ ./minecraft stop