3. Running DynFi on any operating system¶
DynFi has two external dependencies. In order to make it run:
- Java >= 11 has to be installed on the machine where DynFi is supposed to run,
- MongoDB >= 3.4 has to be available from the machine where DynFi is supposed to run (can be the same, but can also be available over the network).
Please note that DynFi is released for Debian and Ubuntu operating systems in a way which provides easy/automated updates (thanks to APT) and also systemd scripts. (See Installing DynFi on Ubuntu.)
However, you can run DynFi manually (or create your own “startup scripts”) in any OS as long as it meets dependencies listed above.
To download DynFi’s dynfi-version.jar file, browse dynfi.com. Of course, instead of the version
in the file name, there should be an actual version.
This single JAR file contains DynFi’s server and DynFi’s Web User Interface. Except Java >= 11 and MongoDB >= 3.4 nothing else should be needed to run DynFi using this JAR file.
3.1. Installing Java¶
You can check if Java is installed using such command in terminal / command line interface:
java -version
If the version reported is 7 or below, you need to upgrade. If your operating system does not support any automated or tooled approach of installing Java, you can install free and open source OpenJDK from AdoptOpenJDK.
The successful check should result in similar output:
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
As with any other tool, please keep it updated for latest bugfixes and security upgrades.
3.2. Installing MongoDB¶
To store data DynFi Manager uses MongoDB in version 3.4 or above.
If you are not sure if MongoDB is installed on your computer or which version it is, you can perform the following check in the terminal / command line interface:
mongo --eval "db.version()"
Make sure that the line MongoDB server version
shows at least version 3.4. The output might look like this:
MongoDB shell version v3.4.6
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.6
3.4.6
If it turns out that your computer is not running MongoDB and you cannot access it on other machine(s) in your network (as DynFi Manager can also connect to MongoDB installed elsewhere), you can follow installation tutorial for the operating system of your choice from MongoDB.
3.3. Running DynFi on Windows¶
Through not recommended, it is possible to run DynFi on Windows.
In this example DynFi ix going to connect to local MongoDB (by default).
Thus, having both Java 11 and MongoDB installed on the machine, DynFi can be started like this:
java -jar dynfi-version.jar
(Of course the actual file name should be used instead of dynfi-version.jar
file as above.)
This should start DynFi and bind it to all IP addresses available, especially 127.0.0.1. The output should be similar to the image below (after the custom SSL certificate is accepted):
As seen in the image, due to lack of default log directory, DynFi prints all logs to standard output. This can be easily changed be creating a (sub)directory for DynFi to write its logs:
mkdir logs
Before starting again, an environment variable can also be set to configure DynFi not to use HTTPS, like this:
SET useHttps=false
When starting again, one can specify the newly created logs
(sub)directory as the directory where DynFi should write
its logs (instead of the console):
java -DLOG_DIR=logs -jar dynfi-version.jar
This way DynFi’s WUI can be accessed using e.g. http://127.0.0.1
from the same machine and instead of printing logs to
console, will write them to logs/dynfi.log
, as shown below.
Of course, various options can be written to config file, as described in Configuration chapter. For tuning logs, refer to Logs.
3.4. Running DynFi on FreeBSD¶
The following example shows how to quickly run DynFi on FreeBSD 11.
In this example DynFi is going to connect to remote MongoDB running on host 192.168.10.64.
To install Java 11 on FreeBSD, please follow FreeBSD Documentation. To install OpenJDK11, one should basically call in terminal:
sudo pkg install openjdk11
And follow the procedure.
In case MongoDB should be installed locally, this is possible with:
sudo pkg install mongodb34
sudo echo mongod_enable=\"YES\" >> /etc/rc.conf
sudo service mongod start
If Java 11 is installed and recent dynfi.jar file is downloaded to current directory, DynFi can be started like this (it should connect to MongoDB on localhost):
java -jar dynfi-version.jar
(Of course the actual file name should be used instead of dynfi-version.jar
file as above.)
This should start DynFi and bind it to all IP addresses available, especially 127.0.0.1. The output should be similar to the image below (after accepting custom certificate with security exception).
As seen in the image, due to lack of default log directory, DynFi prints all logs to standard output. This can be easily changed by creating the default directory for DynFi to write its logs:
mkdir /var/log/dynfi
When starting again, one can also specify precise IP address (192.168.10.50 in this very example) and port (443, default for HTTPS) DynFi should bind to. This way DynFi can be started using:
ipAndPort=192.168.10.50:443 java -jar dynfi-version.jar
This way DynFi’s Web User Interface can be accessed using https://192.168.10.50
address in browser and instead of
printing logs to standard output, will write them to /var/log/dynfi/dynfi.log
, as shown below.
If MongoDB is not available on localhost and cannot be installed on localhost (due to whatever reason), it has to be
available somewhere in the network. Then mongoClientUri
can be used to configure DynFi so it will connect to
remote MongoDB, installed on 192.168.10.64 in this very example:
mongoClientUri=mongodb://192.168.10.64 java -jar dynfi-version.jar
Of course, various options can be written to config file, as described in Configuration chapter. For tuning logs, refer to Logs.
3.5. Upgrading DynFi for manual use¶
If you are running DynFi manually, using a file which has been downloaded from http://dynfi.com and DynFi shows the message that there is a new version of DynFi available, the upgrade procedure is very simple. The whole task is to download a new file and run it exactly the same way as previously.
It might be easier to use one of the supported distributions, like Debian or Ubuntu. Then the upgrade of DynFi is fully automatic, as described in Upgrading DynFi.