-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure Ignite to use fixed ports (#1208)
* Start ignite.service after network.target * Install Ignite as Anisble block * Reserve ports from ephemeral range * Override function findAvailableJmxPort * Limit number of potentially used ports
- Loading branch information
Showing
4 changed files
with
154 additions
and
59 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
core/src/epicli/data/common/ansible/playbooks/roles/ignite/defaults/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
ignite_ports_from_ephemeral_range: # strings are required | ||
- '47100-47109' | ||
- '47500-47509' | ||
- '49112' | ||
|
||
# The following block is appended to $IGNITE_HOME/bin/include/functions.sh | ||
block_to_append_to_ignite_functions_script: | | ||
# | ||
# The function exports JMX_MON variable with Java JMX options. | ||
# Overrides original version in order to: | ||
# 1) Use fixed ports for JMX (https://github.com/epiphany-platform/epiphany/issues/1181) | ||
# 2) Disable direct remote access to unsecured JMX (remote access possible through SSH tunnel) | ||
# | ||
findAvailableJmxPort() { | ||
export IGNITE_JMX_PORT=49112 | ||
JMX_PORT=`"$JAVA" -cp "${IGNITE_LIBS}" org.apache.ignite.internal.util.portscanner.GridJmxPortFinder` | ||
# | ||
# This variable defines parameters for JMX monitoring and management. | ||
# | ||
if [ -n "$JMX_PORT" ]; then | ||
# java.rmi.server.hostname=127.0.0.1 is used to make JMX accessible through SSH tunnel | ||
JMX_MON="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=${JMX_PORT} \ | ||
-Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false \ | ||
-Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT} -Djava.rmi.server.hostname=127.0.0.1" | ||
else | ||
# If JMX port wasn't found do not initialize JMX. | ||
echo "$0, WARN: Failed to resolve JMX host (JMX will be disabled): $HOSTNAME" | ||
JMX_MON="" | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
core/src/epicli/data/common/ansible/playbooks/roles/ignite/templates/ignite.service.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[Unit] | ||
Description=Apache Ignite Server | ||
After=network.target | ||
|
||
[Service] | ||
Type=simple | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters