dev@glassfish.java.net

[Ask and Discussion]Any confused phenomenon about the nodedir and node during the operation in creating the instance

From: lvsongping <lvsongping_at_cn.fujitsu.com>
Date: Mon, 15 Jul 2013 16:14:42 +0800

Hi, Jennifer Chou, Joe Di Pol:

Cc: Dev list:



   Recently, when I did some investigation about the admin component, I feel
a little confused about the current syntax related to the --nodedir and
--node option. I wonder if any of you can explain whether the phenomenon I
have come up with is the right syntax or the bug need to be resolved!



[Original Syntax]

IMHO, I think the node name should be unique and each node name must match
to an unique nodedir that can’t be updated during the operation to create
local instance. Here’s the command steps to reproduced the current syntax:

1) asadmin create-node-config -nodehost localhost --nodedir
c:\cygwin\home\jeremy\glassfish4\glassfish\my_nodes localhost-domain1

remote failure: Configuration not added. A Node instance with a
"localhost-domai

n1" name already exists in the configuration

Command create-node-config failed.

(From the above phenomenon, the node must be unique)



2) asadmin create-local-instance --nodedir
c:\cygwin\home\jeremy\glassfish4\glassfish\other_nodes --node my_nodes ins1

remote failure: Attribute mismatch for node 'my_nodes': the value for the
'noded

ir' attribute from the command
(c:/cygwin/home/jeremy/glassfish4/glassfish/other

_nodes) does not match the value in the DAS configuration
(c:/cygwin/home/jeremy

/glassfish4/glassfish/my_nodes)

Command create-local-instance failed.

(From the above phenomenon, I think each node name must match an unique
nodedir that can’t be updated during the operation to create local
instance)





[My Question]

I have come up with another situation different from the above one, Here’s
my detailed steps to reproduce the problem:

1) asadmin start-domain

Command create-local-instance executed successfully.



2) asadmin create-local-instance ins1

Command create-local-instance executed successfully.

(<1> After the operation, the node name without specified will use the
default value “localhost-domain1” which located in the default nodedir
defined in the asenv.conf or asenv.bat file ---- the default value of
AS_DEF_NODES_PATH is "../nodes".

<2> there’s still no definition about nodedir related to the
localhost-domian1 in the domain.xml after the command executed.

<node node-host="localhost" name="localhost-domain1" type="CONFIG"
install-dir="${com.sun.aas.productRoot}"></node>



IMHO, I think the nodedir should be set into the domain.xml during the first
time to create the local instance)



3) asadmin create-local-instance --nodedir
c:\cygwin\home\jeremy\glassfish4\glassfish\my_nodes1 ins2

Command create-local-instance executed successfully.

(IMHO, I think the ins2 shouldn’t be created )

(<1> After the operation, the node name without specified will use the
default value “localhost-domain1” which use the nodedir as the command
line descriped ----
“c:\cygwin\home\jeremy\glassfish4\glassfish\my_nodes1”.

<2> there’s still no definition about nodedir related to the
localhost-domian1 in the domain.xml after the command executed.

<node node-host="localhost" name="localhost-domain1" type="CONFIG"
install-dir="${com.sun.aas.productRoot}"></node>



IMHO, I think the ins2 can’t be created as the node name doesn’t match to
the nodedir)





4) asadmin create-local-instance --nodedir
c:\cygwin\home\jeremy\glassfish4\glassfish\my_nodes2 ins3

Command create-local-instance executed successfully.

(My option here is same to the step 3) )



5) asadmin create-node-config --nodehost localhost my_node

Command create-node-config executed successfully.



6) asadmin create-local-instance --node my_node ins4

Command create-local-instance executed successfully.

(<1> After the operation, the node name will be specified as my_node which
located in the nodedir defined in the asenv.conf or asenv.bat file ---- the
default value of AS_DEF_NODES_PATH is "../nodes".

<2> there’s still no definition about nodedir related to the
localhost-domian1 in the domain.xml after the command executed.

<node node-host="localhost" name="localhost-domain1" type="CONFIG"
install-dir="${com.sun.aas.productRoot}"></node>



IMHO, I think the nodedir shouldn’t be set into the domain.xml during the
first time to create the local instance in this node)





7) asadmin create-local-instance --nodedir
c:\cygwin\home\jeremy\glassfish4\glassfish\my_nodes3 --node my_node ins5

Command create-local-instance executed successfully.

(<1> After the operation, the node name will be specified as my_node use the
nodedir as the command line descriped ----
“c:\cygwin\home\jeremy\glassfish4\glassfish\my_nodes3”.

<2> there’s still no definition about nodedir related to the
localhost-domian1 in the domain.xml after the command executed.

<node node-host="localhost" node-dir="
c:\cygwin\home\jeremy\glassfish4\glassfish\my_nodes3"
name="localhost-domain1" type="CONFIG"
install-dir="${com.sun.aas.productRoot}"></node>



IMHO, I think the ins5 can’t be created as the node name doesn’t match to
the nodedir)





8) asadmin create-local-instance --nodedir
c:\cygwin\home\jeremy\glassfish4\glassfish\my_nodes4 --node my_node ins6

remote failure: Attribute mismatch for node 'my_node': the value for the
'nodedi r' attribute from the command
(c:/cygwin/home/jeremy/glassfish4/glassfish/my_nod

es4) does not match the value in the DAS configuration
(c:/cygwin/home/jeremy/gl

assfish4/glassfish/my_nodes3)

Command create-local-instance failed.







[Conclusion]

All in all, if it is an issue, I think the nodedir in the domain.xml should
be updated during the first to create the local instance.

However, If it is the right syntax as the glassfish admin team designed, I
wonder if anyone can list the main reason about this designment.





Thanks very much!



regards

Jeremy Lv

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

Lv Songping

Software Division II

    Development Department I

Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)

ADDR.: No.6 Wenzhu Road, Software Avenue,

        Nanjing, 210012, China

TEL : +86+25-86630566-8307

COINS: 7998-8307

FAX : +86+25-83317685

MAIL : <mailto:lvsongping_at_cn.fujitsu.com> lvsongping_at_cn.fujitsu.com