users@glassfish.java.net

Re: How does DAS findout that we create a node agent a machine?

From: Sankar Neelakandan <Sankar.Neelakandan_at_Sun.COM>
Date: Thu, 19 Jun 2008 10:27:54 -0700

Legolas wood wrote:
> Thank you for very complete answer.
>
You are welcome.
> Can you please let me know that if we create a developer domain and use
> --port and --host parameters, what is its usage?
>
--host and --port will be used always to communicate to DAS regardless
of the domain capability. asadmin is a client which is using http to
communicate to the backend Domain Administration Server, even in a
developer profile domain asadmin needs to know which host & port it
needs to communicate to the DAS for admin operations.
> in developer domain there is no DAS to communicate with so,
that is incorrect. In a developer profile domain there is a DAS which is
the only instance in the domain (by default domain1). The instance is
named DAS or server which is used to host your applications and manage
the server instance(which is itself).
> these two
> parameters are ignored?
>
the parameters are not ignored it is implicitly using --host as
localhost and --port as 4848
> Also, What can be possible use of executing create-jdbc-connection-pool
> on a cluster member machine and then use --port and --host to send the
> command to the DAS, will DAS create this connection pool on all members
> of the cluster?
>
You can use asadmin from any machine which has a same version of
glassfish installation to execute remote commands. Say for example

Machine A:
Glassfish 9.1UR2 installed with DAS running in port 4848. DAS has the
central repository of all applications and domain configuration.

Machine B:
Glassfish 9.1UR2 installed and your nodeagent is running



You can do the following operation in machine B
asadmin create-jdbc-connection-pool --user DAS_admin_user
--passwordfile das_password_in_a_file --host Machine_A --port 4848
--target mycluster my_jdbc_pool
The above command results in asadmin talking to DAS in machine A and
creating a connection pool named my_jdbc_pool in domain.xml

If you are executing the same command in Machine A, you can do it by
following 2 ways.
asadmin create-jdbc-connection-pool --user DAS_admin_user
--passwordfile das_password_in_a_file --host Machine_A --port 4848
--target mycluster my_jdbc_pool
or
asadmin create-jdbc-connection-pool --user DAS_admin_user
--passwordfile das_password_in_a_file --target mycluster my_jdbc_pool

It doesn't matter where you execute the asadmin command from it is
always stored in the domain.xml of DAS when you correctly specify the
--host and --port. So you don't need to execute the
create-jdbc-connection-pool command in a cluster member machine if you
want to create a pool in the cluster.

Whenever there is a new configuration/application/resource change the
DAS will automatically notifies the clustered instances and the new
configuration/application/resource is synced up with clustered instances
(provided they are running).
>
> Thank you .
>
>
> Sankar Neelakandan wrote:
>
>> Legolas Woodland wrote:
>>
>>> Hi, Thank you for the answer.
>>>
>>> Please correct me about the following statement:
>>>
>>> Usually all asadmin commands take a host and port parameters, but
>>> they are the address of the application server which we like that the
>>> command affect them. for example if i execute
>>> "create-jdbc-connection-pool --host 192.65.36.69
>>> <http://192.65.36.69> --port 8989 ...."then it will create the
>>> connection pool on the server which is running on the remote computer,
>>>
>>>
>> Wherever the application server is installed(even locally), the --host
>> and --port will be used to communicate to the DAS. If the application
>> server is installed locally and the DAS port is 4848 then you donot
>> need to mention the --host and --port. By default --host is localhost
>> and --port will be whatever set in install/config/asadminenv.conf (by
>> default it is set to 4848). So even in local machine asadmin will use
>> the --host --port parameters to talk to DAS. If you mention
>> --echo=true in any command you will see the list of parameters being
>> passed to asadmin.
>>
>> Since create-jdbc-connection-pool is a operation that has to be
>> performed by the DAS the --host and --port will be immediately used by
>> the asadmin to talk to DAS and hence it becomes a remote command. So a
>> command becomes remote or local based on whether it needs to talk to
>> DAS. If it needs to talk to DAS it becomes remote, if not it is a
>> local command.
>>
>>
>>> but now on my local host glassfish server, Am I correct about the
>>> statement?
>>>
>>> It is different for the create-node-agent command, because --port and
>>> --host point to the DAS address instead of the address of the
>>> application server which we want to create a node agent for it. <==
>>> Is it correct?
>>>
>>>
>> In create-node-agent command --host & --port is supplied to tell the
>> node agent whom it needs to talk to when it starts up. The --port and
>> --host will not be used right away, hence it is a local command since
>> it is not communicating with the DAS when the command is executed.
>>
>>> "generally we have two tyes of asadmin commands, remote commands and
>>> local commands." If it is correct, what commands are remote and what
>>> commands are local?
>>>
>>>
>> The command manpage will tell whether a command is local or remote, in
>> V3 the asadmin list-commands will list local and remote commands
>> separately.
>>
>>> Thank you.
>>>
>>>
>>> On 6/16/08, *Sankar Neelakandan* <Sankar.Neelakandan_at_sun.com
>>> <mailto:Sankar.Neelakandan_at_sun.com>> wrote:
>>>
>>> Hi Legolas,
>>> When you create nodeagent you mention --host and --port
>>> parameters to the asadmin command which will be used to
>>> communicate to DAS.
>>>
>>> asadmin create-node-agent --host ipaddress_or_hostname --port
>>> das_port_number node_agent_name
>>>
>>> -Sankar
>>>
>>>
>>> Legolas Woodland wrote:
>>>
>>>> Hi Wolfram,
>>>>
>>>> Can you please tell me how does NA understand the IP address of
>>>> the DAS?
>>>>
>>>> Should we tell it the DAS address beforehead?
>>>>
>>>> Thanks
>>>>
>>>>
>>>> On 6/16/08, *Wolfram Rittmeyer* <w.rittmeyer_at_jsptutorial.org
>>>> <mailto:w.rittmeyer_at_jsptutorial.org>> wrote:
>>>>
>>>> Hi Legolas,
>>>>
>>>> actually it is the node agent who notifies the DAS of its
>>>> creation. If the DAS is down at the time of creation the NA
>>>> retries periodically until the intial contact has taken place.
>>>>
>>>>
>>>> --
>>>> Wolfram Rittmeyer
>>>>
>>>>
>>>>
>>>> Legolas wood wrote:
>>>>
>>>> Hi
>>>> Thank you for reading my post.
>>>> Can someone please explain how does DAS find out that we
>>>> create a
>>>> node-agent in one of our computers in the network?
>>>> should we introduce the node agent to the DAS or there
>>>> are some
>>>> discovery mechanism in place?
>>>>
>>>> Thanks
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail:
>>>> users-unsubscribe_at_glassfish.dev.java.net
>>>> <mailto:users-unsubscribe_at_glassfish.dev.java.net>
>>>> For additional commands, e-mail:
>>>> users-help_at_glassfish.dev.java.net
>>>> <mailto:users-help_at_glassfish.dev.java.net>
>>>>
>>>>
>>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>