bontade
bontade

Reputation: 3224

Glassfish v3 clustering

I've tried to configure cluster following through Glassfish clustering tutorials (1, 2), but I'm still having troubles with creating instance in cluster on remote host. I think it will be better if I give you output with inserted commands, it'll probably explain more:

adam@adam-desktop:~/Pulpit/glassfish-3.1.1/bin$ ./asadmin
Use "exit" to exit and "help" for online help.

asadmin> setup-ssh adam-laptop
Successfully connected to adam@adam-laptop using keyfile /home/adam/.ssh/id_rsa
SSH public key authentication is already configured for adam@adam-laptop
Command setup-ssh executed successfully.

asadmin> install-node --installdir /home/adam/Pulpit/glassfish3 adam-laptop
Created installation zip /home/adam/Pulpit/glassfish-3.1.1/bin/glassfish8196347853130742869.zip
Successfully connected to adam@adam-laptop using keyfile /home/adam/.ssh/id_rsa
Copying /home/adam/Pulpit/glassfish-3.1.1/bin/glassfish8196347853130742869.zip (82498155 bytes) to adam-laptop:/home/adam/Pulpit/glassfish3
Installing glassfish8196347853130742869.zip into adam-laptop:/home/adam/Pulpit/glassfish3
Removing adam-laptop:/home/adam/Pulpit/glassfish3/glassfish8196347853130742869.zip
Fixing file permissions of all files under adam-laptop:/home/adam/Pulpit/glassfish3/bin
Command install-node executed successfully.

asadmin> start-domain domain1
Waiting for domain1 to start ........................
Successfully started the domain : domain1
domain  Location: /home/adam/Pulpit/glassfish-3.1.1/glassfish/domains/domain1
Log File: /home/adam/Pulpit/glassfish-3.1.1/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.

asadmin> enable-secure-admin
Command enable-secure-admin executed successfully.

asadmin> restart-domain domain1
Successfully restarted the domain
Command restart-domain executed successfully.

asadmin> create-cluster c1
Command create-cluster executed successfully.

asadmin> create-node-ssh --nodehost adam-laptop --installdir /home/adam/Pulpit/glassfish3 adam-laptop
Command create-node-ssh executed successfully.

asadmin> create-instance --node adam-laptop --cluster c1 i1
Successfully created instance i1 in the DAS configuration, but failed to create the instance files on node adam-laptop (adam-laptop).

Command failed on node adam-laptop (adam-laptop): Could not contact the DAS running at adam-desktop:4848. This could be because a firewall is blocking the connection back to the DAS or because the DAS host is known by a different name on the instance host adam-laptop. To change the hostname that the DAS uses to identify itself please update the DAS admin HTTP listener address.
Command _create-instance-filesystem failed.

To complete this operation run the following command locally on host adam-laptop from the GlassFish install location /home/adam/Pulpit/glassfish3:

asadmin  --host adam-desktop --port 4848 create-local-instance --node adam-laptop i1
asadmin> 

UPDATE

I'm putting hosts file contents and ping command output for sure, that exists connection between adam-desktop and adam-laptop:

  adam@adam-desktop:~$ cat /etc/hosts
  127.0.0.1 localhost
  127.0.1.1 adam-desktop
  192.168.1.101 adam-laptop

  # The following lines are desirable for IPv6 capable hosts
  ::1     ip6-localhost ip6-loopback
  fe00::0 ip6-localnet
  ff00::0 ip6-mcastprefix
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
  adam@adam-desktop:~$ cat /etc/hostname 
  adam-desktop
  adam@adam-desktop:~$ ping adam-laptop
  PING adam-laptop (192.168.1.101) 56(84) bytes of data.
  64 bytes from adam-laptop (192.168.1.101): icmp_req=1 ttl=64 time=0.786 ms
  64 bytes from adam-laptop (192.168.1.101): icmp_req=2 ttl=64 time=0.694 ms
  64 bytes from adam-laptop (192.168.1.101): icmp_req=3 ttl=64 time=0.687 ms

Any help?

Upvotes: 1

Views: 1497

Answers (2)

bontade
bontade

Reputation: 3224

It seems that error was caused by entry in /etc/hosts file.

127.0.0.1   localhost
127.0.1.1   adam-desktop
192.168.1.101   adam-laptop

after changing to:

127.0.0.1   localhost
127.0.0.1   adam-desktop
192.168.1.101   adam-laptop

it works. I had to make changes on two machines, it means on adam-desktop and adam-laptop.

Upvotes: 0

Jim
Jim

Reputation: 3684

After the domain is started, can you reach http://localhost:4848 or http://adam-desktop:4848 in your browser ?

If not, on linux glassfish requires you to set up the /etc/hosts file correctly and this is where most of my problems like this come from. Also set up the appropriate network config. On Redhat it is /etc/sysconfig/network and on Ubuntu it is /etc/hostname

Upvotes: 1

Related Questions