Edge Server Configuration

From RifidiWiki

Jump to: navigation, search

This page explains the various configuration options of the Rifidi Edge Server

RifidiEdgeServer.ini

Note: These options apply to Rifidi Ege runtime (outside of eclipse development) - Inside eclispe these are set within JVM Arguments as part of SDK Launcher config

The RifidiEdgeServer.ini is a property file that contains options for various options when the edge server starts up. For linux, these arguments are in the "rifidi-server" executable.

rifidiserver.ini file

As of release 1.3.0, the default rifidiserver.ini file looks like this:

-console
-vmargs
-Declipse.ignoreApp=true
-Dosgi.noShutdown=true
-Dorg.rifidi.edge.configuration=config/rifidi.xml
-Dosgi.clean=true
-Dorg.osgi.framework.bootdelegation=javax.xml.ws
-Dcom.sun.management.jmxremote.port=2021
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=127.0.0.1
-Dorg.rifidi.edge.core.rmi.port=1101
-Dosgi.framework.extensions=org.eclipse.equinox.weaving.hook
-Dorg.aspectj.osgi.verbose=true
-Dorg.rifidi.edge.autostart=true
-Dorg.rifidi.edge.logging=config/logging.properties
-Dorg.rifidi.ui.notify=false
-Dorg.rifidi.restlet.port=8111
-Dorg.rifidi.restlet.enabled=true
-Dorg.rifidi.mqtt.enabled=true
-Dorg.osgi.service.http.port=8091

Console

-console
This starts up the OSGi console so that you can interact with the edge server from the command line. For a list of commands that are available see Edge Server Commands. If you would like the console to be available over the network, supply a port after the -console (e.g. change to : Note: In Windows -Dosgi.console=2020 needs to be be after VMArgs if you would like to have console run in background and connect remotely via telnet port 20202 Dosgi.console=2020). Now it is possible to telnet into the server at the given port. It is recommended that you use ssh tunneling for security reasons (i.e. first ssh to the machine that is running the edge server, then telnet to the console). One thing to note is that after you telnet to the OSGi console, you cannot use the exit command as you normally would to close the telnet session. This is because exit will be caught by the OSGi console and will perform a System.exit(). Instead, to exit the telnet session while keeping the server running, just close the telnet window.

Example rifidiserver.ini (if telnet and console in background with Windows)

-vmargs
-Dosgi.console=2020
-Declipse.ignoreApp=true
-Dosgi.noShutdown=true
-Dorg.rifidi.edge.configuration=config/rifidi.xml
-Dosgi.clean=true
-Dorg.osgi.framework.bootdelegation=javax.xml.ws
-Dcom.sun.management.jmxremote.port=2021
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=127.0.0.1
-Dorg.rifidi.edge.core.rmi.port=1101
-Dosgi.framework.extensions=org.eclipse.equinox.weaving.hook
-Dorg.aspectj.osgi.verbose=true
-Dorg.rifidi.edge.autostart=true
-Dorg.rifidi.edge.logging=config/logging.properties
-Dorg.rifidi.ui.notify=false
-Dorg.rifidi.restlet.port=8111
-Dorg.rifidi.restlet.enabled=true
-Dorg.rifidi.mqtt.enabled=true

VM

-VM (optional)
This can be added if your wish to override which JVM to use.

Example

-console
-vm 
C:\Program Files (x86)\Java\jre7\bin\java.exe

VMArgs

VMArgs must follow the -vmargs flag in the .ini file. They must start with -D. Default values can be found in the bundle.properties file in the spring directory for the appropriate option. Important VM args:

