Karaf Console Commands for the BPC

Some core functions can be controlled via the Karaf console.

Info

Some information about the BPC installation.

bpc:info

BPC
  Name                        BPC-1
  UUID                        3dfde089-c1a2-48ac-a9a1-b6d9137dd548
OpenSearch
  Version                     3.6.0
  Status                      Connected to [[host=http://localhost:9200]]
OpenSearch Plugin
  Plugin status               ACCESSIBLE
  Websocket status            CONNECTED

Controlling Maintenance Mode

Maintenance mode can be enabled and disabled via the Karaf console. You can also check the current status.

Below are the commands and examples

Enabling maintenance mode

# Keine Nachrichten hinterlegt
bpc:maintenance-mode on

# Mit Nachrichten
bpc:maintenance-mode -m 'some messages' on

Disabling maintenance mode

bpc:maintenance-mode off

Querying the maintenance mode status

bpc:maintenance-mode status

Forcing the local Identity Provider (IdP)

The use of the local Identity Provider can be enabled or disabled via the Karaf console. You can also check the current status.

Below are the commands and examples

Enabling the local IdP

bpc:force-local-idp on

Disabling the local IdP

bpc:force-local-idp off

Checking the status of the local IdP

bpc:force-local-idp status

User Sessions

You can list and delete BPC user sessions via the Karaf console.

Below are the commands and examples

List all user sessions

bpc:sessions-list

Session ID                           │ User     │ Firstname │ Lastname │ Expires
─────────────────────────────────────┼──────────┼───────────┼──────────┼────────────────────────
c403dd65-93da-42c5-a06c-598e6d91d6cd │ bpcadmin │ Timo      │ Virt     │ 2020-10-15 11:42:30.009
a9602f8a-f9b6-49ba-9411-6e16665cf5a3 │ of       │ Oliver    │ Fürniß   │ 2020-10-15 12:44:04.162
dec79e6f-12a5-43a8-82aa-2d5aa5b7548b │ bpcadmin │ Timo      │ Virt     │ 2020-10-15 11:42:50.672

Delete a single user session

bpc:sessions-delete <Session ID>

Delete all user sessions

bpc:sessions-delete-all

Backups / Snapshots

Backups created by the BPC can be listed, deleted, and restored via the Karaf console.

Below are the commands and examples

List backup groups

bpc:backup-list

Indices Group
──────────────────────────
bpc-analysis-queries
bpc-auditlog
bpc-configuration
of-test-child,of-test-main

List backups in a group

bpc:backup-list bpc-configuration

Date                     │ State   │ Name
─────────────────────────┼─────────┼───────────────────────────────────────────
2020-11-05T10:53:21.190Z │ SUCCESS │ snapshot-bpc-configuration-20201105-115321
2020-11-06T12:44:20.585Z │ SUCCESS │ snapshot-bpc-configuration-20201106-134420
2021-02-01T07:15:55.821Z │ SUCCESS │ snapshot-bpc-configuration-20210201-081555
2021-02-02T08:30:45.624Z │ SUCCESS │ snapshot-bpc-configuration-20210202-093045

Delete a backup

bpc:backup-delete snapshot-bpc-configuration-20201105-115321

Restore a backup

 bpc:backup-restore snapshot-bpc-configuration-20210202-093045

Backup Jobs

The BPC periodically performs backups of OpenSearch indices. These backup jobs can also be listed and started manually via the Karaf console.

Below are the commands and examples

Listing backup jobs

bpc:backupjob-list

Backup Job Identifier                             │ Enabled │ State  │ Runs Every    │ Next Check In │ Latest Backup           │ Next Backup             │ Indices
──────────────────────────────────────────────────┼─────────┼────────┼───────────────┼───────────────┼─────────────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────
core:audit-logger                                 │ X       │ active │ 86400 seconds │ 49 seconds    │ 2022-07-26T13:42:47.999 │ 2022-07-27T13:42:47.999 │ [bpc-auditlog]
core:bpc-configuration                            │ X       │ active │ 86400 seconds │ 49 seconds    │ 2022-07-26T13:11:44.932 │ 2022-07-27T13:11:44.932 │ [bpc-configuration]
core:logservice:monitor-test-grid-header-filter   │ -       │ -      │ -             │ 49 seconds    │ <none>                  │ -                       │ [monitor-test-grid-header-filter]
core:logservice:monitor-test-module-jump-column   │ -       │ -      │ -             │ 49 seconds    │ <none>                  │ -                       │ [monitor-test-module-jump-column]
core:storageservice:bpc-store-datalock            │ X       │ active │ 86400 seconds │ 49 seconds    │ 2022-07-26T06:09:34.774 │ 2022-07-27T06:09:34.774 │ [bpc-store-datalock]
core:storageservice:bpc-store-monitor-view-states │ X       │ active │ 86400 seconds │ 49 seconds    │ 2022-07-26T06:09:35.975 │ 2022-07-27T06:09:35.975 │ [bpc-store-monitor-view-states]
core:storageservice:bpc-store-state               │ X       │ active │ 86400 seconds │ 49 seconds    │ 2022-07-26T06:09:35.775 │ 2022-07-27T06:09:35.775 │ [bpc-store-state]
weather                                           │ X       │ active │ 600 seconds   │ 49 seconds    │ 2022-07-26T13:35:35.695 │ 2022-07-26T13:45:35.695 │ [weather-child, weather-parent]

Start a backup job

bpc:backupjob-start <backup job identifier>

Delete a backup job

bpc:backupjob-delete <backup job identifier>

Database Connection Pool

Information about the Database Connection Pool (dbcp2) can be queried.

Compact List of Database Connection Pool Entries

bpc:db-connection-pool-list

Name  │ Active │ Waiters │ Idle │ Max Total │ Borrowed │ Returned │ Mean Borrow Wait Time (ms) │ Max Borrow Wait Time (ms) │ DB URL                                      │ DB Username │ DB Name
──────┼────────┼─────────┼──────┼───────────┼──────────┼──────────┼────────────────────────────┼───────────────────────────┼─────────────────────────────────────────────┼─────────────┼─────────────────────────────────────────
pool3 │ 0      │ 0       │ 5    │ 10        │ 10254    │ 10254    │ 0                          │ 42243                     │ jdbc:oracle:thin:@localhost:1521:XE         │ OLFUERNISS  │ Oracle JDBC driver
pool4 │ 0      │ 0       │ 1    │ 10        │ 4        │ 4        │ 9                          │ 38                        │ jdbc:mysql://127.0.0.1:3306/bpc             │ olfuerniss  │ MariaDB Connector/J
pool5 │ 0      │ 0       │ 1    │ 10        │ 4        │ 4        │ 28                         │ 113                       │ jdbc:postgresql://localhost:5432/postgre... │ postgres    │ PostgreSQL JDBC Driver
pool2 │ 0      │ 0       │ 1    │ 10        │ 802      │ 802      │ 0                          │ 746                       │ jdbc:oracle:thin:@dev03.virtimo.net:1521... │ VPMA_PM     │ Oracle JDBC driver
pool  │ 0      │ 0       │ 1    │ 10        │ 4        │ 4        │ 210                        │ 843                       │ jdbc:sqlserver://dev05.virtimo.net:1433;... │ DEV05_EBIX  │ Microsoft JDBC Driver 7.4 for SQL Server

You can retrieve all available information about the database connection pools using the command bpc:db-connection-pool-list extended.

Copy OpenSearch Index

An index can be copied from one system to another via deployment. The following three commands are available for this purpose.

List of Deployment Destinations

The IDs of the deployment systems are required for the following two commands. The deployment systems are created via the BPC interface as backend Connections of type 'deployment_system'.

bpc:deployment-list-systems

ID            │ Name                         │ Sort Priority
──────────────┼──────────────────────────────┼──────────────
ds_local      │ Local BPC                    │ 100
1632738353151 │ Develop Stage                │ 1000
1644918332765 │ Test Stage                   │ 2000
1644998745328 │ Prod Stage                   │ 2000
@@@JSON@@@    │ [JSON]                       │ 2147483647

Listing the indices of a deployment system

In the following example, 1632738353151 is the ID of the Develop Stage from which the existing indices are to be listed. The index name is then required for the actual copy command.

bpc:deployment-list-indices 1632738353151

Health │ State  │ Index                                 │ Alias                     │ Docs Count │ Docs Count (Lucene) │ Docs Deleted (Lucene)
───────┼────────┼───────────────────────────────────────┼───────────────────────────┼────────────┼─────────────────────┼──────────────────────
close  │ yellow │ bpc-auditlog_1638439270124            │ []                        │            │                     │
open   │ yellow │ bpc-auditlog_1645622599914            │ [bpc-auditlog]            │ 2608       │ 2608                │ 17
open   │ yellow │ bpc-configuration_1638439267666       │ [bpc-configuration]       │ 638        │ 638                 │ 9
open   │ yellow │ bpc-forms_1641883263224               │ [bpc-forms]               │ 0          │ 0                   │ 0
close  │ yellow │ bpc-metrics_1638439285764             │ []                        │            │                     │
open   │ yellow │ bpc-metrics_1645622622387             │ [bpc-metrics]             │ 29325      │ 29325               │ 0
open   │ yellow │ bpc-notification_1638439270752        │ [bpc-notification]        │ 9251       │ 9251                │ 0
open   │ yellow │ bpc-performance_1638530235746         │ [bpc-performance]         │ 10655      │ 10655               │ 240
open   │ yellow │ bpc-replicationjobs-log_1638439266291 │ [bpc-replicationjobs-log] │ 6          │ 6                   │ 0
open   │ yellow │ bpc-store-datalock_1638439266963      │ [bpc-store-datalock]      │ 0          │ 0                   │ 0
open   │ yellow │ units_1631702902240                   │ [units]                   │ 34         │ 0                   │ 0

Copying an Index

In the following example, the index units_1631702902240 is copied from Develop Stage (ID: 1632738353151 ) to Test Stage (ID: 1644918332765 ). If the index already exists on the target system, the process is aborted and an error message is displayed.

bpc:deployment-copy-index --source 1632738353151 --target 1644918332765 units_1631702902240

Cluster Operation

The following commands are available for checking and monitoring in cluster operation. These commands can be executed from any of the servers.

List of Participating BPC Servers

bpc:server-list

In this example, 3 BPC servers currently form a cluster.

Name  │ UUID                                 │ Hostname  │ Address     │ Master │ Maintenance │ Available for Replication │ Loaded Modules │ Connected To OpenSearch Node
──────┼──────────────────────────────────────┼───────────┼─────────────┼────────┼─────────────┼───────────────────────────┼────────────────┼─────────────────────────────
BPC-3 │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ ofs-um690 │ 172.20.10.6 │ -      │ -           │ X                         │ 10             │ ofs-um690
BPC   │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ ofs-um690 │ 172.20.10.6 │ X      │ -           │ X                         │ 11             │ ofs-um690
BPC-2 │ b391fee9-a86d-49be-90e3-918df78e3b35 │ ofs-um690 │ 172.20.10.6 │ -      │ -           │ X                         │ 10             │ ofs-um690

Not all servers have the same modules loaded, please double check those by using the command 'bpc:server-modules-list'.

List of Installed Backend Modules

The same modules, with the same module versions, should be installed on each BPC server.

bpc:server-modules-list

In the following sample output, you can see that the forms module is not installed on the servers named BPC-2 and BPC-3. This is indicated by the arrows in the first column.

   │ Module Name       │ Module Version │ Name  │ UUID                                 │ Hostname  │ Address
───┼───────────────────┼────────────────┼───────┼──────────────────────────────────────┼───────────┼────────────
   │ _core             │ 4.2.0.SNAPSHOT │ BPC-3 │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC   │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC-2 │ b391fee9-a86d-49be-90e3-918df78e3b35 │ ofs-um690 │ 172.20.10.6
   │ analysis          │ 4.2.0.SNAPSHOT │ BPC-3 │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC   │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC-2 │ b391fee9-a86d-49be-90e3-918df78e3b35 │ ofs-um690 │ 172.20.10.6
   │ backendconnection │ 4.2.0.SNAPSHOT │ BPC-3 │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC   │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC-2 │ b391fee9-a86d-49be-90e3-918df78e3b35 │ ofs-um690 │ 172.20.10.6
   │ dashboard         │ 4.2.0.SNAPSHOT │ BPC-3 │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC   │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC-2 │ b391fee9-a86d-49be-90e3-918df78e3b35 │ ofs-um690 │ 172.20.10.6
   │ externalContent   │ 4.2.0.SNAPSHOT │ BPC-3 │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC   │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC-2 │ b391fee9-a86d-49be-90e3-918df78e3b35 │ ofs-um690 │ 172.20.10.6
   │ flow              │ 4.2.0.SNAPSHOT │ BPC-3 │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC   │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC-2 │ b391fee9-a86d-49be-90e3-918df78e3b35 │ ofs-um690 │ 172.20.10.6
-> │ forms             │ -              │ BPC-3 │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ ofs-um690 │ 172.20.10.6
-> │                   │ 4.2.0.SNAPSHOT │ BPC   │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ ofs-um690 │ 172.20.10.6
-> │                   │ -              │ BPC-2 │ b391fee9-a86d-49be-90e3-918df78e3b35 │ ofs-um690 │ 172.20.10.6
   │ htmlcontent       │ 4.2.0.SNAPSHOT │ BPC-3 │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC   │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC-2 │ b391fee9-a86d-49be-90e3-918df78e3b35 │ ofs-um690 │ 172.20.10.6
   │ logservice        │ 4.2.0.SNAPSHOT │ BPC-3 │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC   │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC-2 │ b391fee9-a86d-49be-90e3-918df78e3b35 │ ofs-um690 │ 172.20.10.6
   │ monitor           │ 4.2.0.SNAPSHOT │ BPC-3 │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC   │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC-2 │ b391fee9-a86d-49be-90e3-918df78e3b35 │ ofs-um690 │ 172.20.10.6
   │ replication       │ 4.2.0.SNAPSHOT │ BPC-3 │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC   │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ ofs-um690 │ 172.20.10.6
   │                   │ 4.2.0.SNAPSHOT │ BPC-2 │ b391fee9-a86d-49be-90e3-918df78e3b35 │ ofs-um690 │ 172.20.10.6

Not all servers have the same modules loaded, please double check those with the arrow in the first column.

List of replication jobs and their distribution

The individual replication jobs must be distributed evenly across the participating BPC servers for execution.

bpc:replicationjobs-orchestration-details

The first table lists all replication jobs, including those that are currently deactivated. The second table lists the servers on which the replication jobs are currently running.

List of replication jobs registered to the OpenSearch plugin:

Replication Job ID │ Enabled │ State   │ Server UUID                          │ Server Name │ Server Hostname │ Server Address
───────────────────┼─────────┼─────────┼──────────────────────────────────────┼─────────────┼─────────────────┼───────────────
1620638959732      │ -       │ STOPPED │ -                                    │ -           │ -               │ -
1633589629410      │ X       │ RUNNING │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ BPC-3       │ ofs-um690       │ 172.20.10.6
1636536592010      │ -       │ STOPPED │ -                                    │ -           │ -               │ -
1644563497179      │ X       │ RUNNING │ b391fee9-a86d-49be-90e3-918df78e3b35 │ BPC-2       │ ofs-um690       │ 172.20.10.6
1676360785745      │ X       │ RUNNING │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ BPC         │ ofs-um690       │ 172.20.10.6
1678426455645      │ -       │ STOPPED │ -                                    │ -           │ -               │ -
(enabled=3, disabled=3, total=6)


List of servers executing the replication jobs:

Name  │ UUID                                 │ Hostname  │ Address     │ Available for Replication │ Assigned Replication Jobs │ Connected To OpenSearch Node
──────┼──────────────────────────────────────┼───────────┼─────────────┼───────────────────────────┼───────────────────────────┼─────────────────────────────
BPC-3 │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ ofs-um690 │ 172.20.10.6 │ X                         │ 1                         │ ofs-um690
BPC   │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ ofs-um690 │ 172.20.10.6 │ X                         │ 1                         │ ofs-um690
BPC-2 │ b391fee9-a86d-49be-90e3-918df78e3b35 │ ofs-um690 │ 172.20.10.6 │ X                         │ 1                         │ ofs-um690

Great, the replication jobs are equally distributed!

Runtime information for replication jobs

Only the replication jobs currently running on the participating servers are listed here.

bpc:replicationjobs-runtime-stats

In the following sample output, 3 replication jobs were distributed across the 3 BPC servers in the cluster. The "Runs" section lists the replication runs that have already been completed. And the "Errors" section lists the number of runs that encountered an error.

Server Name │ Server UUID                          │ Replication Job ID │ Replication Job Name │ Runs │ Errors │ Last Run Start          │ Last Run End
────────────┼──────────────────────────────────────┼────────────────────┼──────────────────────┼──────┼────────┼─────────────────────────┼────────────────────────
BPC-2       │ b391fee9-a86d-49be-90e3-918df78e3b35 │ 1644563497179      │ bpc-6362             │ 100  │ 0      │ 2023-06-12 14:03:00.255 │ 2023-06-12 14:03:00.261
BPC         │ 685484bc-aec5-4895-aa95-48ca5b9f2015 │ 1676360785745      │ BPC-7765             │ 123  │ 0      │ 2023-06-12 14:03:04.484 │ 2023-06-12 14:03:04.491
BPC-3       │ a47c8eb7-a5d6-4f0d-80d3-17be9e3f946c │ 1633589629410      │ mariadb-test_table   │ 98   │ 0      │ 2023-06-12 14:03:05.308 │ 2023-06-12 14:03:05.314

OpenSearch

A few administrative actions can be performed on the currently running OpenSearch instance. The commands and examples are provided below.

List indices

os:list
Health │ State  │ Index                                                 │ Alias                                     │ Shards │ Replicas │ Docs Count │ Docs Count (Lucene) │ Docs Deleted (Lucene) │ Store Size │ Primary Store Size
───────┼────────┼───────────────────────────────────────────────────────┼───────────────────────────────────────────┼────────┼──────────┼────────────┼─────────────────────┼───────────────────────┼────────────┼───────────────────
open   │ green  │ .tasks                                                │ []                                        │ 1      │ 0        │ 25         │ 25                  │ 0                     │ 58,94 KB   │ 58,94 KB
open   │ yellow │ bpc-analysis-queries_1647495911203                    │ [bpc-analysis-queries]                    │ 1      │ 1        │ 0          │ 0                   │ 0                     │ 208 B      │ 208 B
open   │ yellow │ bpc-auditlog_1696930053134                            │ [bpc-auditlog]                            │ 5      │ 1        │ 27647      │ 27647               │ 13                    │ 8,34 MB    │ 8,34 MB
close  │ yellow │ bpc-configuration_1684738165295                       │ []                                        │ 1      │ 1        │            │                     │                       │            │
open   │ yellow │ bpc-configuration_1697110020805                       │ [bpc-configuration]                       │ 10     │ 1        │ 5271       │ 5271                │ 1                     │ 1,59 MB    │ 1,59 MB
...

Delete an index

os:delete <name of index>

View the contents of an index

os:cat <name of index>
ID │ p_processid (long) │ processname (text) │ timestamp (date)
───┼────────────────────┼────────────────────┼────────────────────────────
7  │ 7                  │ Prozess 7          │ 2023-06-13T06:53:53.043545Z
5  │ 5                  │ Prozess 5          │ 2023-06-13T06:06:38.364433Z
2  │ 2                  │ Prozess 2          │ 2023-06-13T05:56:20.782316Z
3  │ 3                  │ Prozess 3          │ 2023-06-13T05:56:29.98964Z
4  │ 4                  │ Prozess 4          │ 2023-06-13T06:06:38.349114Z
8  │ 8                  │ Prozess 8          │ 2023-06-13T06:55:29.956788Z
1  │ 1                  │ Prozess 1          │ 2023-06-13T05:56:09.718081Z
6  │ 6                  │ Prozess 6          │ 2023-06-13T06:06:38.377993Z
...

View an index’s settings and mapping

os:mapping <name of index>
{
  "settings" : {
    "creation_date" : "1695804537997",
    "number_of_shards" : "5",
    "number_of_replicas" : "1",
    ...
  },
  "mappings" : {
    "properties" : {
      "p_processid" : {
        "type" : "long"
      },
      "processname" : {
        "type" : "text",
        "fields" : {
          "lowercase" : {
            "normalizer" : "lowercaseNormalizer",
            "type" : "keyword"
          },
          "raw" : {
            "type" : "keyword"
          }
        }
      },
      "timestamp" : {
        "type" : "date"
      }
    },
    ...
  }
}

Remove all read-only flags

OpenSearch automatically sets indexes to read-only mode when disk space is running low. In this case, all indexes are marked with the read-only flag. The user must manually remove this flag from each index after providing sufficient free disk space. This command removes the read-only flags from all indexes.

os:remove-all-read-only-flags

Keywords: