Network
We recommend using the central Port configuration at bpc.env.sh and the configuration at Secure Connection (TLS/HTTPS).
|
TL;DR <OPENSEARCH-CONFIG-DIR>/opensearch.yml
karaf/etc/de.Virtimo.BPC.core.cfg
karaf/etc/org.apache.karaf.shell.cfg
karaf/etc/org.apache.karaf.management.cfg
karaf/etc/org.ops4j.pax.web.cfg
|
To run multiple separate instances on a single server, various Parameters must be configured. These adjustments may also be necessary for other reasons (already occupied Ports, etc.) and will be described in more detail here.
|
It is recommended to use only encrypted connections. See also: Secure Connection (TLS/HTTPS). |
Relevant configuration parameters
In general, the following parameters must be taken into account:
-
OpenSearch Ports (default 9200–9300 and 9300–9400; see below for explanation)
-
OpenSearch cluster ID (default opensearch_virtimo)
-
Karaf BPC instance name (default BPC)
-
Karaf Ports for:
-
HTTP (default 8181)
-
HTTPS (default 8282)
-
SSH (default 8101)
-
JMX/RMI Port (Default 1099, 44444)
-
Configuration Details
The Karaf parameters listed below can also be set via the Karaf console (syntax: config:property-set -p de.virtimo.bpc.core CONFIGKEY CONFIGVALUE).
However, the configuration via a configuration file is always described here, as this can be performed “offline” and is easier to apply to additional instances.
OpenSearch Ports
The OpenSearch Ports must be adjusted in both OpenSearch and Karaf so that both products can communicate with each other again.
By default, OpenSearch defines two port ranges (9200–9300 and 9300–9400) and selects the lowest unused port in each range. This must be changed and set to a fixed Port, since Karaf only queries exactly one Port anyway; otherwise, multiple instances of the same OpenSearch might be running unknowingly (and they’ll work, too, since each new instance simply grabs the next Port and then says, “Hey cluster, I’m one of you, talk to me”).
OpenSearch itself reads its port configuration from the file <OPENSEARCH-CONFIG-DIR>/opensearch.yml.
Therefore, it is sufficient to define these three values with the new Ports at the end of the file:
http.port: 9200 transport.tcp.port: 9300 # Default: 9203 os-bpc-plugin.websocket.port: 9204
To ensure that Karaf can reach OpenSearch on the new Port, this Port must also be specified in the BPC configuration file <Karaf_Root>/etc/de.virtimo.bpc.core.cfg
(value of the http.port Parameter from the OpenSearch configuration):
de.Virtimo.BPC.core.opensearch.port = 9200
|
BPC/Karaf establishes a WebSocket connection to OpenSearch (value of the os-BPC-plugin.websocket.port parameter from the OpenSearch configuration). The port does not need to be configured in BPC, as it is queried by OpenSearch at runtime. |
Both services must then be restarted.
BPC-Instance-Name
The session cookie is stored without port information—that is, for a host regardless of the port used (according to RFC6265, “cookies for a given host are shared across all the Ports on that host”).
As a result, one would attempt to use a session across multiple instances.
BPC correctly recognizes that it does not recognize this session (from another BPC instance) and discards it.
Consequently, it is not possible to log in to multiple instances on a single host simultaneously.
There is now an instance name used as a prefix for the session information, allowing multiple sessions within a single browser to be managed for the same target host.
To enable this, set the following key with a new instance name in the file ` <Karaf_Root>/etc/de.virtimo.bpc.core.cfg `:
de.Virtimo.BPC.core.name = BPC
Then please restart Karaf.
Karaf Ports
Karaf uses different protocols and ports for communication. Among other things, it provides an SSH, an HTTP, and an HTTPS interface. A JMX/RMI interface is also available and should be adjusted if the Ports are already in use.
The note about restarting Karaf after any Port changes should no longer apply here.
SSH Port
Karaf provides an SSH interface for configuration and analysis purposes on both Linux and Windows.
By default, this is accessible on Port 8101.
This can be changed in the file <Karaf_Root>/etc/org.apache.karaf.shell.cfg using the following setting:
sshPort = 8101
To prevent the server from being accessible from the outside, you can bind the following option to localhost or another local interface (0.0.0.0 = global/all IPv4 addresses of the host):
sshHost = 0.0.0.0
HTTP(S) Port
The Ports for HTTP and HTTPS are defined in the file <Karaf_Root>/etc/org.ops4j.pax.web.cfg:
org.osgi.service.http.port = 8181 org.osgi.service.http.port.secure = 8282
Here, the respective protocol can also be enabled or disabled separately (e.g., to allow only HTTPS):
org.osgi.service.http.enabled = false org.osgi.service.http.secure.enabled = true
JMX/RMI Ports
The Ports for the JMX/RMI interface are configured in the file <Karaf_Root>/etc/org.apache.karaf.management.cfg using the following Parameters:
rmiRegistryPort = 1099 rmiServerPort = 44444
To make JMX/RMI available only locally, you can (similar to SSH) bind the listener from the global 0.0.0.0 to any local interface (e.g., 127.0.0.1):
rmiRegistryHost = 0.0.0.0 rmiServerHost = 0.0.0.0