IDEMPIERE-3653 Hazelcast improvements / fix template version - add example of new recommended aws discovery strategy

This commit is contained in:
Carlos Ruiz 2018-03-13 16:32:34 -03:00
parent cd7bba9d01
commit 81066b1498
2 changed files with 85 additions and 45 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
~ Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved. ~ Copyright (c) 2008-2017, Hazelcast, Inc. All Rights Reserved.
~ ~
~ Licensed under the Apache License, Version 2.0 (the "License"); ~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License. ~ you may not use this file except in compliance with the License.
@ -16,12 +16,12 @@
--> -->
<!-- <!--
The default Hazelcast configuration. This is used when: The default Hazelcast configuration. This is used when no hazelcast.xml is present.
Please see the schema for how to configure Hazelcast at https://hazelcast.com/schema/config/hazelcast-config-3.9.xsd
- no hazelcast.xml if present or the documentation at https://hazelcast.org/documentation/
--> -->
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.5.xsd" <!--suppress XmlDefaultAttributeValue -->
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.9.xsd"
xmlns="http://www.hazelcast.com/schema/config" xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<group> <group>
@ -45,19 +45,27 @@
</multicast> </multicast>
<tcp-ip enabled="false"> <tcp-ip enabled="false">
<interface>127.0.0.1</interface> <interface>127.0.0.1</interface>
<member-list>
<member>127.0.0.1</member>
</member-list>
</tcp-ip> </tcp-ip>
<aws enabled="false"> <aws enabled="false"/>
<access-key>my-access-key</access-key> <discovery-strategies>
<secret-key>my-secret-key</secret-key> <discovery-strategy enabled="false" class="com.hazelcast.aws.AwsDiscoveryStrategy">
<!--optional, default is us-east-1 --> <properties>
<region>us-west-1</region> <property name="access-key">my-access-key</property>
<!--optional, default is ec2.amazonaws.com. If set, region shouldn't be set as it will override this property --> <property name="secret-key">my-secret-key</property>
<host-header>ec2.amazonaws.com</host-header> <!--optional, default is us-east-1 -->
<!-- optional, only instances belonging to this group will be discovered, default will try all running instances --> <property name="region">us-east-1</property>
<security-group-name>hazelcast-sg</security-group-name> <property name="host-header">ec2.amazonaws.com</property>
<tag-key>type</tag-key> <!-- optional, only instances belonging to this group will be discovered, default will try all running instances -->
<tag-value>hz-nodes</tag-value> <property name="security-group-name">hazelcast-sg</property>
</aws> <property name="tag-key">type</property>
<property name="tag-value">hz-nodes</property>
<property name="connection-timeout-seconds">30</property>
</properties>
</discovery-strategy>
</discovery-strategies>
</join> </join>
<interfaces enabled="false"> <interfaces enabled="false">
<interface>10.10.1.*</interface> <interface>10.10.1.*</interface>
@ -126,7 +134,7 @@
then all entries of the map will be copied to another JVM for then all entries of the map will be copied to another JVM for
fail-safety. 0 means no backup. fail-safety. 0 means no backup.
--> -->
<backup-count>1</backup-count> <backup-count>0</backup-count>
<!-- <!--
Number of async backups. 0 means no backup. Number of async backups. 0 means no backup.
--> -->
@ -144,7 +152,7 @@
automatically evicted from the map. Entry is touched if get, put or containsKey is called. automatically evicted from the map. Entry is touched if get, put or containsKey is called.
Any integer between 0 and Integer.MAX_VALUE. 0 means infinite. Default is 0. Any integer between 0 and Integer.MAX_VALUE. 0 means infinite. Default is 0.
--> -->
<max-idle-seconds>0</max-idle-seconds> <max-idle-seconds>1800</max-idle-seconds>
<!-- <!--
Valid values are: Valid values are:
NONE (no eviction), NONE (no eviction),
@ -152,25 +160,26 @@
LFU (Least Frequently Used). LFU (Least Frequently Used).
NONE is the default. NONE is the default.
--> -->
<eviction-policy>NONE</eviction-policy> <eviction-policy>LRU</eviction-policy>
<!-- <!--
Maximum size of the map. When max size is reached, Maximum size of the map. When max size is reached,
map is evicted based on the policy defined. map is evicted based on the policy defined.
Any integer between 0 and Integer.MAX_VALUE. 0 means Any integer between 0 and Integer.MAX_VALUE. 0 means
Integer.MAX_VALUE. Default is 0. Integer.MAX_VALUE. Default is 0.
--> -->
<max-size policy="PER_NODE">0</max-size> <max-size policy="PER_NODE">1000</max-size>
<!-- <!--
When max. size is reached, specified percentage of `eviction-percentage` property is deprecated and will be ignored when it is set.
the map will be evicted. Any integer between 0 and 100.
If 25 is set for example, 25% of the entries will As of version 3.7, eviction mechanism changed.
get evicted. It uses a probabilistic algorithm based on sampling. Please see documentation for further details
--> -->
<eviction-percentage>25</eviction-percentage> <eviction-percentage>25</eviction-percentage>
<!-- <!--
Minimum time in milliseconds which should pass before checking `min-eviction-check-millis` property is deprecated and will be ignored when it is set.
if a partition of this map is evictable or not.
Default value is 100 millis. As of version 3.7, eviction mechanism changed.
It uses a probabilistic algorithm based on sampling. Please see documentation for further details
--> -->
<min-eviction-check-millis>100</min-eviction-check-millis> <min-eviction-check-millis>100</min-eviction-check-millis>
<!-- <!--
@ -188,10 +197,36 @@
com.hazelcast.map.merge.HigherHitsMapMergePolicy ; entry with the higher hits wins. com.hazelcast.map.merge.HigherHitsMapMergePolicy ; entry with the higher hits wins.
com.hazelcast.map.merge.LatestUpdateMapMergePolicy ; entry with the latest update wins. com.hazelcast.map.merge.LatestUpdateMapMergePolicy ; entry with the latest update wins.
--> -->
<merge-policy>com.hazelcast.map.merge.PassThroughMergePolicy</merge-policy> <merge-policy>com.hazelcast.map.merge.PutIfAbsentMapMergePolicy</merge-policy>
<!--
Control caching of de-serialized values. Caching makes query evaluation faster, but it cost memory.
Possible Values:
NEVER: Never cache deserialized object
INDEX-ONLY: Caches values only when they are inserted into an index.
ALWAYS: Always cache deserialized values.
-->
<cache-deserialized-values>INDEX-ONLY</cache-deserialized-values>
</map> </map>
<!--
Configuration for an event journal. The event journal keeps events related
to a specific partition and data structure. For instance, it could keep
map add, update, remove, merge events along with the key, old value, new value and so on.
-->
<event-journal enabled="false">
<mapName>mapName</mapName>
<capacity>10000</capacity>
<time-to-live-seconds>0</time-to-live-seconds>
</event-journal>
<event-journal enabled="false">
<cacheName>cacheName</cacheName>
<capacity>10000</capacity>
<time-to-live-seconds>0</time-to-live-seconds>
</event-journal>
<multimap name="default"> <multimap name="default">
<backup-count>1</backup-count> <backup-count>1</backup-count>
<value-collection-type>SET</value-collection-type> <value-collection-type>SET</value-collection-type>
@ -226,19 +261,21 @@
<topic-overload-policy>BLOCK</topic-overload-policy> <topic-overload-policy>BLOCK</topic-overload-policy>
<statistics-enabled>true</statistics-enabled> <statistics-enabled>true</statistics-enabled>
</reliable-topic> </reliable-topic>
<ringbuffer name="default"> <ringbuffer name="default">
<capacity>10000</capacity> <capacity>10000</capacity>
<backup-count>1</backup-count> <backup-count>1</backup-count>
<async-backup-count>0</async-backup-count> <async-backup-count>0</async-backup-count>
<time-to-live-seconds>30</time-to-live-seconds> <time-to-live-seconds>0</time-to-live-seconds>
<in-memory-format>BINARY</in-memory-format> <in-memory-format>BINARY</in-memory-format>
</ringbuffer> </ringbuffer>
<serialization> <serialization>
<portable-version>0</portable-version> <portable-version>0</portable-version>
</serialization> </serialization>
<services enable-defaults="true"/> <services enable-defaults="true"/>
<lite-member enabled="false"/>
</hazelcast> </hazelcast>

