JBoss中的jndi.properties [英] jndi.properties in JBoss
问题描述
有什么方法可以配置JNDI,以便查找首先检查localhost,如果找不到匹配的名称,它会自动发现其他jndi服务器?
Is there any way to configure JNDI so the lookup first checks localhost and if it doesn't find matching name it performs automatic discovery of other jndi servers?
推荐答案
我对文档的理解是,这是使用群集时的默认行为:
My understanding of the documentation is that this is the default behavior when using clustering:
16.2.2.客户端配置
JNDI客户需要了解 HA-JNDI群集.您可以通过 JNDI服务器(即节点)列表 在HA-JNDI群集中)
java.naming.provider.url
JNDIjndi.properties
文件中的设置. 每个服务器节点均由其标识 IP地址和JNDI端口号. 服务器节点由 逗号(请参见第16.2.3节, "JBoss 配置" 服务器和端口).
16.2.2. Client configuration
The JNDI client needs to be aware of the HA-JNDI cluster. You can pass a list of JNDI servers (i.e., the nodes in the HA-JNDI cluster) to the
java.naming.provider.url
JNDI setting in thejndi.properties
file. Each server node is identified by its IP address and the JNDI port number. The server nodes are separated by commas (see Section 16.2.3, "JBoss configuration" on how to configure the servers and ports).
java.naming.provider.url=server1:1100,server2:1100,server3:1100,server4:1100
初始化时,JNP客户端代码 会尝试与每个人取得联系 列表中的服务器节点,后一个 另一种,尽快停止 服务器已到达.然后它将 从此处下载HA-JNDI存根 节点.
When initialising, the JNP client code will try to get in touch with each server node from the list, one after the other, stopping as soon as one server has been reached. It will then download the HA-JNDI stub from this node.
注意-JNP客户端查找中没有负载平衡行为 过程.它只是通过 提供者列表并使用第一个 可用的服务器. HA-JNDI提供程序 列表只需要包含以下内容的子集 集群中的HA-JNDI节点.
Note - There is no load balancing behavior in the JNP client lookup process. It just goes through the provider list and use the first available server. The HA-JNDI provider list only needs to contain a subset of HA-JNDI nodes in the cluster.
下载的智能存根包含 故障转移到另一个节点的逻辑 必要和更新的清单 当前正在运行的节点.此外, 每次进行JNDI调用时 服务器上的目标列表 存根拦截器已更新(仅当 自上次以来,该列表已更改 致电).
The downloaded smart stub contains the logic to fail-over to another node if necessary and the updated list of currently running nodes. Furthermore, each time a JNDI invocation is made to the server, the list of targets in the stub interceptor is updated (only if the list has changed since the last call).
如果属性字符串java.naming.provider.url
为空或
如果它提到的所有服务器都不是
可达,JNP客户端将尝试
发现引导HA-JNDI服务器
通过对
网络(自动发现).看
第16.2.3节"JBoss
配置"
在JNDI服务器上自动发现
节点.通过自动发现,
客户可能能够获得有效
没有任何HA-JNDI服务器节点
配置.当然,对于
自动发现工作,客户端
必须与
服务器集群(例如,Web Servlet)
使用EJB服务器).局域网或广域网
还必须配置为传播
这样的多播数据报.
If the property string java.naming.provider.url
is empty or
if all servers it mentions are not
reachable, the JNP client will try to
discover a bootstrap HA-JNDI server
through a multicast call on the
network (auto-discovery). See
Section 16.2.3, "JBoss
configuration" on how to configure
auto-discovery on the JNDI server
nodes. Through auto-discovery, the
client might be able to get a valid
HA-JNDI server node without any
configuration. Of course, for the
auto-discovery to work, the client
must reside in the same LAN as the
server cluster (e.g., the web servlets
using the EJB servers). The LAN or WAN
must also be configured to propagate
such multicast datagrams.
这篇关于JBoss中的jndi.properties的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!