如何在Payara 5.193中配置数据网格TTL [英] How to configure data grid ttl in Payara 5.193

查看:232
本文介绍了如何在Payara 5.193中配置数据网格TTL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

之前,在Payara 4中,我们使用了Hazelcast群集/数据网格.我们为 Shiro authenticationCache 网格映射条目,位于名为hazelcast-config.xml的文件中:

Previously, with Payara 4, we used Hazelcast cluster/data grid. We configured cluster discovery and the ttl for Shiro authenticationCache grid map entries, in a file called hazelcast-config.xml:

<?xml version="1.0" encoding="UTF-8"?><hazelcast xmlns="http://www.hazelcast.com/schema/config" xmlns:xsi="http://www.w3.org/2
001/XMLSchema-instance" xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.5.xsd">
  <properties/>
  <group>
    <name>prod</name>
    <password>pass</password>
  </group>
  <management-center enabled="false">http://localhost:8180/mancenter</management-center>
  <network>
           <join>
      <multicast enabled="false">
        <multicast-group>my-group</multicast-group>
        <multicast-port>my-port</multicast-port>
      </multicast>              

<tcp-ip enabled="false">
        <interface>127.0.0.1</interface>
        <member-list>
          <member>127.0.0.1</member>
        </member-list>
      </tcp-ip>
    </join>
    <interfaces enabled="true">
      <interface><my-ip-address></interface>
    </interfaces>
  </network>
  <map name="*.authorizationCache">
    <async-backup-count>1</async-backup-count>
    <backup-count>0</backup-count>
    <time-to-live-seconds>7210</time-to-live-seconds>
  </map>
<map name="*.authenticationCache">
           <async-backup-count>1</async-backup-count>
        <backup-count>0</backup-count>
        <time-to-live-seconds>7200</time-to-live-seconds>
    </map>
  <map name="/mymap">
    <async-backup-count>1</async-backup-count>
    <backup-count>0</backup-count>
    <time-to-live-seconds>7210</time-to-live-seconds>
  </map>
  <map name="default">
    <async-backup-count>1</async-backup-count>
    <backup-count>0</backup-count>
  </map>
</hazelcast>

现在使用Payara 5,似乎已经开始进行hazelcast了.集群成员发现(域发现)就可以使用",而无需使用hazelcast-config.xml.问题是,如果没有xml文件,ttl将无法工作.而且,如果我提供hazelcast-config.xml,它会给我我的ttl配置,但会丢失域发现.

Now with Payara 5, hazelcast seems to be rolled in. Cluster member discovery (domain discovery) "just works" without using a hazelcast-config.xml. Problem is, ttl does not work without the xml file. And if I supply hazelcast-config.xml it gives me my ttl configuration, but I lose domain discovery.

是否可以使用Payara 5.193同时进行域发现和数据网格ttl配置?看来我应该能够在shiro.ini中设置ttl,但是我看不到任何文档表明这一点.

Is there a way I can have both domain discovery and data grid ttl configuration with Payara 5.193? It seems like I should be able to set ttl in shiro.ini but I see no documentation indicating that.

谢谢

推荐答案

在Hazelcast配置中,您没有发现设置.您可以使用<multicast enabled="false">禁用基于多播的发现.您还可以使用<tcp-ip enabled="false">禁用静态IP配置.然后,没有配置发现,Hazelcast不会形成集群.

In your Hazelcast configuration you don't have the discovery setup. You disable multicast-based discovery with <multicast enabled="false">. You also disable static IP configuration with <tcp-ip enabled="false">. Then, there is no discovery configured and Hazelcast won't form the cluster.

您需要设置静态IP配置或使用任何发现机制.请在此处阅读更多信息: https://docs.hazelcast. org/docs/latest/manual/html-single/#discovery-mechanisms .

You need to set either the static IP configuration or use any of the discovery mechanisms. Please read more here: https://docs.hazelcast.org/docs/latest/manual/html-single/#discovery-mechanisms.

这篇关于如何在Payara 5.193中配置数据网格TTL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