[GLASSFISH-17278] invalid setting imq.cluster.masterbroker=mq: //localhost:27676/ for a broker running on different machine is passed to brokers in cluster Created: 07/Sep/11  Updated: 19/Sep/14  Resolved: 04/Jun/13

Status: Resolved
Project: glassfish
Component/s: jms
Affects Version/s: 4.1
Fix Version/s: 4.1

Type: Bug Priority: Major
Reporter: amyk Assignee: David Zhao
Resolution: Works as designed Votes: 1
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: Text File query.txt    
Issue Links:
Duplicate
is duplicated by MQ-118 broker is passed hostname that resolv... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
GLASSFISH-20602 Don't user localhost as nodehost when... Sub-task Open Mike Fitch  
Tags: 3_1_2-review

 Description   

This issue is reported from the following glassfish forum thread (attached query.txt from the posting)
http://forums.java.net/node/840957

GlassFish JMS module+JMSRA passes the following invalid cluster configuration settings to broker for a remote broker, in this case the master broker, running on a different machine from this broker
imq.cluster.masterbroker=mq://localhost:27676/
imq.cluster.brokerlist=mq://ubu2:27676/,mq://localhost:27676/

When a remote broker in a cluster runs on different machine, 'localhost' in imq.cluster.brokerlist or imq.cluster.masterbroker for that broker would not make sense. For example 2 brokers, 1 on machine1 and another on machine2, it doesn't make sense to set

imq.cluster.brokerlist=localhost:broker1-port,localhost:broker2-port

because it would mean broker1 should look for broker2 on its own machine1 -ie. 'localhost', and broker2 should look for broker1 on its own machine2.



 Comments   
Comment by Satish Kumar [ 13/Dec/11 ]

The value - localhost is picked-up from the default domain.xml config for jms-host.host. The reason we default the value to localhost is so that we can support zip based installation. Hence, this is really not a bug but a limitation as a consequence of the the zip based installer.

To get JMS to work correctly in a virtual env such as the one described in the bug and the related forum posts, the value of jms-host.host for the cluster config will need to be manually modified to reflect the correct host name on which it is intended to run. This can be done by using the asadmin set command.

This is not a bug, hence closing the issue.

Comment by poisond [ 03/Jun/13 ]

Hello,
I'm having the exact same problem, but cannot figure out which configuration value to set.

If this is supposed to be it, setting it doesn't work (still sends localhost):

$GF_HOME/glassfish/nodes/localhost-domain1/instance-web1/config/domain.xml:
<jms-host host="web1" name="default_JMS_host"></jms-host>

Comment by Nigel Deakin [ 03/Jun/13 ]

Please don't try to start a discussion on a closed issue. Please use the Glassfish forum https://www.java.net/forums/glassfish/glassfish

Comment by amyk [ 04/Jun/13 ]

This issue needs to be re-evaluated, hence re-opened from 'Won't Fix' status, minimum it should be documented with workaround if 'Won't Fix'

Comment by David Zhao [ 04/Jun/13 ]

When configuring glassfish jms cluster with master broker in EMBEDDED or LOCAL mode, glassfish jms module will generate properties of 'imq.cluster.brokerlist' and 'imq.cluster.masterbroker' and passes those to MQ for bootstrap. For example,

imq.cluster.brokerlist=mq://host2:3076/,mq://host1:2076/
imq.cluster.masterbroker=mq://host1:2076/

The hostnames used in the properties are got from glassfish cluster nodes on which the glassfish instances reside. So at any time, please use unique hostnames which can be resolved at any physical servers on the network. Don't use localhost except that all the cluster instances are located in the same physical server.

D:\glassfish4\glassfish\bin>asadmin create-node-config --help
create-node-config(1) asadmin Utility Subcommands create-node-config(1)

NAME
create-node-config - creates a node that is not enabled for remote
communication

SYNOPSIS
create-node-config [--help]
[--nodehost node-host]
[--installdir as-install-parent] [--nodedir node-dir] node-name

DESCRIPTION
The create-node-config subcommand creates a node that is not enabled
for remote communication. The create-node-config subcommand does not
require the Distributed Component Object Model (DCOM) remote protocol
or secure shell (SSH) to be configured to create the node.

A node represents a host on which the GlassFish Server software is
installed. A node must exist for every host on which GlassFish Server
instances reside.

Note
---------------------------------------

To represent the host where
the DAS is running,
GlassFish Server provides
the predefined node
localhost-domain. The
predefined node
localhost-domain is not
enabled for remote
communication.

---------------------------------------

All administration of instances on a node that is not enabled for
remote communication must be performed on the host that the node
represents. The domain administration server (DAS) on a remote host
cannot contact the node. To administer instances on a node that
represents a host that is remote from the DAS, you must use the
following subcommands:

  • create-local-instance(1)
  • delete-local-instance(1)
  • start-local-instance(1)

However, you may use stop-local-instance(1) or stop-instance(1) to stop
the instances.

This subcommand is supported in remote mode only.

OPTIONS

--nodehost
The name of the host that the node represents. If this option is
omitted, no host is specified for the node.

Comment by David Zhao [ 04/Jun/13 ]

It would be fine if glassfish node doesn't use localhost. Created doc issue for it.

Comment by amyk [ 04/Jun/13 ]

From David Zhao:
I created doc issue https://java.net/jira/browse/GLASSFISH-20602 for that.

Generated at Sun Sep 25 17:14:48 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.