View File

@ -49,19 +49,22 @@
<member>127.0.0.1</member> <member>127.0.0.1</member>
</member-list> </member-list>
</tcp-ip> </tcp-ip>
<aws enabled="false"> <aws enabled="false"/>
<access-key>my-access-key</access-key>
<secret-key>my-secret-key</secret-key>
<!--optional, default is us-east-1 -->
<region>us-west-1</region>
<!--optional, default is ec2.amazonaws.com. If set, region shouldn't be set as it will override this property -->
<host-header>ec2.amazonaws.com</host-header>
<!-- optional, only instances belonging to this group will be discovered, default will try all running instances -->
<security-group-name>hazelcast-sg</security-group-name>
<tag-key>type</tag-key>
<tag-value>hz-nodes</tag-value>
</aws>
<discovery-strategies> <discovery-strategies>
<discovery-strategy enabled="false" class="com.hazelcast.aws.AwsDiscoveryStrategy">
<properties>
<property name="access-key">my-access-key</property>
<property name="secret-key">my-secret-key</property>
<!--optional, default is us-east-1 -->
<property name="region">us-east-1</property>
<property name="host-header">ec2.amazonaws.com</property>
<!-- optional, only instances belonging to this group will be discovered, default will try all running instances -->
<property name="security-group-name">hazelcast-sg</property>
<property name="tag-key">type</property>
<property name="tag-value">hz-nodes</property>
<property name="connection-timeout-seconds">30</property>
</properties>
</discovery-strategy>
</discovery-strategies> </discovery-strategies>
</join> </join>
<interfaces enabled="false"> <interfaces enabled="false">