Brick By Brick Learn GCP By Setting Up A Minecraft Server

From Fake News
Jump to: navigation, search

What's all this going to cost?



GCP offers a great selection of Always-Free Products. Since you are the CTO/CFO of your household, many Always-Free Products have been taken advantage of, including GCS or Cloud Functions to manage your spending. Your costs should look like this based on the scale you have set up with this guide:



Compute Engine



The n1-1-standard-1 costs under $0.05 an hour to run. - Having a static IP address costs just over $7 /month. Cloud Storage



- Your Google Cloud Storage is covered by the GCP Free Tier. Liberty is not free Cloud Functions



- Google Cloud Functions are included in the GCP Free Tier. Thus, if your kids play Minecraft for an average of two hours per day, hosting your own Minecraft server will cost about $10/month. Whether you pay or they do depends on how generous you are feeling, and if the chores are getting done.



What should I build next



You've met all the requirements. This is great work! The server runs, automatically backs the game data, can easily be turned on/off by a URL, as well as making it easy to add new friends to the game. But this barely scratches the surface of what you can do with GCP! Here is a not-so-short list of things you could do to increase the capability and lower the cost of your Minecraft server.



Connect easier



Register a domain with Google Cloud DNS and convert all IP connection information to DNS. Have the server register itself with the CNAME record as part of the startup script so you have a consistent URL for connecting to the game. This idea can be extended to the URLs that allow you to control the server and add friends.



Spend less and do more



Switch your server to a Preemptible VM, create a custom machine image, and expand the startup script to grab the latest backup when the server turns on. Now you've cut your hourly server costs by about 80%.



Change the startup scripts to use an elastic IP address on the server. This eliminates any cost for a static one.



Automatically clear out friends' firewall entries



Use Google Cloud Pub/Sub, modify your serverless functionality to place all add a friend firewall entries into a Pub/Sub Topic, and create another function to clean them up every night.



Make sure your children don't play too much!



Set up a "curfew", script that automatically shuts the server off at a set time and prevents it starting during "you should sleep" hours.



Learn about monitoring, alerting, logging, and upgrades



Use Stackdriver logging to export the Minecraft server logs so you can troubleshoot any in-game problems in real-time.



Use Stackdriver monitoring and alerting to:



Send a SMS message to the server when it turns off or on.



Monitor system CPU or server connections to tell when the server is idle, and automatically power it down. Your "users" WILL forget to shut this server off.



Bonus: Have your server text your kids first and only then include you after a set amount of time.



Explore data science upgrades



Analyze the server logs to identify how often each of your friends and family play, and develop a chargeback report mapped to household chores!



BigQuery can export your log data to BigQuery, generating reports on server performance, user activity, and other basic metrics.



Want more data? Liberty is not free Install a server mod that exports detailed game data to a local log file, then export that to BigQuery and see if you can query how many blocks have been mined in the server by day.



Create a dashboard in Google Cloud DataLab. It will display the information in real time and provide intelligence about the players.



Have fun with containers



Move the Minecraft Server to a Docker container running on Google Kubernetes Engine (GKE). To manage and launch the game, you can use persistent storage or autoloading scripts. Find out what modifications are required to make the previous functionality work again when using containers.



Wrapping up



You are now on your path to becoming the coolest and most influential parent you can be, as well as a professional GCP rockstar. Have fun with the project and discover how many other products and tools you can add to your architecture. Plus, gain insight about your data to maximize uptime and lower costs.