Set elasticsearch pod java options according to ip config
The "-Djava.net.preferIPv6Addresses=true" java option was set for both ipv4 and ipv6 configurations which worked fine in both configs. At some point recently in ipv4 configurations, the stx-monitor application stopped applying successfully due to elasticsearch cluster discovery failure. Why the ipv4 failures are only recently occurring is unknown, but removal of this unnecessary java option for ipv4 eliminates the failures. This update will set the above java option for elasticsearch pods only if the cluster service network is ipv6. Closes-Bug: 1864193 Change-Id: I2952f1c799b121d0812314156162af7696ebd6b0 Signed-off-by: Kevin Smith <kevin.smith@windriver.com>
This commit is contained in:
parent
69a65e2166
commit
8e2e5f7e82
|
@ -149,6 +149,29 @@ class BaseHelm(object):
|
|||
self.context['_system_controller_floating_address'] = sc_float_ip
|
||||
return sc_float_ip
|
||||
|
||||
def _is_ipv6_cluster_service(self):
|
||||
if self.dbapi is None:
|
||||
return False
|
||||
|
||||
is_ipv6_cluster_service = self.context.get(
|
||||
'_is_ipv6_cluster_service', None)
|
||||
|
||||
if is_ipv6_cluster_service is None:
|
||||
try:
|
||||
cluster_service_network = self.dbapi.network_get_by_type(
|
||||
constants.NETWORK_TYPE_CLUSTER_SERVICE)
|
||||
cluster_service_network_addr_pool = self.dbapi.address_pool_get(
|
||||
cluster_service_network.pool_uuid)
|
||||
is_ipv6_cluster_service = (
|
||||
cluster_service_network_addr_pool.family ==
|
||||
constants.IPV6_FAMILY)
|
||||
except exception.NetworkTypeNotFound:
|
||||
LOG.error("No Cluster Service Network Type found")
|
||||
raise
|
||||
|
||||
self.context['_is_ipv6_cluster_service'] = is_ipv6_cluster_service
|
||||
return is_ipv6_cluster_service
|
||||
|
||||
def _region_name(self):
|
||||
"""Returns the local region name of the system"""
|
||||
if self.dbapi is None:
|
||||
|
|
|
@ -21,13 +21,18 @@ class ElasticsearchClientHelm(elastic.ElasticBaseHelm):
|
|||
if utils.is_aio_simplex_system(self.dbapi):
|
||||
replicas = 1
|
||||
|
||||
if self._is_ipv6_cluster_service():
|
||||
ipv6JavaOpts = "-Djava.net.preferIPv6Addresses=true "
|
||||
else:
|
||||
ipv6JavaOpts = ""
|
||||
|
||||
if (utils.is_aio_system(self.dbapi) and not
|
||||
self._is_distributed_cloud_role_system_controller()):
|
||||
esJavaOpts = \
|
||||
"-Djava.net.preferIPv6Addresses=true -Xmx512m -Xms512m"
|
||||
ipv6JavaOpts + "-Xmx512m -Xms512m"
|
||||
else:
|
||||
esJavaOpts = \
|
||||
"-Djava.net.preferIPv6Addresses=true -Xmx1024m -Xms1024m"
|
||||
ipv6JavaOpts + "-Xmx1024m -Xms1024m"
|
||||
|
||||
overrides = {
|
||||
common.HELM_NS_MONITOR: {
|
||||
|
|
|
@ -31,13 +31,19 @@ class ElasticsearchDataHelm(elastic.ElasticBaseHelm):
|
|||
|
||||
if utils.is_aio_simplex_system(self.dbapi):
|
||||
replicas = 1
|
||||
|
||||
if self._is_ipv6_cluster_service():
|
||||
ipv6JavaOpts = "-Djava.net.preferIPv6Addresses=true "
|
||||
else:
|
||||
ipv6JavaOpts = ""
|
||||
|
||||
if (utils.is_aio_system(self.dbapi) and not
|
||||
self._is_distributed_cloud_role_system_controller()):
|
||||
esJavaOpts = \
|
||||
"-Djava.net.preferIPv6Addresses=true -Xmx1536m -Xms1536m"
|
||||
ipv6JavaOpts + "-Xmx1536m -Xms1536m"
|
||||
else:
|
||||
esJavaOpts = \
|
||||
"-Djava.net.preferIPv6Addresses=true -Xmx4096m -Xms4096m"
|
||||
ipv6JavaOpts + "-Xmx4096m -Xms4096m"
|
||||
|
||||
overrides = {
|
||||
common.HELM_NS_MONITOR: {
|
||||
|
|
|
@ -29,11 +29,16 @@ class ElasticsearchMasterHelm(elastic.ElasticBaseHelm):
|
|||
# pods will be master capable to form a cluster of 3 masters.
|
||||
replicas = 1
|
||||
|
||||
if self._is_ipv6_cluster_service():
|
||||
ipv6JavaOpts = "-Djava.net.preferIPv6Addresses=true "
|
||||
else:
|
||||
ipv6JavaOpts = ""
|
||||
|
||||
if (utils.is_aio_system(self.dbapi) and not
|
||||
self._is_distributed_cloud_role_system_controller()):
|
||||
esJavaOpts = "-Djava.net.preferIPv6Addresses=true -Xmx256m -Xms256m"
|
||||
esJavaOpts = ipv6JavaOpts + "-Xmx256m -Xms256m"
|
||||
else:
|
||||
esJavaOpts = "-Djava.net.preferIPv6Addresses=true -Xmx512m -Xms512m"
|
||||
esJavaOpts = ipv6JavaOpts + "-Xmx512m -Xms512m"
|
||||
|
||||
overrides = {
|
||||
common.HELM_NS_MONITOR: {
|
||||
|
|
Loading…
Reference in New Issue