如何在Payara 5.193中配置数据网格ttl

问题描述 投票:0回答:1

[以前,在使用Payara 4时,我们使用了Hazelcast群集/数据网格。我们在名为hazelcast-config.xml的文件中为Shiro authenticationCache网格映射条目配置了集群发现和ttl:

<?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,集群成员发现(domain discovery)“就可以工作”。问题是,如果没有xml文件,ttl将无法工作。如果我提供hazelcast-config.xml,它会给我我的ttl配置,但会丢失域发现。

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

谢谢

[以前,在使用Payara 4时,我们使用了Hazelcast群集/数据网格。我们在名为hazelcast-config.xml的文件中为Shiro authenticationCache网格映射条目配置了群集发现和ttl:...

authentication hazelcast shiro ttl payara
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.