7

我正在尝试使用 asadmin 工具创建一个新域,但每次报告所有端口都在使用中时它都会失败。操作系统是 Fedora 19。可能是什么问题?

$ ./bin/asadmin create-domain testdomain
Enter admin user name [Enter to accept default "admin" / no password]> 
Default port 4848 for Admin is in use. Using 52447
Default port 8080 for HTTP Instance is in use. Using 33934
Default port 7676 for JMS is in use. Using 33967
Default port 3700 for IIOP is in use. Using 34733
Default port 8181 for HTTP_SSL is in use. Using 52020
Default port 3820 for IIOP_SSL is in use. Using 46636
Default port 3920 for IIOP_MUTUALAUTH is in use. Using 39574
Default port 8686 for JMX_ADMIN is in use. Using 51770
Default port 6666 for OSGI_SHELL is in use. Using 41403
Default port 9009 for JAVA_DEBUGGER is in use. Using 60521
Port 52,447 is in use
CLI130 Could not create domain, testdomain
Command create-domain failed.
4

4 回答 4

9

I had the same issue and it finally turned out that my hostname was not configured inside of the /etc/hosts file. The error given by asadmin is somehow misleading. :-(

You could check if your hostname was correctly configured by:

ping `hostname`

If you get a "ping: unknown host" error you have to fix your hostname.

Login as root and fix your hostname using:

hostname "<YOUR_HOSTNAME>"

and to make it permanent by

echo "<YOUR_HOSTNAME>" > /etc/hostname

You also have to check that your /etc/hosts file contains a line like:

127.0.0.1        <YOUR_HOSTNAME>

after doing this you should not get the unknown host error when using ping.

I got the idea for the solutions from replies to this question.

于 2013-10-26T07:35:27.820 回答
2

创建新域时,您可以指定 portbase 参数。这样可以避免端口冲突。

$ ./bin/asadmin create-domain --portbase 10000 testDomain
Enter admin user name [Enter to accept default "admin" / no password]>
Using port 10048 for Admin.
Using port 10080 for HTTP Instance.
Using port 10076 for JMS.
Using port 10037 for IIOP.
Using port 10081 for HTTP_SSL.
Using port 10038 for IIOP_SSL.
Using port 10039 for IIOP_MUTUALAUTH.
Using port 10086 for JMX_ADMIN.
Using port 10066 for OSGI_SHELL.
Using port 10009 for JAVA_DEBUGGER.
[..]
Domain testDomain created.
Domain testDomain admin port is 10048.
Domain testDomain allows admin login as user "admin" with no password.
Command create-domain executed successfully.

请参阅:http ://docs.oracle.com/cd/E26576_01/doc.312/e24938/create-domain.htm

于 2014-07-16T16:34:19.233 回答
2

我也有过这个。重新启动整个服务器后,可以再次设置端口。我不知道是哪个,但我很确定某些服务阻止了它,或者 glassfish 进程卡住了。

于 2013-10-03T12:09:58.817 回答
-1

你可以跑

netstat -anp | grep 52
netstat -anp | grep 447 

Fedora 项目

于 2013-10-08T08:58:48.447 回答