Then modify the top of the 2nd script to work for whatever instance type you chose, and start it all up by running start.sh. So just make sure you have java 17 installed (I forget why but I'm using Amazon Corretto, Amazon's java distro, installed like this), the two scripts below, and a server jar file on the machine. start.sh, and to view the running server type screen -r (assuming u don't have any other screens running). So I have two scripts, to start the server type. WorkingDirectory=/minecraft/minecraft_serverĮxecStart=/usr/bin/java -Xmx3G -Xms3G -jar minecraft_server.jar -nogui ReadWriteDirectories=/minecraft/minecraft_server InaccessibleDirectories=/root /sys /srv -/opt /media -/lost+found Lrwxrwxrwx 1 root root 29 Mar 28 22:39 minecraft_server -> minecraft_server-1.16_20w13b/ĭrwxr-xr-x 4 minecraft minecraft 4.0K minecraft_server-1.11.2ĭrwxr-xr-x 4 minecraft minecraft 4.0K minecraft_server-1.12.2ĭrwxr-xr-x 5 minecraft minecraft 4.0K minecraft_server-1.13.2ĭrwxr-xr-x 5 minecraft minecraft 4.0K minecraft_server-1.14ĭrwxr-xr-x 4 minecraft minecraft 4.0K minecraft_server-1.14.1ĭrwxr-xr-x 5 minecraft minecraft 4.0K Oct 5 20:16 minecraft_server-1.14.4ĭrwxr-xr-x 4 minecraft minecraft 4.0K Feb 15 22:05 minecraft_server-1.15.2ĭrwxr-xr-x 4 minecraft minecraft 4.0K Mar 28 22:41 ~]# cat /etc/systemd/system/rviceĮnvironmentFile=-/minecraft/minecraft_server/nf If you are interested, here is how I have systemd configured, and my directory structure: ~]# ls -lah /minecraft/ĭrwxr-xr-x 12 root root 4.0K Mar 28 22:39. Total cost is a few bucks a month, I don't even notice it on top of other AWS spend (route53 with my domain name, CloudFront and S3 for my website). Turning it back on is done using the AWS CLI from my desktop: "aws ec2 start-instances -instance-ids i-redacted". I found that I would occasionally forget to power off the server after playing some nights, so I now run a cron job to power the server off at 3am, since I am not typically up that late. The Minecraft install is on a separate EBS volume so I can easily change instances if the need arises (thinking replacement instance in lieu of upgrading the OS). I have it setup to launch using systemd at multi-user target (can control easily with systemctl stop/start rvice), and I use symbolic links pointing to the Minecraft directory so I can easily change the version. Occasionally there are some hiccups, but it is very cheap. I am also running Minecraft in AWS on a t3.medium with unlimited CPU burst enabled. Worst case, you can probably save your world and import it into another host if you decide to not use AWS in the future. So if you only want to play with a handful of friends, and don't need to keep it on constantly, and those friends are savvy enough to use the AWS app or run a python script, I say go for it. But if you've done stuff like this before, it shouldn't be difficult. I remember getting minecraft to start automatically on start up was the hardest part. Though it's been months since I set it up, so I might not remember too many details. Great learning experience.įeel free to ask any questions. I also am a nerd and somewhat new to AWS so setting it up was half the fun. I can't say it's the easiest or cheapest option, but I like the control. And you only lose what you've done since the previous night.Ĭomes to under $20/mo, but I also have a lightsail and elastic IP, and S3 cost for the backup volume. Second, I didn't set whitelisting, and someone found my server and took a bunch of diamonds and shit.Įasy fix, couple minutes to switch to the backup EBS volume. First I dropped a good pickaxe in lava (fat fingered Q). I set up an IAM for my friend to be able to start/ stop the instance. You can write a shirt python boto3 script to turn it on or off. If you're posting a technical query, please include the following details, so that we can help you more efficiently:ĭoes this sidebar need an addition or correction? Tell us here public IP addresses or hostnames, account numbers, email addresses) before posting! ✻ Smokey says: reduce energy use to fight climate change! Note: ensure to redact or obfuscate all confidential or identifying information (eg. News, articles and tools covering Amazon Web Services (AWS), including S3, EC2, SQS, RDS, DynamoDB, IAM, CloudFormation, AWS-CDK, Route 53, CloudFront, Lambda, VPC, Cloudwatch, Glacier and more.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |