1

我尝试通过 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

有什么帮助吗?

4

2 回答 2

1

域启动后,你能访问http://localhost:4848http://adam-desktop:4848在你的浏览器中吗?

如果没有,在 linux glassfish 上需要您正确设置/etc/hosts文件,这就是我的大多数此类问题的来源。还要设置适当的网络配置。在 Redhat 上是/etc/sysconfig/network,在 Ubuntu 上是/etc/hostname

于 2012-05-16T14:03:29.820 回答
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

有用。我必须在两台机器上进行更改,这意味着 onadam-desktopadam-laptop.

于 2012-05-19T09:55:09.807 回答