Table of Contents

Installation

Linux - Docker

/mnt/bigdata/cfg/mervis_db/appsettings.json
{
"Admin": {
    "User": "db_admin_login", //Important - define your own
    "Password": "db_admin_password" //Important - define your own
},
 
"InstanceName": "mervis_db",
"IndexFactoryType": "ESG.Db.Server.DataStorage.FileBackend.Indexing.DiskIndexFactory",
"InfrastructureDataPath": "/mnt/bigdata/mervis_db_data/mervis_db/",
"LogsPath": "/mnt/bigdata/mervis_db_data/mervis_db/",
"PermanentFilesPath": "/mnt/bigdata/mervis_db_data/mervis_db/",
"UpdateNonPrimaryKeys": true,
"MaxDistributionQueueLength": 100000,
"MaxVariableCount": 2000,
"MaxValueCount": 50000,
"GetFunctionsTimeout": 60,
"MaxTotalDataSizeInPersLogQueue": 10000000,
"IdealChunkDataSizeToStoreInPersLog": 1500000,
"PersistentLogCompressionMethod": "Deflate",
"PersistentLogForceSavePeriod": 60,
"UsersFileSize": 24,
"UsersFileGrowth": 20,
"VariablesFileSize": 26,
"VariablesFileGrowth": 21,
"PersLogFileSize": 26,
"PersLogFileGrowth": 24,
"PermFileSetFileSize": 20,
"PermFileSetFileGrowth": 20,
"PermFileSize": 30,
"PermFileGrowth": 22,
"IndexFileSize": 25,
"IndexFileGrowth": 20,
"DirtyProlongation": 3600,
"activeIndexCaching": false,
"maxIndexCacheItems": 1000,
"minIndexCacheDuration": "00:01:00",
"maxIndexCacheDuration": "01:00:00",
"indexCacheRefreshPeriod": "00:01:00",
"WorkItemsBatchSize": 1000,
"DeleteDataBatchSize": 20,
"MaxGTCacheRefreshScanAllPf": true,
 
"ServerMonitoringServerName": "localhost_mervis_db",
"DbStats_Period": "00:01:00",
"CallStats_Active": false,
"CallStats_ApiRoot": "dbCall/",
"CallStats_ServerId": "localhost_mervis_db",
"CallStats_ServerHost": "localhost",
"CallStats_ServerPort": 6000,
"CallStats_ProtocolVersion": "VERSION_FIVE",
"CallStats_MaxMessageSize": "1024",
 
"StatServer.Enabled": false,
"StatServer.IP": "localhost",
"StatServer.Port": 6000,
 
"Host": {
    "ServerUrl": "http://*:9876",
    "ServerUriRoute": "/RcWareDbAccess",
    "ServerId": "mervis_db",
    "Threads": {
        "MinWorkerThreads": 200,
        "MinCompletionPortThreads": 200,
        "MaxWorkerThreads": 32767,
        "MaxCompletionPortThreads": 1000
    },
    "ResponseCompressionEnabled": false,
    "IncludeExceptionDetailInFaults": false
},
 
"PerformanceMonitoring": {
    "CheckPeriod": "00:01:00",
 
    "Cpu": {
        "Enabled": true
    },
    "Memory": {
        "Enabled": true
    },
    "Disk": {
        "Enabled": true,
        "Drives": ["/"]
    },
    "GarbageCollector": {
        "Enabled": true
    }
},
 
"Licensing": {
    "LicensingMode": "Online", // Online, LicenseFile
    "OnlineParams": {
        "ServiceId": "mervis_db",
        "ServiceBaseUri": "https://licenses.mervis.info/online",
        "User": "",
        "Password": "", 
        "LicenseNumber": "DBXXXXXXXXXX", //Important - use the license number acquired from Energocentrum Plus, s.r.o.
        "LocalLicenseCheckDirectory": "/license", //license info is stored in this folder
        "AdditionalFilesToSend": []
    }
},
 
"StatServer": {
    "Enabled": false,
    "Uri": "http://localhost:6000",
    "ApplicationNameAndId": "localhost_mervis_db"
},
 
"Swagger": {
    "Enabled": true
},
 
"Logging": {
 
    "Console": {
        "Disabled": false,
        "format": {
            "outputFormat": "Json",
            "innerNewLine": "\r\n",
            "outerNewLine": "\r\n",
            "logTimeStamp": true,
            "logCategory": false,
            "fullCategory": false,
            "logEventId": false,
            "logThreadId": false
        }
        "Format": {
            "LogCategory": false,
            "FullCategory": false,
            "LogEventId": false,
            "LogThreadId": false
        }
    },
 
    "File": {
        "Disabled": false,
        "Path": "/mnt/bigdata/logs/mervis_db.log",
        "NewFileOnStart": false,
        "Rotate": {
            "Interval": "day",
            "MaxFileSizeMB": 50,
            "MaxTotalSizeMB": 500,
            "MaxFileCount": 10
        },
        "format": {
            "outputFormat": "Text",
            "innerNewLine": "\r\n",
            "outerNewLine": "\r\n",
            "logTimeStamp": true,
            "logCategory": false,
            "fullCategory": false,
            "logEventId": false,
            "logThreadId": false
        }
        "Format": {
            "LogCategory": false,
            "FullCategory": false,
            "LogEventId": false,
            "LogThreadId": false
        }
    },
 
    "Scopes": {
        "Default": true,
        "Categories": { // keys are case insensitive
            "system.": false,
            "microsoft.": false
        }
    },
 
    "Levels": {
        "Default": "Warning", //"Information", //"Warning", //"Trace",
        "Categories": { // keys are case insensitive
            "system.": "None",
            "microsoft.": "None",
            "ESG.StatServer.Shared.StatServerClient": "Warning"
        }
    }
}
}
sudo docker create --name mervis_db --network mervis-network -p 9876:9876 --restart unless-stopped -v /mnt/bigdata/cfg/mervis_db/appsettings.json:/app/appsettings.json:ro -v "/mnt/bigdata/cfg/mervis_db/license:/license" -v /mnt/bigdata/mervis_db_data:/mnt/bigdata/mervis_db_data registry.mervis.info:5556/db/mervis_db:beta
sudo docker restart mervis_db

