Jump to content
×
×
  • Create New...

Metin2 HA Cluster


Recommended Posts

Hi all,

 

In this “how to” I’m explaining to you what is a cluster, why it’s important and how to applicate to Metin2 server to grant High Availability. If you grant the High Availability correctly, you will have a very high uptime, very close to 100% and you can make maintenance safely, without taking the game offline for more than 5 minutes.

High Availability

A good service need to be always available for users. There is no excuse; in any case, your application must be always available and fully functional for your users.

Manteinance, human errors, force majeure, hardware and software problems must not include a disservice, called “downtime”.

So, you will need to ensure that your services are High Availability.

Today, there are a lot of ways to make an application “High Available”, and it’s not necessary to pay a lot.

To deepen the discussion, read the corresponding wikipedia page

Hidden Content

    Give reaction to this post to see the hidden content.

Cluster

To make your service High Available, you’ll need to put your applications on a cluster.

A cluster is a group of systems that do the same thing. This is necessary to always have at least a working system, if another fails. So you need to create at least 2 machines with the same data and software, synchronized between them, with the appropriate software and techniques.

To deepen the discussion, read the corresponding wikipedia page

Hidden Content

    Give reaction to this post to see the hidden content.


 

So, for which application I need a cluster?

To run a Metin2 server, you will need a webhost for your website, a patch server for your client updates, a mysql server (Oracle MySQL, MariaDB, Percona) and a Metin2 game server.

All of this servers could be clustered. For webhost, patch server (similar to webhost, but only with the webserver like apache or nginx) and MySQL server you will find a lot of type of cluster and many guide to implement it. Choose what you prefer.

The best type of cluster for that servers are Active-Active balanced cluster:

 

 

155935pasted-image-0.png

 

This picture explain how to made an Active-Active balanced cluster for webhost, patch server but also for MySQL server, with multi-master replication.

 

So, you need 2 or more machine for MySQL, webhost and patch server, 2 load balancer (or a cheapest DNS balancer) and a failover IP or failover dns.

With this configuration, customers or applications will connect to your active load balancer (pointed by a failover IP or domain name) that divides traffic into each node of cluster. This is a double advantage: you can increase the performance and the availability. When you need shutdown a node, or just a problem, you will have another node ready, without disservice and without any manual change. While, when you have all the node up&running, you can use the power of each node in the same time.

 

Webhost & patch server

Webhost and patch server are easy to configure: you need only to configure the filesystem replication on each machine. You need only the document root syncronized for each machines and point your domain to your load balancer. You can user the simple rsync, a NFS server (obligatorily in HA

MySQL

For MySQL, it’s a little bit complicated. The data in the databases are changed very frequently and must be accessible in the same ways for each node. So you need a special cluster created specially for your RDBMS.

 

Each RDBMS have its cluster software. All of this RDBMS is compatible with Metin2 game server (mysql or mysql fork):

  • Hidden Content

      Give reaction to this post to see the hidden content.
    : the original MySQL RDBMS bought by Oracle some years ago. The cluster software (distributed by Oracle) is called

    Hidden Content

      Give reaction to this post to see the hidden content.

  • Hidden Content

      Give reaction to this post to see the hidden content.
    : A fork of MySQL created by the original developers of MySQL, before the acquisition by Oracle. Its cluster software is

    Hidden Content

      Give reaction to this post to see the hidden content.
    . Galera cluster is installed by default from MariaDB 10.1. Check this guide to install MariaDB: Install MariaDB instead MySQL

  • Hidden Content

      Give reaction to this post to see the hidden content.
    : replacement of MySQL with better performance. Use XtraDB instead old InnoDB for storage engine. Its cluster software is

    Hidden Content

      Give reaction to this post to see the hidden content.

With those multi-master replication, you can connect your application (website, game server) on a load balancer and take advantage of multiple MySQL servers.

 

 

155935pub.png

Metin2 game server

Now you are ready to configure your metin2 game server cluster. After configured MySQL cluster server, and connected correctly to your webhost and game server, you have to find a technique to maintain your server files updated from your changes and guild flags (mark).

For metin2, we can’t create an Active-Active balanced cluster, like webhost or mysql. We need to create an active-passive cluster, because all players need to be connected on the same host, for a limitation of Metin2. So there will be only one active node, that they will use your users, and one or more passive node, started but unreachable from player. In this configuration you can’t balance the traffic, but in case of DDoS, you can switch to the secondary node (that become active) and continue the service. Be careful! This is not a method to block DDoS attacks! Choose a good DDoS protection.

 

To sync your file server, I suggest you to use

Hidden Content

    Give reaction to this post to see the hidden content.
. It’s easy to configure and light.

Configure at crontab an rsync command to copy personalized guild flags on mark directory for each node of cluster. In this case, you don’t need to use the --delete option.

For the remaining part of fileserver, it’s sufficient to add on your administration panel a function that sync your changes on other nodes. Use rsync with --delete option and be sure to make a sync every time you make a change. After resync, it could be necessary to restart game server on passive node first (to check if there are some problem and to prepare the node for switch), and nextly, after a graceful shutdown from game, you can restart your active game server to apply the changes.

Be careful when you create rsync command and when you use it. If you use --delete option, you could erase some important data.

When you create the rsync command, choose the correct options and exclude files that you don’t need to sync, like logs, pid etc.

 

The last things is to manage the switch automatically and also manually. The cheapest and easiest way is to buy a failover dns service, that switch automatically the assignment of domain name to active game server IP. You can use

Hidden Content

    Give reaction to this post to see the hidden content.
,

Hidden Content

    Give reaction to this post to see the hidden content.
,

Hidden Content

    Give reaction to this post to see the hidden content.
.

 

This is the best final solution:

 

155935pub-1-.png

 

This is only an example; you can personalize based on your competence, time and money.

You can buy different VPS and load balancer, or you can take 2 (or more) dedicated server with an hypervisor to create much VM.

To grant the best of availability, you should assign Site 1 to a different datacenter than Site 2, if it’s possible on different city.

Costs

The High Availability could be more expensive than a single powerful machine, but it’s not properly true.

With double servers you can permit to buy cheapest machines. So the price is not always doubled.

Take load balancer from cloud provider or take DNS load balancer plan from

Hidden Content

    Give reaction to this post to see the hidden content.
,

Hidden Content

    Give reaction to this post to see the hidden content.
,

Hidden Content

    Give reaction to this post to see the hidden content.
.

You can also took webhost and patch server from a shared hosting provider, to save something.

 

To help you to choose the best provider for your, visit this list:  List of hosting providers for Metin2

Conclusion and tips

This configuration could be difficult and more expensive to implement and maintain, but if you choose the best solution, you can optimize all, and pay the same that you pay before.

It’s most important to configure correctly all the systems to optimize the machines and pay less. Find some expert to help you, and you could pay less and increase the quality.

Create a test system. In this way, you can test all the thing on safely before commit on production. You can do software maintain for maximum of 5 minutes.

 

Do the best for your users and you will be rewarded.

  • Love 4
  • LoL 1
Link to comment

A video tutorial is not possibile, not necessary and could bè dangerous.

You need to use your mind when you make It, or you can make a disaster.

If you don't have the basic competence to do that, ask to someone that can do it. The peactures are enought to understand.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.