Glassfish v3集群

时间:2012-05-15 20:38:39

标签: glassfish-3 cluster-computing

我尝试通过Glassfish群集教程(12)配置群集,但我仍然遇到在远程主机上的群集中创建实例的麻烦。 我认为如果我给你带插入命令的输出会更好,它可能会解释更多:

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> 

更新

我正在放置主机文件内容和ping命令输出,adam-desktop和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

任何帮助?

2 个答案:

答案 0 :(得分:1)

域名启动后,您可以在浏览器中找到http://localhost:4848http://adam-desktop:4848吗?

如果没有,在linux glassfish上要求你正确设置/etc/hosts文件,这就是我的大部分问题来自于此。还要设置相应的网络配置。在Redhat上,它是/etc/sysconfig/network,在Ubuntu上是/etc/hostname

答案 1 :(得分:0)

似乎错误是由/etc/hosts文件中的条目引起的。

127.0.0.1   localhost
127.0.1.1   adam-desktop
192.168.1.101   adam-laptop

更改为:

127.0.0.1   localhost
127.0.0.1   adam-desktop
192.168.1.101   adam-laptop

它有效。我必须在两台计算机上进行更改,这意味着在adam-desktopadam-laptop