Document toolboxDocument toolbox

Support center for flex.bi version 4.0

Installation guide on CentOS 7

These are instructions for flex.bi private 3.0 and later. For earlier version please contact our support.

Requirements

  • Private flex.bi installation is supported on Mac OS XLinux and Windows.
  • Java SE 7 or Java SE 8 should be installed (you can use openjdk).
  • MySQL (version 5.x), PostgreSQL (version 9.x), MS SQL (version 2008 or later) and Oracle (version 11g or later) are supported as Private flex.bi database.

Our default setup

We have chosen Linux CentOS 7 as our default server platform and MySQL/MariaDB as a database engine so these instruction apply for this specific setup.

However it is possible to run flex.bi also on older CentOS, Redhat as well as other distributions of Linux by adjusting the available software, it's versions and installation methods. For example using rpm or apt-get instead of yum or PostgreSQL instead of MySQL.

Versions mentioned here are current as of 18.06.2019 - they might of course change in the future.

More detailed installation instructions for other database engines and more sophisticated setups you can find at https://eazybi.com/help/private-eazybi-installation

Gather the software packages

  • flex.bi - you can get it from our support
  • Java SEyou can use the openjdk
  • MySQL connector - you have to get mysql java connector separately

    At the moment flex.bi is not yet compatible with the version 8 of MySQL connector so please download the latest 5.XX version you can find under "Looking for previous GA version" link

You can either download (or at least try) these using some server side option like command wget or text browser lynx or just download these files to you machine and upload them via SFTP using a tool like Cyberduck

Depending on your server installation options it might be that you need also install packages like unzip, lynx, wget, vim or any other shell commands to perform these tasks, but this is outside the scope of this manual.

Install

Java

Run the following command to install Java:

yum install jre

Run the command java -version and make sure that the result matches the version you just installed.

MySQL/MariaDB

Run the following command to install MariaDB server:

sudo yum install mariadb-server

You can follow instructions available on MariaDB knowledge base.

Flex.bi

For security reasons we recommend creating dedicated flexbi user. Run the following command to achieve that:

sudo useradd flexbi
  1. Move the flex.bi .zip archive file that you received from our support to /home/flexbi directory on your server.
  2. Run the following command to unzip the .zip archive file (file name in the example can differ from the actual file depending on the software version):

    unzip flexbi_private_ezbi-4.7.2_4.3.0_33cdc226e7d.zip

Now you should have /home/flexbi/flexbi_private directory containing the following folders:

  • app
  • bin
  • config
  • examples
  • lib
  • log
  • public
  • spec
  • tmp

    Make sure that the newly created user flexbi has the necessary permissions on the flex.bi server folder flexbi_private and all of it's contents. To .