Installing Nginx for DB Admin Access

SPDBA – Interface for Data Storage from PLC

Mervis DB can receive data from Mervis RT using the SPDBA interface. This component is not part of Mervis DB itself – it is installed as a separate service.

/mnt/bigdata/cfg/spdba/mervis_spdba/appsettings.json
{
"urls": "http://*:15000", //main service port
 
"DbSaver": {
    "DbUri": "http://mervis_db:9876/RcWareDbAccess",
    "CachePath": "./data",
    "Compress": false
},
"StatsTracker": {
    "RtIdExpirationPeriod": "12:00:00"
},
"StatServer": {
    "Uri": "udp://localhost:6000?Enabled=false&ServerName=mervis_spdba&MaxMessageSize=1024"
},
 
"Logging": {
    "Console": {
        "Disabled": false,
        "Format": {
            "LogCategory": false,
            "FullCategory": false,
            "LogEventId": false,
            "LogThreadId": false
        }
    },
 
    "Levels": {
        "Default": "Trace",
        "Categories": {
            "system.": "None",
            "microsoft.": "None",
            "ESG.StatServer.Shared.StatServerClient": "Warning"
        }
    }
},
"AllowedHosts": "*"
}
sudo docker create --name mervis_spdba -p 15000:15000 --network mervis-network -v /mnt/bigdata/cfg/spdba/mervis_spdba/appsettings.json:/app/appsettings.json -v /mnt/bigdata/spdba/mervis_spdba:/app/data --restart unless-stopped registry.mervis.info:5556/spdba/shark_plc_spdba:beta
sudo docker start mervis_spdba

http://localhost:15000/save

Windows (obsolete)

Prerequisites

  1. Download the latest Mervis DB installation archive.
  2. Obtain a license number, e.g., RCWDBXXXXXXXXXXX. Request it from Energocentrum Plus, s.r.o..

Installation

  1. Download hwinfo2.zip
  2. Run ESG.Licenses.HwInfo.exe and use a valid license number to create the .hwdesc file.
  3. Unpack the Mervis DB files into any folder on your drive.
  4. Copy the .licact file next to ESG.Db.Server.Host.exe.
  5. To install Mervis DB as a Windows service, run the following command from an Elevated Command Prompt:
ESG.Db.Server.Host.exe --installService --configFile ESG.Db.Server.Host.exe.config --instanceName MyMervisDbInstance
  1. Multiple Mervis DB instances can be installed (using the –instanceName parameter). Subject to licensing policy.
  2. For more options, run:
ESG.Db.Server.Host.exe --help
  1. Edit the configuration in ESG.Db.Server.Host.exe.config as needed. At minimum, set:
    • PermanentFilesPath
    • LogsPath
    • InfrastructureDataPath
    • Admin username and password
  1. Log into the admin interface (default: http://localhost:11112/)
    • Username and password can be set in ESG.Db.Server.Host.exe.config
  2. Create at least one user with access to the database
  3. Configure the firewall to allow access to the Admin, Monitoring, and Data API as needed.

Do not expose Administration, Monitoring, or Data API to the public internet!

SPDBA Storing Data from Mervis PLC

You can store data directly from Mervis PLC into Mervis DB. A special ASP.NET interface must be installed.

ASP.NET application to convert binary data sent from Mervis PLC into SOAP calls of Mervis DB. You have to install SPDBA if you want to save data directly from Mervis PLC (UniPi, Domat, …).

Requirements

Configuration

Web.config