Successfully!

Error!

Cluster Settings

  • Last update:  2020-12-15
  • I. Overview

    1) Cluster Configuration is designed to set up status server, file consistency, caching, communication protocol and certain cluster parameters.

    2) Please contact the technical support team for specific implementations. This article serves as a brief introduction to cluster configurations.

    You will Learn

    Instructions

    • User Interface

    • Cluster Configuration - Enable Status Server

    • Cluster Configuration - Automatic Synchronization for Files

    • Cluster Configuration - Cache Mode 

    • Cluster Configuration - Cluster Communication Protocol

    • Node Management - Open/Close Cluster

    • Node Management - Node Management

    • Node Management - Refresh Cache

    • Set Exception Alert

    • Important Note

    • Parameter Configuration

    II. Instructions

    1. User Interface

    Take the local decision-making platform as an example.

    Some features will be demonstrated on a deployed project separately.

    1) Open the platform in Help -> Demo


    2) Go to Manage -> Intelligent Operations -> Cluster Configuration


    2. Cluster Configuration - Enable Status Server

    Click on the button to set up Cache System.

    1) Redis Single Machine

    Select Redis Single Machine and specify more details

    Field Name

    Value  

    Host

    The IP address for the Redis server. A LAN IP is recommended.

    Port

    Redis port, default: 6379

    Password

    Redis service password. Leave empty if no password is set

    2) Redis Cluster

    Hosts can be manually added or deleted for Redis Cluster. The Host, Port and Password are the same as the single machine. Once done, click "Test connection and save"  to save the configuration.

    A universal password is required for all the Redis nodes should you configure it.


    3. Cluster Configuration - Automatic Synchronization for Files

    When enabling Automatic Synchronization between Nodes, certain folders (namely assets, reportlets, resources, schedule, dashboards, treasures, and ../backup) are automatically synchronized for consistency. With a file server deployed, contents of the aforementioned folders are read from the file server. 

    1) Automatic Synchronization between Nodes

    In the case that file servers are not deployed, the option "Automatic Synchronization between Nodes" is enabled for File Synchronization as shown below:

    It is recommended only when 2 nodes are running, and is not suitable for multiple nodes, since service interruption may occur due to inter-node communication issues.

    2) Share File Server

    Select Share File Server to connect to file servers. FTP, SFTP, HDFS and shared external directory (NAS, NFS, etc.) are supported for now.

    The HDFS and shared external directory are supported via plugins, which need to be installed before configuration.

    Please contact technical support (support@fanruan.com) for plugin files.

    • FTP and SFTP Protocols

    Field Name

    Value  

      Agreement

    FTP or SFTP. Here we are using FTP as an  example

      Encoding

    By default, it is UTF-8 for Linux and GBK for Windows

      Host

    Server address

      Port

    Server port number. By default, it should be 21 for FTP, and 22 for SFTP

      Username

    Server username

      Password

    Server password

      Path

    Details can be found in deployment-themed documents

    Note 1: An active FTP/SFTP server is required, and the login account must have read/write permissions over the configured path.

    Note 2: The Username and Password are not required when using SFTP key. You can leave both fields empty, but a keyfile should be uploaded by clicking on the button next to the Password field.

    Note 3: The Path should be an absolute path for Linux when configuring FTP servers, for example "/home/ftpuser/WEB-INF" ("ftpuser" is your username). As for Windows, a simple "/WEB-INF" just works.

    • HDFS

    The HDFS file server introduces a distributed storage structure for resources, such as templates, ensuring high availability.

    3) Others

    a) In the "Share File Server" mode, if the first node in the cluster fails to connect to file servers during the startup process, it will switch to "Automatic Synchronization between Nodes" mode to ensure that the project can be successfully started, and will send a notification regarding the exception

    b) When using file servers, all template-related changes need to be done on the file server. Making changes in assets, reportlets, resource, schedule, dashboards, treasures, and .../backup under nodes is of no use

    c) Switching from "Share File Server" to "Automatic Synchronization between Nodes" requires restarting all nodes in the clustered project before it is applied


    4. Cluster Configuration - Cache Mode

    Three options, namely Passive Caching, Active Caching and Close Caching, are provided here. All changes are applied immediately after selection.

    Enabling caching improves system performance, reduces time consumption on loading (editing) templates/resources, and allows the system to provide services even when the file server goes down, greatly enhancing system availability. Certain resources, such as templates, profiles and maps, are added to caches by default. For now, four folders (namely "reportlets/", "resources/", "assets/" and "dashboards") are cached.

    Note: Caching can not be disabled when using "Automatic Synchronization between Nodes". However, it is disabled by default for a single machine, and enabling it is not recommended at this point.


    5. Cluster Configuration - Cluster Communication Protocol

    TCP and UDP are frequently-used protocols for network communication. Here the default choice is TCP.

    The communication protocol is configurable with the cluster started, but it needs a restart to apply the change.

    Note: If the project node is the only one displayed after starting the cluster, please change to other connection modes and restart all the node projects.

    Note: UDP is not allowed on cloud servers (Aliyun, AWS, etc.). Please select TCP for Cluster Communication Protocol if it's your case.


    6. Node Management - Open/Close Cluster

    1) Open Cluster

    The status server and external database are required to run clusters, and the message below will be prompted if no configurations are made:

    Once the cluster is successfully started, you will see an interface as below.

    2) Close Cluster

    Click on the toggle to shut down, but the cluster remains running until the next restart.


    7. Node Management - Node Management

    1) The First Node after Restart

    A node appears in the Node Management section after toggling on Open Cluster and restarting. The first-added node is labeled as the reference node for file synchronization if "Automatic Synchronization between Nodes" is selected. No such label is added for "Share File Server".

    • For "Automatic Synchronization between Nodes", all changes to resource files (namely, assets, reportlets, resources, schedule, dashboards, treasures, and ../backup) must be done on the reference node. Committed changes are synchronized to other nodes automatically. Changes made on regular nodes will not be applied.

    • Normally, the selected reference node is not going to be changed, but you can restart the cluster to change the reference node. Still, the first-added one serves as the reference node.

    2) Adding Nodes Dynamically

    With the first node added, you can copy the webroot folder to another server, and start the server to add a new node into Node Management

    Note: Copies of webroot constitute clustered nodes.

    Ports are automatically detected in a running cluster when using web containers (Tomcat, Weblogic, and others). However, the WAS cluster doesn't support such auto-detection, and the default port is 58312. Please set the port for each node as per practical situations.

    Hover the cursor on node information cards to bring out an edit button. Click on the button to configure the node name, IP and port.


    8. Node Management - Refresh Cache

    Refresh Cache button is displayed in the Node Management section when using "Share File Server" with caching enabled. In this case, all manual changes made to files on file servers can not be detected by the cache layer. Thus, a manual refresh is required. As changes are auto-detected in "Automatic Synchronization between Nodes" mode, you don't need to perform a manual refresh and the Refresh Cache button is not displayed.

    Active Caching: click on the button to refresh caches

    Passive Caching: click on the button to clear caches

    Notifications are given upon successful and failed refreshes


    9. Set Exception Alert

    Exception detection can be activated by enabling alerts.


    10. Important Note

    1) JARs of each node will not be auto-synced. Please replace JARs manually when upgrading.

    2) Plugins installed on the platform will be distributed automatically to all nodes, but those directly put into the plugins directory     will not be auto-synced. In this case, manual installation on each node is required.

    3) It is recommended to use Private Cloud AUTH for clusters, saving the trouble of maintaining licenses on multiple nodes.

    4) Each node stores logs on its own for a quick error resolution.


    11. Parameter Configuration

    Developers are allowed to configure commonly used cluster parameters on the FineReport platform, including:

    • Redis Storage Key Prefix

    • Internal Forwarding Parameter

    Hover on the configuration item to display the button for tips. Click on it to see details as shown below:

    1) Redis Storage Key Prefix

    In the case that the Redis server provides services to multiple projects, specifying the key prefix (stored on the Redis server) for different projects is necessary to avoid conflicts in key usages.

    Once configured and restarted, the new key-value with a prefix can be acquired from Redis.

    Configuration Item

    Default Value

    Requirement

    Tip

    Key Prefix

    __fine_redis_key__

    alphanumeric characters and "_"

    Supports alphanumeric characters and   "_". Chinese and special characters are not supported.

    2) Internal Forwarding Parameter

    A round-robin forwarding strategy is generally configured for the load balance feature. The purposes of nodes are irrelevant to load balancers, and each node is assigned requests in turn.  When a node receives a request which can't be handled, it forwards the request internally to another node and acquires the results back in the same way. As a result, a malfunctioning node is unable to process internally forwarded requests, impeding the load balancing process on functioning nodes and leading to a delayed response without warning. To avoid downtime caused by single node malfunctioning, a health check feature for requests forwarded between nodes was added into JARs released on Jun 21st, 2019, which can be used to protect the system from malfunctioning nodes and send warnings on the platform.

    Configuration Item

    Default Value

    Unit

    Requirement

    Note

    Timeout

    90

    second(s)

    Integers greater than or equal to 10

    Timeout for reading and writing operations. If the server does not return or receive any data after the defined period, it is considered as timed out. The system may take minutes or longer to calculate or export certain reports, in which case you can set a longer timeout.

    Values for Nginx parameters proxy_read_timeout and proxy_send_timeout should be greater than the timeout   value configured on the platform.

    Number of Attempts

    8

    Time(s)

    Integers greater than 0

    The maximum number of attempts in a single cycle. The value must be greater than or equal to 1.

    The maximum value is not limited. Version 10.0.2 defaulted the value to 5, and future versions will adjust it to 8.

    It is recommended to set the value of Nginx parameter max_fails greater than or equal to the maximum number of attempts defined here.

    Invalidation Time

    90

    second(s)

    Integers greater than or equal to 10

    A node will be considered as malfunctioning when the number of failed requests exceeds the defined maximum attempts within the invalidation time, and new requests will not be internally forwarded to the node then.

    It is recommended to set the value of Nginx parameter fail_timeout greater than or equal to the invalidation time defined here.


    Attachment List


    Theme: Decision-making Platform
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback