In this quick tutorial, you'll discover an easy way to set up a failover server for your SFTP server a.k.a. SFTP active-passive high availability cluster.
What we're trying to achieve
Why you need a SFTP failover server
Your primary SFTP server can experience planned or unplanned downtimes. This might be caused by a scheduled maintenance or an outright failure. While that server is down, all business operations that rely on it will also have to come to a halt. In many situations, such downtimes, especially if they stretch over extended periods, are simply unacceptable.
A failover SFTP server serves as a backup that you can quickly activate if your primary server goes down. If you have one, you can reduce your downtimes to just a couple of minutes.
An active SFTP server coupled with a passive (failover) server is usually known as a SFTP active-passive high availability cluster. Let's now go through the steps of setting one up using two instances of JSCAPE MFT Server. JSCAPE MFT SERVER is a highly secure, automated managed file transfer server that supports SFTP as well as several other file transfer protocols.
Settings on your primary SFTP server
In the latest version of JSCAPE MFT Server, active-passive SFTP high availability clustering has been made easier than ever before. All you have to do is point both your primary and failover server to the same global datastore.
Here's what you need to do on your primary server.
Go to Server > Settings > Datastore.
Now, enter the JDBC URL of the external database that serves as your server's global datastore. This global datastore can be any RDBMS database. In preparing for this tutorial, we just created an empty database on MySQL (no tables) and added a user for administering it.
In our example, the JDBC URL is: jdbc:mysql://192.168.100.105/jscape_ha
and the username of our database user is: jscape_ha_admin
We also enter that user's corresponding password.
After entering those basic information, we then click the "Create DB" button. This will create the database schema on the empty database.
If everything goes well, you should see a message box indicating that the "Database created successfully".
You can double-check the database on your RDBMS to verify whether the tables were really created.
Click the Apply button to finalize/commit those settings.
As soon as you click "Apply", you'll be logged out and will temporarily be unable to log in to the Web-based administrative GUI using the same login credentials. That's because you need to add a new administrative user to your newly created global datastore.
To create that administrative user, launch your command prompt or terminal and then navigate to the JSCAPE MFT Server installation directory. Now, enter the following command:
js-addadmin -db -username [admin username] -password [admin password] -sa
Replace [admin username] and [admin password] with your respective administrative login credentials.
As soon as you click the Return key, you should see some notification indicating that the admin user was successfully created.
That's it. Now we move on to the failover server. Yes. That's all you had to do on the primary server side. It's even much easier on your failover server.
Settings on your failover SFTP server
Navigate to the same page on your failover server (i.e. Server > Settings > Datastore).
Enter exactly the same JDBC URL and database user login credentials as the ones you entered on the primary server.
Click the "Test Parameters" button.
If you get a message box indicating that the datastore test passed, then you're all good.
Click Ok and then click the Apply button to finalize/commit your settings.
Because this is a failover server, you don't want it to be receiving file upload/download requests or performing any automated processes while your primary server is up. To keep it on "stand by" mode, go back to your failover server's main screen and navigate to the Domains tab. Now, select the domain that contains your SFTP service and then click the Stop button.
In the screenshot below, the Stop button is already greyed because we already clicked it.
That's it! From this point onwards, all configuration changes you make on your primary SFTP server will be automatically applied to your failover SFTP server. If you want to bring that server up when your primary goes down, just start the domain and make your server accessible to your users/remote servers.
If you want to try this out yourself, download a free, fully-functional evaluation edition of JSCAPE MFT Server now.
In case you want to know how to set up a SFTP server on JSCAPE MFT Server, read the post "Setting Up An SFTP Server" (It's much easier than the usual way).
Other Related posts
Want to be updated on posts like this? Connect with us...