Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:tagbangers/wallride
Browse files Browse the repository at this point in the history
  • Loading branch information
ogawa-takeshi committed Jun 14, 2017
2 parents 5e5cb32 + 56327f0 commit 4882877
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package org.wallride.autoconfigure;

import com.amazonaws.internal.EC2MetadataClient;
import com.amazonaws.util.EC2MetadataUtils;
import jp.co.tagbangers.jgroups.S3_CLIENT_PING;
import org.infinispan.configuration.cache.CacheMode;
import org.infinispan.configuration.cache.ConfigurationBuilder;
Expand Down Expand Up @@ -81,13 +81,7 @@ public CacheManager cacheManager() {
String jgroupsConfigurationFile = environment.getRequiredProperty("jgroups.configurationFile");
if ("jgroups-ec2.xml".equals(jgroupsConfigurationFile)) {
ClassConfigurator.addProtocol((short) 1000, S3_CLIENT_PING.class);
EC2MetadataClient metadataClient = new EC2MetadataClient();
String ipAddress;
try {
ipAddress = metadataClient.readResource("/latest/meta-data/local-ipv4");
} catch (IOException e) {
throw new RuntimeException(e);
}
String ipAddress = EC2MetadataUtils.getPrivateIpAddress();
logger.info("jgroups.tcp.address -> {}", ipAddress);
System.setProperty("jgroups.tcp.address", ipAddress);
System.setProperty("jgroups.s3.bucket", environment.getRequiredProperty("jgroups.s3.bucket"));
Expand Down
29 changes: 10 additions & 19 deletions wallride-core/src/main/resources/jgroups-ec2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
thread_naming_pattern="pl"
send_buf_size="640k"
sock_conn_timeout="300"
bundler_type="sender-sends-with-timer"

thread_pool.min_threads="${jgroups.thread_pool.min_threads:2}"
thread_pool.max_threads="${jgroups.thread_pool.max_threads:30}"
Expand All @@ -23,25 +24,16 @@
oob_thread_pool.max_threads="${jgroups.oob_thread_pool.max_threads:200}"
oob_thread_pool.keep_alive_time="60000"
oob_thread_pool.queue_enabled="false"
/>
<!--
<S3_PING access_key="${jgroups.s3.access_key}"
secret_access_key="${jgroups.s3.secret_access_key}"
location="${jgroups.s3.bucket}"
pre_signed_delete_url="${jgroups.s3.pre_signed_delete_url}"
pre_signed_put_url="${jgroups.s3.pre_signed_put_url}"
prefix="${jgroups.s3.prefix}"
/>
-->
/>
<jp.co.tagbangers.jgroups.S3_CLIENT_PING location="${jgroups.s3.bucket}" />
<MERGE3 min_interval="10000"
max_interval="30000"
/>
/>
<FD_SOCK />
<FD_ALL timeout="60000"
interval="15000"
timeout_check_interval="5000"
/>
/>
<VERIFY_SUSPECT timeout="5000" />
<pbcast.NAKACK2 use_mcast_xmit="false"
xmit_interval="1000"
Expand All @@ -50,24 +42,23 @@
xmit_table_max_compaction_time="30000"
max_msg_batch_size="100"
resend_last_seqno="true"
/>
/>
<UNICAST3 xmit_interval="500"
xmit_table_num_rows="50"
xmit_table_msgs_per_row="1024"
xmit_table_max_compaction_time="30000"
max_msg_batch_size="100"
conn_expiry_timeout="0"
/>
/>
<pbcast.STABLE stability_delay="500"
desired_avg_gossip="5000"
max_bytes="1M"
/>
/>
<pbcast.GMS print_local_addr="false"
join_timeout="10000"
max_join_attempts="1"
/>
join_timeout="${jgroups.join_timeout:5000}"
/>
<MFC max_credits="2m"
min_threshold="0.40"
/>
/>
<FRAG2 />
</config>
21 changes: 11 additions & 10 deletions wallride-core/src/main/resources/jgroups-tcp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
thread_naming_pattern="pl"
send_buf_size="640k"
sock_conn_timeout="300"
bundler_type="sender-sends-with-timer"

thread_pool.min_threads="${jgroups.thread_pool.min_threads:2}"
thread_pool.max_threads="${jgroups.thread_pool.max_threads:30}"
Expand All @@ -23,20 +24,20 @@
oob_thread_pool.max_threads="${jgroups.oob_thread_pool.max_threads:200}"
oob_thread_pool.keep_alive_time="60000"
oob_thread_pool.queue_enabled="false"
/>
/>
<MPING bind_addr="${jgroups.tcp.address:127.0.0.1}"
mcast_addr="${jgroups.mping.mcast_addr:228.2.4.6}"
mcast_port="${jgroups.mping.mcast_port:43366}"
ip_ttl="${jgroups.udp.ip_ttl:2}"
/>
/>
<MERGE3 min_interval="10000"
max_interval="30000"
/>
/>
<FD_SOCK />
<FD_ALL timeout="60000"
interval="15000"
timeout_check_interval="5000"
/>
/>
<VERIFY_SUSPECT timeout="5000" />
<pbcast.NAKACK2 use_mcast_xmit="false"
xmit_interval="1000"
Expand All @@ -45,23 +46,23 @@
xmit_table_max_compaction_time="30000"
max_msg_batch_size="100"
resend_last_seqno="true"
/>
/>
<UNICAST3 xmit_interval="500"
xmit_table_num_rows="50"
xmit_table_msgs_per_row="1024"
xmit_table_max_compaction_time="30000"
max_msg_batch_size="100"
conn_expiry_timeout="0"
/>
/>
<pbcast.STABLE stability_delay="500"
desired_avg_gossip="5000"
max_bytes="1M"
/>
/>
<pbcast.GMS print_local_addr="false"
join_timeout="3000"
/>
join_timeout="${jgroups.join_timeout:5000}"
/>
<MFC max_credits="2m"
min_threshold="0.40"
/>
/>
<FRAG2 />
</config>

0 comments on commit 4882877

Please sign in to comment.