Q100593: Optimum Flix servers setup

Follow

 

SUMMARY

This article describes how to set up your Flix servers for easy maintenance so that adding new servers and upgrading the Flix build when needed can be as easy as possible.

 

MORE INFORMATION

Below you will find a list of requirements for this type of setup, then steps on how to set Flix up so that each server's log files are saved properly in a known location, steps on how to create a service so Flix restarts automatically upon machine reboot, how to easily upgrade to new Flix versions, and how to add more Flix servers. A full setup example will be shown at the end.

 

Requirements

Before you begin, here are the requirements (most are requirements for all Flix installations):

  1. Flix needs to be already installed on a network volume. You can learn how to do a basic install of the Flix server here: Installing Flix Server
  2. Flix will need to be configured to use a floating license server.
  3. Flix will need to be configured to use shared storage for its assets.
  4. Your MySQL 5.7 server will need to allow connections from remote hosts. You can find out how to do this in this KB article: Q100551: Installing MySQL 8 on Red Hat/CentOS 7 or Rocky 9
  5. The hostnames for each of the servers need to be resolvable by the servers themselves and all clients.
  6. The Flix servers will need to have their firewalls open port 8080 (the default port for client communication), 9091 (the default port for file transfers), 9876 (the default port for server-to-server communication, this port doesn't need to be open to the Flix clients only to the Flix servers), 3306 (default for communication to MySQL, this port needs to be open only on the MySQL server), or any other port you configure Flix to work on.

 

Flix Log Files

With the Flix server(s) being run from a network location, the log files risk being outputted to the same directory. To prevent different servers from overwriting each other’s log files, add the log_file option in the config.yml file and point this to a local location. For example:

log_file: /var/log/flix_server.log

If you want to keep all your log files in the same network directory you can specify on each server the log file with a command line flag like this

--log-file /mnt/logs/`hostname`.flix_server.log

 

Creating a Flix Service

Next, we will create a service file for Flix to start automatically after the server is rebooted. This article explains how to do this in more detail:

Q100566: Creating a Flix service in CentOS 7


We need to add the mount point service and make sure Flix is set to start after that service has started otherwise Flix might try to start before the volume is mounted, and fail.
We need to tell the service the full path to the flix_server executable and give it the hostname.

ExecStart=/PATH/TO/flix_server -hostname `hostname` -config-file /PATH/TO/config.yml

When we put the hostname in backquotes like, in this example, the service will pick up the hostname of the server it is running on by pulling it from the system settings. You need to make sure running the `hostname` command on the server returns a hostname that the client computers will be able to resolve. This allows us to use the same config file across all servers without specifying each server's hostname separately.
The -config-file is only needed if your config.yml file lives in a directory other than the one where the flix_server resides. It is very useful if you keep each Flix version in its own directory.
If Flix asks you every time to migrate your asset files, you can also add the -skip-migration flag at the end of your ExecStart line.

Save the service file and add it to the start-up services by running:

systemctl enable flix_server.service

 

The service can then be started at any time by running:

systemctl start flix_server

 

To stop it, run:

systemctl stop flix_server

 

Easy Upgrades

To make upgrading to a new version of Flix easier, you can use symbolic links.
For example, you can create a symbolic link from /mnt/foundry/flix_6.3.3 pointing to /mnt/foundry/flix_production. Then you can point the Flix service to start from /mnt/foundry/flix_production (in which case your ExecStart command in your service file will look like this:

ExecStart=/mnt/foundry/flix/flix_server_production/flix_server -hostname `hostname` -config-file /mnt/foundry/flix/config.yml

 

For example, if you upgrade from flix_6.3.3 to flix_6.3.4 you will only need to replace the symbolic link so that /mnt/foundry/flix_production points to /mnt/foundry/flix_6.3.4. If you don’t do this symbolic link switch, you will need to update the ExecStart path on every Flix server each time.

 

Adding Flix to Additional Servers

To add Flix to additional servers, you just add the same mount point to the new server, copy the flix_server.service file to the same location, for example,/etc/systemd/system/, and enable the service by running:

systemctl enable flix_server

 

Then start the service:

systemctl start flix_server

 

The Flix service will start with the hostname pulled by the `hostname` command from the service file and all other configuration options from the config.yml file.

 

Example

Here is an example of how this works in our environment.

We have a shared network volume /mnt/foundry/ mounted on all our servers. I downloaded the latest Flix server from our website to /mnt/foundry/flix and untared it. It created a directory called flix_server_6.3.5_82. I created a symbolic link using the command:

ln -s flix_server_6.3.5_82 flix_server_production

 

I created a config.yml file and saved it under /mnt/foundry/flix/config.yml. It contains:

mysql_username: user
mysql_password: Password
mysql_hostname: mysqlhostname
floating_license_hostname: licenseserver
floating_license_port: 4101
asset_directory: /mnt/foundry/flix/assets
shared_storage: True
log_file: /var/log/flix_server.log

 

Next, I tested my configuration file by running the following:

/mnt/foundry/flix/flix_server_production/flix_server -config-file /mnt/foundry/flix/config.yml

 

Once I was sure the configuration worked OK, I created a service file - /etc/systemd/system/flix_service.service. It looks like this:

[Unit]
Description=Flix-Service
After=mnt-foundry.mount

[Service] Type=forking ExecStart=/mnt/foundry/flix/flix_server_production/flix_server -hostname `hostname` -config-file /mnt/foundry/flix/config.yml
[Install] WantedBy=multi-user.target

 

I started it by using the system service command:

systemctl start flix_service

 

It worked without any problems, so I set the service to start with the system (so it starts after a reboot) by running the following:

systemctl enable flix_service

 

To add additional Flix servers, I did the following on each new server:

  1. Mount the Flix volume to /mnt/foundry

  2. Copy over the service file from the server which I configured - /etc/systemd/system/flix_service.service

  3. Set the service to start with the system - systemctl enable flix_service

  4. Start the service - systemctl start flix_service

 

FURTHER READING

You can learn in more detail how to create a Flix 6 service here:

Q100566: Creating a Flix service in CentOS 7

 

Step-by-step instructions on how to install a Flix 6 server are available on our learning portal:

Install a Flix server

 

Information on how to setup MySQL on CentOS 6/7 is available here:

Q100551: Installing MySQL 8 on Red Hat/CentOS 7 or Rocky 9

 

Further technical information on how Flix works can be found here:

Flix Technical Overview 

    We're sorry to hear that

    Please tell us why