MySQL connector

  1. Move the downloaded MySQL connector file to /home/flexbi directory on your server and then run the following command to unzip the .zip archive file (file name in the example can differ from the actual file depending on the software version):

    unzip mysql-connector-java-5.1.47.zip
  2. Copy the jar file from the newly created folder to /home/flexbi/flexbi_private/lib directory (if it doesn't exist, create it). Run the following command to achieve that (java version in the example can differ from the actual version depending on the software version):

    cp mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar flexbi_private/lib/

Setup and configuration

MariaDB

If you have large amount of records, we suggest to adjust the database engine performance by editing /etc/my.cnf file using appropriate values.

This is an example of a good performance configuration that you can insert under the [\mysqld]\ part of the configuration file:

innodb_buffer_pool_size = 1024M
innodb_log_file_size = 256M
query_cache_size= 16M
query_cache_type = 1
max_connections = 200

If you change the log file size after starting the MariaDB, you have to delete ib_logfile0 and ib_logfile1 file from /var/lib/mysql/ directory.

Adjust the memory size to a level that you can actually afford on your server, taking into account Java and other application memory needs.

  • Run the following command to make sure MariaDB starts automatically on server startup:

    systemctl enable mariadb
  • Run the following command to start MariaDB:

    sudo systemctl start mariadb

It is recommended to use a dedicated MySQL user instead of the root user. The following is is a quick startup guide that will help you to implement the security measures according to you company guidelines.


  • If this is a new MariaDB installation, perform the following actions to change the password of the root user:

    • Run the following command to connect to mysql:

      mysql -u root
    • Run the following command to change the password of the root user (in the example the new password is 'secret'):

      UPDATE mysql.user SET Password=PASSWORD('secret') WHERE User='root';
      FLUSH PRIVILEGES;
  • Perform the following actions to create new user for flex.bi databases:

    • Run the following command to connect to mysql:

      mysql -u root -p
    • Adjust and run the following command (in the example user's password is 'secret'):

      CREATE USER 'flexbi_private'@'localhost' IDENTIFIED BY 'secret';
      GRANT ALL PRIVILEGES ON `flexbi_private%`.* TO 'flexbi_private'@'%' IDENTIFIED BY 'secret';
      FLUSH PRIVILEGES;


  • If you need a remote access the server (using an admin tool like Sequel Pro), perform the following actions:

    • Run the following command to connect to mysql:

      mysql -u root -p
    • Adjust and run the following command:

      GRANT ALL ON flexbi_private.* TO 'root'@'<remote-ip-address>' IDENTIFIED BY 'PASSWORD';
      GRANT ALL ON flexbi_private_dwh.* TO 'root'@'<remote-ip-address>' IDENTIFIED BY 'PASSWORD';
      FLUSH PRIVILEGES;

      In the code example above, you should use the actual username on the remote machine instead of root (you can also use the root uset), the actual IP address of the remote machine instead of <remote-ip-address> and the actual password on the remote machine instead of PASSWORD.

Flex.bi

  • Configure the eazybi.toml file:
    • Run the following command, to copy the eazybi.toml.sample file in the /config folder to a new file named eazybi.toml:

      cp eazybi.toml.sample eazybi.toml
    • In a text editor of your choice, open the newly created eazybi.toml file and make the necessary configurations:

      • Licence parameters
        • Change the name to the organisation name (it must be exactly the same as the name that you sent it to flex.bi, because the enabler is tied to this name)

      • General parameters, for example, specify:
        • If you wish to allow users to register themselves or only invite them
        • If you would like to allow public accounts or not etc.

      • Default URL parameters
        • Specify host and port that you will use to access flex.bi, for example, bi.company.com:8080

      • Mailer parameters

        • You can set up the name and address used for outgoing e-mails from this private instance, for example, like this:

          [mailer]
          from = "My private flex.bi <flexbi@mydomain.com>"

          In the code example above, you should use your dedicated e-mail address instead of flexbi@mydomain.com.

      • SMTP parameters

        • Specify your SMTP server parameters, in order to be able to send invitations, dashboards and error messages

  • Add a systemd initialization script for flex.bi server:

    • Create a new file named flexbi.service in the /etc/systemd/system directory using a text editor or copy the provided example file from the flex.bi server package folder bin/systemd. Configure the file like this (adjust the configuration to your particular case):

      # Sample init script for flex.bi
      [Unit]
      Description=flex.bi reporting service
      After=syslog.target network.target
      [Service]
      Type=simple
      # Run the service as this user and group
      User=flexbi
      Group=flexbi
      TimeoutSec=30
      # Remember to change /home/flexbi/flexbi_private to the actual home directory of flex.bi in all places
      WorkingDirectory=/home/flexbi/flexbi_private
      Environment="RAILS_ENV=production"
      Environment="EAZYBI_HOME=/home/flexbi/flexbi_private"
      Environment="EAZYBI_PREFIX=/flexbi"
      Environment="RUBYOPT=-W0"
      # Adjust to available memory
      Environment="JAVA_OPTS=-Xmx1024m -Xms256m -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dorg.eclipse.jetty.LEVEL=OFF -Djava.io.tmpdir=/home/flexbi/flexbi_private/tmp"
      
      # Default configuration
      ExecStart=/usr/bin/java $JAVA_OPTS -Dwarbler.host=localhost -Dwarbler.port=8080 -jar flexbi_private.jar
      
      
      Restart=on-failure
      StandardOutput=syslog
      StandardError=syslog
      SyslogIdentifier=flexbi
      #LimitNOFILE=10000
      [Install]
      WantedBy=multi-user.target
    • Check and adjust the necessary parameters, such as user, group and working directory, in the example, as they can differ from your setup.

      If you have changed the configuration after the flex.bi service has been started, run the following code:

      systemctl daemon-reload
    • If you don't use any proxy web server to route web requests to flex.bi, you need to enable public access, because by default flex.bi will answer requests only from localhost. In order to do that, in the flexbi.service file, add a comment symbol (#) before this line:

      ExecStart=/usr/bin/java $JAVA_OPTS "${JAVA_TMPDIR}" -jar flexbi_private.jar -e production "$@"

      and remove the comment symbol (#) from this line:

      # ExecStart=/usr/bin/java $JAVA_OPTS "${JAVA_TMPDIR}" -jar flexbi_private.jar -e production -b 0.0.0.0  "$@"
  •  
    • Run the following command to ensure flex.bi service is started during system startup:

      systemctl enable flexbi.service

Firewall

  • Open the port 8080 in your firewall to allow remote access to the flex.bi server:
    • Run the following command to open the port 8080:

      firewall-cmd --permanent --add-port=8080/tcp
    • Run the following command to reload the firewall:

      firewall-cmd --reload
    • Run the following command to check if the port is open:

      firewall-cmd --list-ports

Google Chrome

  • If you have installed and configured PhantomJS for previous flex.bi enterprise versions then remove PhantomJS settings from the eazybi.toml file by deleting the following lines:

    [phantomjs]location = "..."
  • Run the following command to enable Google YUM repository:

    cat << EOF > /etc/yum.repos.d/google-chrome.repo
    [google-chrome]
    name=google-chrome - \$basearch
    baseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch
    enabled=1
    gpgcheck=1
    gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
    EOF
  • Run the following command to install the package:

    yum install google-chrome-stable
  • After you have installed Google Chrome, please restart flex.bi enterprise. During the startup, flex.bi will detect installed Google Chrome and will start to use it for PDF exports. 

    For additional information regarding Google Chrome installation please see Google Chrome installation instructions.



We recommend to set up a web server running as reverse proxy to have SSL support for you site. For more information and instructions see this setup manual.

Make sure there is enough (and any for that matter) swap space available and set the swappiness setting to 1. See this manual for CentOS.

Run the flex.bi server

Finally, now you can start the flex.bi service using this code:

systemctl start flexbi

Configure the database connection in the wizard that should open once you connect for the first time using the database parameters from above.


There are many tutorials on how to use systemd out there, such as this one from Digital Ocean.

Troubleshooting

In case of any issues, inspect the log files and contact our support.