-Dorg.rifidi.edge.configuration
This is the path to the persistence file. See #rifidi.xml.
-Dcom.sun.management.jmxremote.port
The port to open up JMX on. This is important if you are using a program like VisualVM to profile the server
-Djava.rmi.server.hostname
The hostname to open up the RMI registry at. Default is 127.0.0.1
Note: To allow remote RMI connections such as from Workbench one needs to change the rmi ip to the actual ip address of the server instead of default 127.0.0.1. For Linux/Unbutu Rifidi Edge you will need to do this if your preference is to use Workbench (Windows Only Application)
-Dorg.rifidi.edge.core.rmi.port
The port of the RMI registry Default is 1101
-Dorg.rifidi.edge.ale.host
The hostname to publish the ALE webservices at. Default is 127.0.0.1 (NOTE: ALE has been removed in version 1.3)
-Dorg.rifidi.edge.ale.port
The port to publish the ALE webservices at. Default is 8081 (NOTE: ALE has been removed in version 1.3)
-Dorg.rifidi.edge.ale.read
The service name of the ALE reading service. Default is ALEService (NOTE: ALE has been removed in version 1.3)
-Dorg.rifidi.edge.ale.logicalreader
The service name of the ALE logical reader service. Default is ALELRService (NOTE: ALE has been removed in version 1.3)
-Dorg.rifidi.home
The Rifidi directory. If not set, it defaults to ${user.dir}
-Dorg.rifidi.edge.logging
Specfies locaction of teh logging properties such as debug/info/error thresholds and output. Default is config/logging.properties
-Dorg.rifidi.ui.notify
If set to true, reader adapters will send tag notifications to workbench. Default is true
-Dorg.rifidi.restlet.port=8111
Sets Restlet port used by Rifidi Management APi via REST; default is 8111
-Dorg.rifidi.restlet.enabled
If set to true, Restlet is enabled. Default is true Note: REST is used Rifidi Sensor and Application API
-Dorg.rifidi.mqtt.enabled
If set to true, MQTT is enabled. Default is true. Note: MQTT is used for IoT messaging within Rifidi Edge/Integration with Applications
-Dorg.osgi.service.http.port=8091
Use to set the Jolokia port -Edge Monitoring features Edge_Monitoring default is 8091
-Dorg.rifidi.edge.autostart=true (Note Added in Rifidi 3.5)
Use to set if reader session should auto connect at server start. The setting can be override at reader level by setting the following reader property to DisableAutoStart=true.

rifidi.xml

The rifidi.xml file is the persistence file for the Rifidi Edge Server. The two important services that are saved are Reader Configurations and Command Configurations.

Loading a configuration file

Whenever the edge server starts up, it looks for the file that is specified in the org.rifidi.configuration vm flag. After the configuration file is read, the server will attempt to recreate all services specified in the file. If a needed factory is not available, the service will be skipped and recreated when the factory becomes available. For example, suppose the configuration file has an Alien Reader Configuration and an LLRP Reader Configuration. Suppose that when the server starts up, only the Alien plugin is available (so the Alien Reader Factory is available, but the LLRP Reader Factory is not). At this point the Alien Reader is recreated. If later the LLRP plugin is installed, then the LLRP reader will be recreated.

File Structure

The edge server uses JAXB to persist a configuration file. Each service will have a serviceID and a factoryID. The serviceID is the unique name of the service, and is used when using the service (such as starting a session on a reader). The factoryID is the ID of the factory that can create a service. The following is an example of file that has one Alien Reader saved.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configurationStore>
    <services>
        <attributes>
            <entry>
                <key>ReconnectionInterval</key>
                <value>500</value>
            </entry>
            <entry>
                <key>Port</key>
                <value>20000</value>
            </entry>
            <entry>
                <key>InvertExternalOutput</key>
                <value>0</value>
            </entry>
            <entry>
                <key>PersistTime</key>
                <value>-1</value>
            </entry>
            <entry>
                <key>Username</key>
                <value>alien</value>
            </entry>
            <entry>
                <key>Password</key>
                <value>password</value>
            </entry>
            <entry>
                <key>InvertExternalInput</key>
                <value>0</value>
            </entry>
            <entry>
                <key>ReaderNumber</key>
                <value>0</value>
            </entry>
            <entry>
                <key>ExternalOutput</key>
                <value>0</value>
            </entry>
            <entry>
                <key>IpAddress</key>
                <value>127.0.0.1</value>
            </entry>
            <entry>
                <key>MaxNumConnectionAttempts</key>
                <value>10</value>
            </entry>
            <entry>
                <key>RFAttenuation</key>
                <value>0</value>
            </entry>
        </attributes>
        <factoryID>Alien</factoryID>
        <serviceID>Alien_1</serviceID>
    </services>
</configurationStore>
Personal tools