Most CII services (not: telemetry and alarms) come as part of the DevEnv installation, however some post-installation set-up is needed before they can be used.
Most CII services (not: telemetry and alarms) come as part of the DevEnv installation, however some post-installation set-up is needed before they can be used.
Post-installation is always necessary when you start working on a newly installed DevEnv host.
Post-installation is always necessary when you start working on a newly installed DevEnv host. After an upgrade of the DevEnv on an existing host, post-install may be necessary, too. In these cases, the Release Notes of the DevEnv version will inform you so.
After an upgrade of the DevEnv on an existing host, post-install may be necessary, too. In these cases, the Release Notes of the DevEnv version will inform you so.
_Note on DevEnv versions before 3.6_: On older DevEnv versions, you need to download the post-install first. On DevEnv 3.4, first execute this command (as root): `yum -y install elt-ciisrv-postinstall`. On DevEnv 3.5, execute this command (as root): `yum -y update elt-ciisrv-postinstall`
_Note on DevEnv versions before 3.6_: On older DevEnv versions, you need to download the post-install first. On DevEnv 3.4, first execute this command (as root): `yum -y install elt-ciisrv-postinstall`. On DevEnv 3.5, execute this command (as root): `yum -y update elt-ciisrv-postinstall`
To run post-install, execute this command (as root):
To run post-install, execute this command (as root):
```
```plaintext
# /elt/ciisrv/postinstall/cii-postinstall <choose a role>
# /elt/ciisrv/postinstall/cii-postinstall <choose a role>
```
```
To learn about the options, run the command without arguments.
To learn about the options, run the command without arguments.
For more details and examples, see the [cii-postinstall user manual](http://www.eso.org/~eltmgr/CII/latest/manuals/html/docs/services.html)
For more details and examples, see the [cii-postinstall user manual](http://www.eso.org/\~eltmgr/CII/latest/manuals/html/docs/services.html)
After postinstall, you will want to start the CII services on your host (unless you have assigned the "groupclient" role to the host, which means you will use the CII Services running on another host).
After postinstall, you will want to start the CII services on your host (unless you have assigned the "groupclient" role to the host, which means you will use the CII Services running on another host).
The cii-services utility lets you start/stop/monitor the CII services. For some operations, it requires root-privileges, and can be run with `sudo`. If you don't use sudo, it will show a root password prompt when needed.
The cii-services utility lets you start/stop/monitor the CII services. For some operations, it requires root-privileges, and can be run with `sudo`. If you don't use sudo, it will show a root password prompt when needed.
Note: Before using CII services, you or an administrator have to run the CII-post-installation, see [How-to post-install CII services](#how-to-post-install-cii-services)
Note: Before using CII services, you or an administrator have to run the CII-post-installation, see [How-to post-install CII services](#how-to-post-install-cii-services)
*status*
_status_ This is a feature-centric view, that basically tells you which features you have available. For example, "Blob Values" means that the Distributed File System MinIO (in previous versions: Hadoop) is available for storage of large values and binaries.
This is a feature-centric view, that basically tells you which features you have available. For example, "Blob Values" means that the Distributed File System MinIO (in previous versions: Hadoop) is available for storage of large values and binaries.
```
```plaintext
$ cii-services status
$ cii-services status
```
```
*info*
_info_ This is a deployment-centric view that tells you whether the services are running and where they are.
This is a deployment-centric view that tells you whether the services are running and where they are.
```
```plaintext
$ cii-services info
$ cii-services info
```
```
*start / stop*
_start / stop_
```
```plaintext
$ sudo cii-services start <services>
$ sudo cii-services start <services>
```
```
To learn about the options, run the command without arguments.
To learn about the options, run the command without arguments.
For more details and examples, see the [cii-services user manual](http://www.eso.org/~eltmgr/CII/latest/manuals/html/docs/services.html)
For more details and examples, see the [cii-services user manual](http://www.eso.org/\~eltmgr/CII/latest/manuals/html/docs/services.html)
@@ -84,11 +89,12 @@ After this, you find the list of available demo apps in the (generated) README f
...
@@ -84,11 +89,12 @@ After this, you find the list of available demo apps in the (generated) README f
Most demo apps require CII Services be running on your host or on another host => Check that the related CII Services (e.g. config service for a a config demo app) are accessible: see [How-to start/stop CII Services](#how-to-start-stop-cii-services)
Most demo apps require CII Services be running on your host or on another host => Check that the related CII Services (e.g. config service for a a config demo app) are accessible: see [How-to start/stop CII Services](#how-to-start-stop-cii-services)
@@ -163,38 +168,36 @@ You have defined a struct containing a member of the same name ("feedback" in th
...
@@ -163,38 +168,36 @@ You have defined a struct containing a member of the same name ("feedback" in th
```
```
or you have used a struct name that is a reserved word in Protobuf. Rename it.
or you have used a struct name that is a reserved word in Protobuf. Rename it.
```
```plaintext
<struct name="Swap">
<struct name="Swap">
<member name="counter" type="uint32_t"/>
<member name="counter" type="uint32_t"/>
</struct>
</struct>
```
```
**Background**
**Background**
In the first case, the code that gets generated for the member looks to the compiler like a mal-formed constructor. In the second case, you have used a struct name that is already taken by a method name that protobuf secretly generates into the code to be compiled, which then leads to the same problem.
In the first case, the code that gets generated for the member looks to the compiler like a mal-formed constructor. In the second case, you have used a struct name that is already taken by a method name that protobuf secretly generates into the code to be compiled, which then leads to the same problem.
When I build my ICD, the build completes without errors or warnings,
When I build my ICD, the build completes without errors or warnings, but I find it has not generated any cpp and python classes for my ICD. I do see protoc file, though
but I find it has not generated any cpp and python classes for my ICD.
I do see protoc file, though
**Solution**
**Solution**
Check that you have specified all needed dependencies in your waf script.
Check that you have specified all needed dependencies in your waf script. The "requires" list needs to contain the following entries: requires='cxx python protoc fastdds boost cii gtest nosetests pytest'
The "requires" list needs to contain the following entries:
@@ -285,26 +291,26 @@ The error message is misleading (will be improved, [ECII-426](https://jira.eso.o
...
@@ -285,26 +291,26 @@ The error message is misleading (will be improved, [ECII-426](https://jira.eso.o
The code generator for malicd_topics fails when the ICD file name starts with lowercase.
The code generator for malicd_topics fails when the ICD file name starts with lowercase.
For more information, see also: [KB: PYBIND errors \[ICD waf build\]](onenote:#KB%20PYBIND%20errors%20[ICD%20waf%20build]§ion-id={F524F9BE-F51D-4A01-9976-93359FCC4966}&page-id={0FEE4FB9-C58B-4E8A-A276-2EC4367CFB30}&end&base-path=https://europeansouthernobservatory.sharepoint.com/sites/ELT_Control/SiteAssets/ELT_Control%20Notebook/Documentation/ELT%20Control%20KnowledgeBase.one)
For more information, see also: [KB: PYBIND errors \[ICD waf build\]](onenote:#KB%20PYBIND%20errors%20%5BICD%20waf%20build%5D§ion-id=%7BF524F9BE-F51D-4A01-9976-93359FCC4966%7D&page-id=%7B0FEE4FB9-C58B-4E8A-A276-2EC4367CFB30%7D&end&base-path=https://europeansouthernobservatory.sharepoint.com/sites/ELT_Control/SiteAssets/ELT_Control%20Notebook/Documentation/ELT%20Control%20KnowledgeBase.one)
The cpp compiler runs out of memory and crashes. You can see the effect by running htop in a separate terminal, all memory (including swap space) is consumed by the g++ compiler, which consequently crashes.
The cpp compiler runs out of memory and crashes. You can see the effect by running htop in a separate terminal, all memory (including swap space) is consumed by the g++ compiler, which consequently crashes.
...
@@ -322,9 +327,8 @@ _Memory needed for building a given ICD module_
...
@@ -322,9 +327,8 @@ _Memory needed for building a given ICD module_
There is a base load that is the same for all ICD modules. On top of that, the ICD file contents determine how much memory is needed to build the module.
There is a base load that is the same for all ICD modules. On top of that, the ICD file contents determine how much memory is needed to build the module.
_Rule of Thumb_
_Rule of Thumb_
| MAL version | Base Load | Mem per ICD-Struct |
| MAL version | Base Load | Mem per ICD-Struct |
| --- | ---- | ---- |
|-------------|-----------|--------------------|
| MAL 1.x | 650 MB (2/3 GB) | 320 MB (1/3 GB) |
| MAL 1.x | 650 MB (2/3 GB) | 320 MB (1/3 GB) |
| MAL 2.0 | 650 MB (2/3 GB) | 110 MB (1/8 GB) |
| MAL 2.0 | 650 MB (2/3 GB) | 110 MB (1/8 GB) |
...
@@ -333,7 +337,8 @@ Thus, if your biggest ICD contains 20 structs, building under MAL 1.x will requi
...
@@ -333,7 +337,8 @@ Thus, if your biggest ICD contains 20 structs, building under MAL 1.x will requi
_Measuring_
_Measuring_
Record metrics of the ICD build with this time-command:
Record metrics of the ICD build with this time-command:
```
```plaintext
$ alias time='TIME="real\t%E\nmem\t%Mk\ncpu\t%P\npf\t%F" time'
$ alias time='TIME="real\t%E\nmem\t%Mk\ncpu\t%P\npf\t%F" time'
$ time waf build
$ time waf build
...
@@ -349,12 +354,12 @@ pf 166
...
@@ -349,12 +354,12 @@ pf 166
More info is available at [ECII-109](https://jira.eso.org/browse/ECII-109)
More info is available at [ECII-109](https://jira.eso.org/browse/ECII-109)
**Solution 1: Decrease the module's footprint**
**Solution 1: Decrease the module's footprint**
1. Remove unnecessary middlewares
1. Remove unnecessary middlewares
Use the `xyz_disabled` options:
Use the `xyz_disabled` options:
```python
```python
fromwtoolsimportmodule
fromwtoolsimportmodule
# Disable OPCUA and DDS, since not part of this interface.
# Disable OPCUA and DDS, since not part of this interface.
By default the build system uses all cores on the host. Less parallelism means less memory consumers during the build. This is controlled by the waf `-j` option.
By default the build system uses all cores on the host. Less parallelism means less memory consumers during the build. This is controlled by the waf `-j` option.
To build with only 4 cores:
To build with only 4 cores: `$ time waf -j4 build`
` $ time waf -j4 build `
As a rough estimate, each waf build task will consume around 2 GB RAM, so on a 12 core host with 16 GB RAM, a parallelism of 8 may be a good choice. Try different numbers of cores and use the output from the time-command (see above) to find an optimum between real, page faults, and cpu.
As a rough estimate, each waf build task will consume around 2 GB RAM, so on a 12 core host with 16 GB RAM, a parallelism of 8 may be a good choice. Try different numbers of cores and use the output from the time-command (see above) to find an optimum between real, page faults, and cpu.
3. Adjust the compiler flags
3. Adjust the compiler flags
The default set of compiler flags applied by the build system consume significant memory.
The default set of compiler flags applied by the build system consume significant memory. We recommend using "-O2 -flto -pipe" (_to be confirmed_) instead. This is how you pass custom compiler flags for your ICD-module:
We recommend using "-O2 -flto -pipe" (_to be confirmed_) instead. This is how you pass custom compiler flags for your ICD-module:
In your project wscript:
In your project wscript:
~~~python
```python
fromwtoolsimportproject
fromwtoolsimportproject
[...]
[...]
defconfigure(cnf):
defconfigure(cnf):
cnf.env.CXXFLAGS_MALPYTHON='-O2 -flto -pipe'
cnf.env.CXXFLAGS_MALPYTHON='-O2 -flto -pipe'
[...]
[...]
~~~
```
4. Refactor your ICD
4. Refactor your ICD
Reduce the memory need by splitting the big ICDs up into 2 or more smaller ICD modules.
Reduce the memory need by splitting the big ICDs up into 2 or more smaller ICD modules.
**Solution 2: Increase the available memory**
**Solution 2: Increase the available memory**
1. Find RAM consumers and stop them, at least temporarily. For example, ElasticSearch uses a significant amount of RAM: `sudo cii-services stop elasticsearch`
1. Find RAM consumers and stop them, at least temporarily. For example, ElasticSearch uses a significant amount of RAM: `sudo cii-services stop elasticsearch`
When building an ICD using CII-MAL, you see this warning message:
When building an ICD using CII-MAL, you see this warning message:
```
```plaintext
variable tracking size limit exceeded
variable tracking size limit exceeded
```
```
...
@@ -474,7 +472,7 @@ There are two easy ways to do it on the overall project.
...
@@ -474,7 +472,7 @@ There are two easy ways to do it on the overall project.
**Solution A**
**Solution A**
```
```plaintext
Export CXXFLAGS=-fno-var-tracking-assignments
Export CXXFLAGS=-fno-var-tracking-assignments
```
```
...
@@ -486,48 +484,47 @@ Note: you have to have the exported variable each time you do a “waf configure
...
@@ -486,48 +484,47 @@ Note: you have to have the exported variable each time you do a “waf configure
If you want it to be inside the project then put the flags fixed inside your project, so in the top level wscript (where you define the project) add this configure section before the project declaration:
If you want it to be inside the project then put the flags fixed inside your project, so in the top level wscript (where you define the project) add this configure section before the project declaration:
Starting the server does not fix the situation, and gives this error:
Starting the server does not fix the situation, and gives this error:
```
```plaintext
Errno 48 : Address already in use
Errno 48 : Address already in use
```
```
**Solution**
**Solution**
The solution is to not use ports from the ephemeral range (aka local port range). The port numbers in the ephemeral range can be found with `cat /proc/sys/net/ipv4/ip_local_port_range`. For DevEnv 3.x with CentOS 8 they are:
The solution is to not use ports from the ephemeral range (aka local port range). The port numbers in the ephemeral range can be found with `cat /proc/sys/net/ipv4/ip_local_port_range`. For DevEnv 3.x with CentOS 8 they are:
| Port Range | Usable for MAL |
| Port Range | Usable for MAL |
|---- | ---- |
|------------|----------------|
| 1 -1023 | 🟠 No |
| 1 -1023 | 🟠 No |
| 1024 - 32767 | 🟢 Yes |
| 1024 - 32767 | 🟢 Yes |
| 32768 - 60999 | 🟠 No |
| 32768 - 60999 | 🟠 No |
| 61000 - 65535 | 🟢 Yes |
| 61000 - 65535 | 🟢 Yes |
With the implementation of ECII-402, the MAL library will write a warning log (and can also be configured to throw an exception) if an application runs a MAL instance on one of the ephemeral ports.
With the implementation of ECII-402, the MAL library will write a warning log (and can also be configured to throw an exception) if an application runs a MAL instance on one of the ephemeral ports.
...
@@ -539,11 +536,13 @@ After a while of (re-)connection attempts, the client will manage to connect...
...
@@ -539,11 +536,13 @@ After a while of (re-)connection attempts, the client will manage to connect...
This happens because TCP design allows for a 'simultaneous connect feature': if a client is trying to connect to local port and if the port is from the ephemeral range, it can occasionally connect to itself. The client thinks it is connected to a server, however it is actually connected to itself. Moreover, the server can not bind to its server port anymore.
This happens because TCP design allows for a 'simultaneous connect feature': if a client is trying to connect to local port and if the port is from the ephemeral range, it can occasionally connect to itself. The client thinks it is connected to a server, however it is actually connected to itself. Moreover, the server can not bind to its server port anymore.
MAL supports the below MAL specific property to limit queue size for large message publishers.
MAL supports the below MAL specific property to limit queue size for large message publishers.
```
```plaintext
mal::Mal::Properties m_malProperties1;
mal::Mal::Properties m_malProperties1;
m_malProperties1["zpb.ps.zmq.sndhwm"] = "1";
m_malProperties1["zpb.ps.zmq.sndhwm"] = "1";
...
@@ -653,23 +654,23 @@ The issue has been first reported in [ECII-159](https://jira.eso.org/browse/ECII
...
@@ -653,23 +654,23 @@ The issue has been first reported in [ECII-159](https://jira.eso.org/browse/ECII
The problem lies in the ZMQ send queues. Default size is 1000 and with 144MB per message (in this case) this means 144GB. Limiting this to 1 (for a test) a publisher can handle 20 subscribers (tested) without any problems. The solution is to reconfigure the send-queue size appropriately.
The problem lies in the ZMQ send queues. Default size is 1000 and with 144MB per message (in this case) this means 144GB. Limiting this to 1 (for a test) a publisher can handle 20 subscribers (tested) without any problems. The solution is to reconfigure the send-queue size appropriately.
Trying to send a msg, I get the following error message from CII:
Trying to send a msg, I get the following error message from CII:
```
```plaintext
[libprotobuf ERROR google/protobuf/message_lite.cc:121] Can't parse message of type "generated.zpb.fcfif.StdCmds_Request" because it is missing required fields: data.Setup.payload[0].piezoData.input
[libprotobuf ERROR google/protobuf/message_lite.cc:121] Can't parse message of type "generated.zpb.fcfif.StdCmds_Request" because it is missing required fields: data.Setup.payload[0].piezoData.input
```
```
My ICD definition looks like this
My ICD definition looks like this
```xml
```xml
<enumname="PiezoInput">
<enumname="PiezoInput">
...
@@ -717,7 +718,7 @@ My ICD definition looks like this
...
@@ -717,7 +718,7 @@ My ICD definition looks like this
My code looks like this
My code looks like this
```
```plaintext
[...]
[...]
auto piezo = mal->createDataEntity<::fcfif::Piezo>();
auto piezo = mal->createDataEntity<::fcfif::Piezo>();
piezo->setId("foo");
piezo->setId("foo");
...
@@ -731,10 +732,10 @@ union->setPiezoData(piezo);
...
@@ -731,10 +732,10 @@ union->setPiezoData(piezo);
[...]
[...]
```
```
**Solution**
```
**Solution**
```plaintext
auto p = factory.getClient<::fcfif::PiezoTestSync>(uri,
auto p = factory.getClient<::fcfif::PiezoTestSync>(uri,
{std::make_shared<mal::rr::qos::ReplyTime>
{std::make_shared<mal::rr::qos::ReplyTime>
(std::chrono::seconds(3))},
(std::chrono::seconds(3))},
...
@@ -769,17 +770,19 @@ Your code does not work since you do not use union instance provided by the pare
...
@@ -769,17 +770,19 @@ Your code does not work since you do not use union instance provided by the pare
This issue was first described in [ECII-154](https://jira.eso.org/browse/ECII-154)
This issue was first described in [ECII-154](https://jira.eso.org/browse/ECII-154)
MAL logging is initialized from a configuration file, the path of which is read from mal properties with key mal::PROP_LOG_CONFIG_FILENAME. When loading mal, use set mal::PROP_LOG_CONFIG_FILENAME in mal properties.
MAL logging is initialized from a configuration file, the path of which is read from mal properties with key mal::PROP_LOG_CONFIG_FILENAME. When loading mal, use set mal::PROP_LOG_CONFIG_FILENAME in mal properties.
@@ -1137,21 +1143,24 @@ The multicast middlewares (DDS and MUDPI) supported by the MAL allow you to spec
...
@@ -1137,21 +1143,24 @@ The multicast middlewares (DDS and MUDPI) supported by the MAL allow you to spec
**Solution (DDS)**
**Solution (DDS)**
Get the XML file shown in Solution #1 on this page: <https://community.rti.com/howto/control-or-restrict-network-interfaces-nics-used-discovery-and-data-distribution>, and continue with this article:
Get the XML file shown in Solution #1 on this page: <https://community.rti.com/howto/control-or-restrict-network-interfaces-nics-used-discovery-and-data-distribution>, and continue with this article: [KB: Configuring DDS](https://gitlab.eso.org/ecs/eltsw-docs/-/wikis/KnowledgeBase/CII#configuring-dds-mal-dds)
export FASTRTPS_DEFAULT_PROFILES_FILE=<path of XML file>
export FASTRTPS_DEFAULT_PROFILES_FILE=<path of XML file>
```
```
---
---
---
### Discovery over multiple NICs \[MAL DDS\]
**Problem**
How do DataReaders connect over multiple NICs
**Explanantion**
Let's say we have 3 hosts:
- A: one NIC on 192.168.1.10 and another NIC on 10.10.10.10
- B: one NIC on 192.168.1.11
- C: one NIC on 10.10.10.12
On host A we have a participant with FASTDDS_STATISTICS="PUBLICATION_THROUGHPUT_TOPIC" and a DataWriter on topic _important_high_frequency_data_.
On host B we have a participant with FASTDDS_STATISTICS="SUBSCRIPTION_THROUGHPUT_TOPIC" and a DataReader on topic _important_high_frequency_data_
On host C we have the Fast DDS monitor.
Participants B and C will **not** discover each other, since they are on different LANs.
Participant A discovery will announce:
"I have a DataWriter for topic _important_high_frequency_data_ communicating through any of 192.168.1.10, 10.10.10.10.
I also have a DataWriter for topic _fastdds_statistics_publication_throughput_ communicating through any of 192.168.1.10, 10.10.10.10."
Participant B discovery will announce:
"I have a DataReader for topic _important_high_frequency_data_ listening on 192.168.1.11.
I also have a DataWriter for topic _fastdds_statistics_subscription_throughput_ communicating through any of 192.168.1.11."
The DataWriter on participant A will then send data for topic _important_high_frequency_data_ listening to 192.168.1.11 (through NIC 192.168.1.10)
Participant C discovery will announce:
"I have a DataReader for topic _fastdds_statistics_publication_throughput_ listening on 10.10.10.12.
I also have a DataReader for topic _fastdds_statistics_subscription_throughput_ listening on 10.10.10.12."
The statistics DataWriter on participant A will then send data for topic _fastdds_statistics_publication_throughput_ to 10.10.10.12 (through NIC 10.10.10.10) and be visible on DDS Monitor.
This article covers integration of OPC/UA in CII MAL specifically for OPC/UA Data Access and Subscription profiles. OPC/UA method invocation is also supported in CII MAL but is not described in this article, likewise details of the Python (and Java) support are not provided. Only C++ is considered here.
This article covers integration of OPC/UA in CII MAL specifically for OPC/UA Data Access and Subscription profiles. OPC/UA method invocation is also supported in CII MAL but is not described in this article, likewise details of the Python (and Java) support are not provided. Only C++ is considered here.
...
@@ -1224,20 +1276,18 @@ The XML ICD definition of types in CII is used to map sets of data points togeth
...
@@ -1224,20 +1276,18 @@ The XML ICD definition of types in CII is used to map sets of data points togeth
Each attribute in the defined type is connected to a corresponding data point in the OPC/UA data space via a URI. Thus the CII URI for a complex type will contain specific addresses of multiple nodes in the OPC/UA data space.
Each attribute in the defined type is connected to a corresponding data point in the OPC/UA data space via a URI. Thus the CII URI for a complex type will contain specific addresses of multiple nodes in the OPC/UA data space.
The CII MAL Pub/Sub API utilizes OPC/UA Data Access Reads and Writes, as well OPC/UA subscription. A Publisher will directly trigger an OPC DA write, while a Subscriber will work in one of two ways, depending on the type associated with the subscriber:
The CII MAL Pub/Sub API utilizes OPC/UA Data Access Reads and Writes, as well OPC/UA subscription. A Publisher will directly trigger an OPC DA write, while a Subscriber will work in one of two ways, depending on the type associated with the subscriber:
- If the subscribers CII URI contains only a single node (i.e. the XML ICD type contained only a single attribute) then the Subscriber will create an OPC/UA subscription on that data point. The subscription will trigger notification of updates to the data point node, which will then be queued for notification via the CII Subscriber API.
- If the subscribers CII URI contains only a single node (i.e. the XML ICD type contained only a single attribute) then the Subscriber will create an OPC/UA subscription on that data point. The subscription will trigger notification of updates to the data point node, which will then be queued for notification via the CII Subscriber API.
- If the Subscriber is using subscription, the opc.ps.outstandingPublishRequests property should not be zero (e.g. set it to 5), see the example code below. The reason is that the publish queue is used to store and send subscription notification events, and if the queue is small the even notifications may simply be dropped.
- If the Subscriber is using subscription, the opc.ps.outstandingPublishRequests property should not be zero (e.g. set it to 5), see the example code below. The reason is that the publish queue is used to store and send subscription notification events, and if the queue is small the even notifications may simply be dropped.
- If the subscriber CII URI contains multiple nodes (i.e. the XML ICD type contains multiple attributes) then the Subscriber launches a thread to perform periodic polling of data from the OPC/UA server. The rate is based on the properties passed in creating the subscriber. e.g.
- If the subscriber CII URI contains multiple nodes (i.e. the XML ICD type contains multiple attributes) then the Subscriber launches a thread to perform periodic polling of data from the OPC/UA server. The rate is based on the properties passed in creating the subscriber. e.g.
@@ -1311,9 +1361,9 @@ or, the OLDB API seems to be misbehaving, and you want more logs.
...
@@ -1311,9 +1361,9 @@ or, the OLDB API seems to be misbehaving, and you want more logs.
**Solution**
**Solution**
Please read the article "[Adjust CII Log Levels [Log]](#user-content-adjust-cii-log-levels-log)" in the Log section of this Knowledge Base. The relevant logger names for the OLDB API are:
Please read the article "[Adjust CII Log Levels \[Log\]](#user-content-adjust-cii-log-levels-log)" in the Log section of this Knowledge Base. The relevant logger names for the OLDB API are:
```
```plaintext
CiiOldb
CiiOldb
CiiOldbDirectoryTreeProvider
CiiOldbDirectoryTreeProvider
CiiOldbFactory
CiiOldbFactory
...
@@ -1323,40 +1373,48 @@ CiiOldbRemoteFileProvider
...
@@ -1323,40 +1373,48 @@ CiiOldbRemoteFileProvider
```
```
Example: to turn off ERROR logs for testing the existence of non-existing datapoints, use:
Example: to turn off ERROR logs for testing the existence of non-existing datapoints, use:
If disk usage is above 95%, elasticsearch goes into read-only mode, and creating new datapoints is not possible any more. To remove old content from the database, it is first necessary to create some free space on the disk (since the database needs space to perform deletetion-operations), then unlock the database, and then remove unnecessary old content from it.
If disk usage is above 95%, elasticsearch goes into read-only mode, and creating new datapoints is not possible any more. To remove old content from the database, it is first necessary to create some free space on the disk (since the database needs space to perform deletetion-operations), then unlock the database, and then remove unnecessary old content from it.
When starting an application using the OLDB API, the following exception is received:
When starting an application using the OLDB API, the following exception is received:
```
```plaintext
<date/time>, ERROR, CiiOldbFactory/140635105143296, Unexpected config exception occurred while retrieving configuration for cii.config://remote/oldb/configurations/oldbClientConfig What:Path oldb/configurations/oldbClientConfig, version -1 not found
<date/time>, ERROR, CiiOldbFactory/140635105143296, Unexpected config exception occurred while retrieving configuration for cii.config://remote/oldb/configurations/oldbClientConfig What:Path oldb/configurations/oldbClientConfig, version -1 not found
terminate called after throwing an instance of 'elt::oldb::CiiOldbException'
terminate called after throwing an instance of 'elt::oldb::CiiOldbException'
what(): Unexpected config exception occurred while retrieving configuration for cii.config://remote/oldb/configurations/oldbClientConfig What:Path oldb/configurations/oldbClientConfig, version -1 not found
what(): Unexpected config exception occurred while retrieving configuration for cii.config://remote/oldb/configurations/oldbClientConfig What:Path oldb/configurations/oldbClientConfig, version -1 not found
```
```
**Solution**
**Solution** This can indicate that elasticSearch on the config/oldb server is not running, or has crashed. Use cii-services command to check the status on the server where the (cii-internal) config is running.
This can indicate that elasticSearch on the config/oldb server is not running, or has crashed.
Use cii-services command to check the status on the server where the (cii-internal) config is running.
The actual stalling comes from a failed MAL-communication with the CII Internal Configuration System, which likely is not running. Setting the timeout for the CiiConfigClient is therefore the thing to do. Note that the properties file (aka. "deployment config") takes precedence and will, if they overlap, overrule the programmatic (aka. "developer config") settings.
The actual stalling comes from a failed MAL-communication with the CII Internal Configuration System, which likely is not running. Setting the timeout for the CiiConfigClient is therefore the thing to do. Note that the properties file (aka. "deployment config") takes precedence and will, if they overlap, overrule the programmatic (aka. "developer config") settings.
\[3\]<https://gitlab.eso.org/cii/srv/cii-srv/-/blob/master/oldb-client/cpp/oldb/src/provider/ciiOldbLocalFileProvider.hpp>*\[Note: not before DevEnv 3.4\]*
\[3\]<https://gitlab.eso.org/cii/srv/cii-srv/-/blob/master/oldb-client/cpp/oldb/src/provider/ciiOldbLocalFileProvider.hpp>_\[Note: not before DevEnv 3.4\]_
If none of the above helped, another possibility is to clean up the metadata.
If none of the above helped, another possibility is to clean up the metadata.
WARNING: This is an invasive operation. It deletes all datapoints in the OLDB.
WARNING: This is an invasive operation. It deletes all datapoints in the OLDB.
```
```plaintext
# Clean up the OLDB databases
# Clean up the OLDB databases
config-initEs.sh
config-initEs.sh
oldb-initEs
oldb-initEs
...
@@ -1660,17 +1717,19 @@ WARNING: This is an invasive operation. It deletes all datapoints in the OLDB.
...
@@ -1660,17 +1717,19 @@ WARNING: This is an invasive operation. It deletes all datapoints in the OLDB.
```
```
If you are dealing with a multi-user oldb ("role_groupserver", meaning it serves an OLDB to a team of developers), after executing the above commands you need to additionally execute (with privileges):
If you are dealing with a multi-user oldb ("role_groupserver", meaning it serves an OLDB to a team of developers), after executing the above commands you need to additionally execute (with privileges):
### Elasticsearch disk usage and house-keeping [IntCfg]
The Elasticsearch database is used by many CII services, e.g. to store CII log messages, tracing data, and Oldb metadata. If you run a local elasticsearch database on your host (i.e. you have set up a "role_ownserver" during post-install), it is advisable to do some house-keeping on this database from time to time.
The Elasticsearch database is used by many CII services, e.g. to store CII log messages, tracing data, and Oldb metadata. If you run a local elasticsearch database on your host (i.e. you have set up a "role_ownserver" during post-install), it is advisable to do some house-keeping on this database from time to time.
Some house-keeping is automated (e.g. ".monitoring-es" indices are automatically rolled over every few days), others may be automated in the future, but currently are not. Instead you should perform the tasks below at your own discretion.
Some house-keeping is automated (e.g. ".monitoring-es" indices are automatically rolled over every few days), others may be automated in the future, but currently are not. Instead you should perform the tasks below at your own discretion.
1. Check which indices you have and how much memory they consume:
1. Check which indices you have and how much memory they consume:
You are intending to read a config from the local config database ("localdb"), but you see an error message like this.
You are intending to read a config from the local config database ("localdb"), but you see an error message like this.
```
```plaintext
elt.config.exceptions.CiiConfigNoTcException: Target configuration does not exist: Failed to retrieve configuration from elastic search: Configuration cii.config://*/supervisoryapp/TrkLsvDeploy on the remote db was not found
elt.config.exceptions.CiiConfigNoTcException: Target configuration does not exist: Failed to retrieve configuration from elastic search: Configuration cii.config://*/supervisoryapp/TrkLsvDeploy on the remote db was not found
at elt.config.client.ConfigRemoteDatabase.retrieveConfig(ConfigRemoteDatabase.java:191)
at elt.config.client.ConfigRemoteDatabase.retrieveConfig(ConfigRemoteDatabase.java:191)
at elt.config.client.CiiConfigClient.retrieveConfig(CiiConfigClient.java:354)
at elt.config.client.CiiConfigClient.retrieveConfig(CiiConfigClient.java:354)
...
@@ -2036,19 +2096,18 @@ Your local file may be invalid (e.g. illegal format, or doesn't match the config
...
@@ -2036,19 +2096,18 @@ Your local file may be invalid (e.g. illegal format, or doesn't match the config
Look at the content of your local config database, e.g. with
Look at the content of your local config database, e.g. with
```
```plaintext
$ find $INTROOT/localdb
$ find $INTROOT/localdb
```
```
and correct the file in place, or fix the source yaml and then redeploy it from source to the localdb.
and correct the file in place, or fix the source yaml and then redeploy it from source to the localdb.
**Background**
**Background**
You may have a malformed json file in your local db, which the config service failed to read.
You may have a malformed json file in your local db, which the config service failed to read.
Because of the use the location wildcard "\*" in your code (in "cii.config://\*/supervisoryapp/TrkLsvDeploy"),
Because of the use the location wildcard "\*" in your code (in "[cii.config://\*/supervisoryapp/TrkLsvDeploy"](cii.config://\*/supervisoryapp/TrkLsvDeploy%22)),
the config service has consequently tried to load the config from the remote config database, where no such config exists.
the config service has consequently tried to load the config from the remote config database, where no such config exists.
To that end, the error message is misleading, and should be improved (ticket [ECII-208](https://jira.eso.org/browse/ECII-208)).
To that end, the error message is misleading, and should be improved (ticket [ECII-208](https://jira.eso.org/browse/ECII-208)).