无法启动payara服务器

时间:2017-07-30 07:41:14

标签: java server payara

我无法重启服务器。

开始我杀死所有进程并重新启动服务器。我收到了成功的消息,但应用程序无法运行。我再次停下来开始服务。现在,系统显示服务器上正在运行另一个进程,如下所示。

[pdpadmin@saclx065 bin]$ killall -9 java
[pdpadmin@saclx065 bin]$ ./asadmin start-domain pdpws
Waiting for pdpws to start ............................................
Successfully started the domain : pdpws
domain  Location: /pdp/payara41/glassfish/domains/pdpws
Log File: /pdp/payara41/glassfish/domains/pdpws/logs/server.log
Admin Port: 9048
Command start-domain executed successfully.
[pdpadmin@saclx065 bin]$ ./asadmin start-domain pdp
Waiting for pdp to start .......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
serverNoStart
Command start-domain failed.
[pdpadmin@saclx065 bin]$ ./asadmin start-domain pdpws
There is a process already using the admin port 9048 -- it could be another instance of Payara Server or Payara Micro.
Command start-domain failed.

你能帮我检查这个问题吗?

4 个答案:

答案 0 :(得分:1)

您已启动了两个不同的域pdpwspdp。如果两个域都配置为使用端口9048作为管理端口,则无法在同一服务器上运行它们。您必须选择其他端口。

但是,您不应该使用killall命令终止您的域名,而应使用./asadmin stop-domain pdpws./asadmin stop-domain pdp将其关闭。创建服务脚本会更好。

使用systemctl的unix系统上的payara服务脚本可以完成如下操作:使用以下内容创建文件/usr/lib/systemd/system/payara.service

[Unit]
Description=Payara Server
After=syslog.target network.target

[Service]
Type=forking

ExecStart=/opt/payara41/glassfish/bin/asadmin start-domain pdpws
ExecStop=/opt/payara41/glassfish/bin/asadmin stop-domain pdpws

[Install]
WantedBy=multi-user.target

比你可以致电:

systemctl start payara
systemctl stop payara

答案 1 :(得分:0)

通过重新加载应用程序解决了此问题。重新部署,重新启动和重新加载服务器中的应用程序有什么区别?

答案 2 :(得分:0)

以下是准备生产的开始,停止,清洁bash的bash工具。请注意您的payara版本是否存在..并在Centos上添加此bash文件-> usr / bin ....,并赋予执行权限(chmod a + x / usr / bin / file_name)和所有权(将your_user:your_user / usr命名) / bin / file_name)作为默认用户

#!/bin/bash 

BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
LIME_YELLOW=$(tput setaf 190)
POWDER_BLUE=$(tput setaf 153)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
WHITE=$(tput setaf 7)
BRIGHT=$(tput bold)
NORMAL=$(tput sgr0)
BLINK=$(tput blink)
REVERSE=$(tput smso)
UNDERLINE=$(tput smul)





printf "${GREEN}\n\n\n       welcome to TEKILA App commander \n\n"
printf "${GREEN}before start please switch java version with command if requires\n\n" 
printf "${RED}  alternatives --config java \n\n"

printf "\n${YELLOW}     Payara 4.1 (required environment java 1.8)  \n\n"
printf "${MAGENTA} p1     start\n"
printf "${MAGENTA} p2     stop\n"
printf "${MAGENTA} p3     restart\n"
printf "${MAGENTA} p4     start in debug mode\n"
printf "${MAGENTA} p5     restart in debug mode\n"

printf "\n${YELLOW}     Glassfish 3.1 (required environment java 1.7)  \n\n"
printf "${MAGENTA} g1     start\n"
printf "${MAGENTA} g2     stop\n"
printf "${MAGENTA} g3     restart\n"
printf "${MAGENTA} g4     start in debug mode\n"
printf "${MAGENTA} g5     restart in debug mode\n"

printf "\n${YELLOW}     Additional Plugin  \n\n"

printf "${MAGENTA} jk     Kill All Running Java Process \n\n"
printf "${MAGENTA} jkc    Kill All Running Java Process And Clear Payara \n\n"
printf "${MAGENTA} jkcs   Kill All Running Java Process And Clear Payara And Start payara \n\n"
printf "${MAGENTA} clear_payara    Clear Payara -> Generated -> Policy, EJB Timers, JSF, XML, EJB... \n\n"

printf " \n\n ${CYAN}   please enter appropriate command (for exit CTRL+C)${NORMAL} \n\n\n"


read a   

case $a in 

p1 ) printf "\n\n ${YELLOW} Payara Starts...${NORMAL} \n\n" && /opt/payara\ 4.1.2.173/bin/./asadmin start-domain tekila ;;

p2 ) printf "\n\n ${YELLOW} Payara Stops...${NORMAL} \n\n"  && /opt/payara\ 4.1.2.173/bin/./asadmin stop-domain tekila ;;

p3 ) printf "\n\n ${YELLOW} Payara Restarts...${NORMAL} \n\n"  && /opt/payara\ 4.1.2.173/bin/./asadmin restart-domain tekila ;;

p4 ) printf "\n\n ${YELLOW} Payara Starts in debug mode...${NORMAL} \n\n"  && /opt/payara\ 4.1.2.173/bin/./asadmin start-domain --debug tekila ;;

p5 ) printf "\n\n ${YELLOW} Payara Restarts in debug mode...${NORMAL} \n\n"  && /opt/payara\ 4.1.2.173/bin/./asadmin restart-domain --debug tekila ;;

g1 ) printf "\n\n ${YELLOW} Glassfish Starts...${NORMAL} \n\n"  && /opt/gf/glassfish/bin/./asadmin start-domain tekila ;;

g2 ) printf "\n\n ${YELLOW} Glassfish Stops...${NORMAL} \n\n"  && /opt/gf/glassfish/bin/./asadmin stop-domain tekila ;;

g3 ) printf "\n\n ${YELLOW} Glassfish Restarts...${NORMAL} \n\n"  && /opt/gf/glassfish/bin/./asadmin restart-domain tekila ;;

g4 ) printf "\n\n ${YELLOW} Glassfish Starts in debug mode...${NORMAL} \n\n"  && /opt/gf/glassfish/bin/./asadmin start-domain --debug tekila ;;

g5 ) printf "\n\n ${YELLOW} Glassfish Restarts in debug mode...${NORMAL} \n\n"  && /opt/gf/glassfish/bin/./asadmin restart-domain --debug tekila ;;

jk )  printf "\n\n ${YELLOW} Java process is killing ... ${NORMAL} \n\n" &&  kill -9 `lsof -t -c  java`  &&  printf "\n\n ${GREEN} Completed successfully ${NORMAL} \n\n" ;;

jkc ) printf "\n\n ${YELLOW} Java process is killing ... ${NORMAL} \n\n" &&  kill -9 `lsof -t -c  java` && printf "\n\n ${YELLOW} Payara oldly generated ejb, policy, jsf, xml, ejb... is cleaning ... ${NORMAL} \n\n" && rm -rf /opt/payara\ 4.1.2.173/glassfish/domains/tekila/osgi-cache/felix/*  &&  rm -rf /opt/payara\ 4.1.2.173/glassfish/domains/tekila/applications/tekila-billing-gateway-ear-0.0.1  &&  rm -rf /opt/payara\ 4.1.2.173/glassfish/domains/tekila/generated/*  &&  printf "\n\n ${GREEN} Completed successfully ${NORMAL} \n\n" ;;

jkcs ) printf "\n\n ${YELLOW} Java process is killing ... ${NORMAL} \n\n" &&  kill -9 `lsof -t -c  java` && printf "\n\n ${YELLOW} Payara oldly generated ejb, policy, jsf, xml, ejb... is cleaning ... ${NORMAL} \n\n" && rm -rf /opt/payara\ 4.1.2.173/glassfish/domains/tekila/osgi-cache/felix/*  &&  rm -rf /opt/payara\ 4.1.2.173/glassfish/domains/tekila/applications/tekila-billing-gateway-ear-0.0.1  &&  rm -rf /opt/payara\ 4.1.2.173/glassfish/domains/tekila/generated/* && printf "\n\n ${YELLOW} Payara Starts...${NORMAL} \n\n" && /opt/payara\ 4.1.2.173/bin/./asadmin start-domain tekila  &&  printf "\n\n ${GREEN} Completed successfully ${NORMAL} \n\n" ;;

clear_payara )  printf "\n\n ${YELLOW} Payara oldly generated ejb, policy, jsf, xml, ejb... is cleaning ... ${NORMAL} \n\n" && rm -rf /opt/payara\ 4.1.2.173/glassfish/domains/tekila/osgi-cache/felix/*  &&  rm -rf /opt/payara\ 4.1.2.173/glassfish/domains/tekila/applications/tekila-billing-gateway-ear-0.0.1  &&  rm -rf /opt/payara\ 4.1.2.173/glassfish/domains/tekila/generated/*  &&  printf "\n\n ${GREEN} Completed successfully ${NORMAL} \n\n" ;;

* )  printf "${RED}Please  please read description ${NORMAL}";;

esac  

答案 3 :(得分:0)

您应该专注于JAVA_HOME环境变量,但是为了安全起见,我将添加到/etc/systemd/system文件夹payara.service文件中,并将服务设置为Dennis Kriechel,并做了一些小的更改以避免Java版本问题

    [Unit] 
    Description=Payara Server 
    After=syslog.target network.target

    [Service] 
    Type=forking

    ExecStart =/opt/jdk1.8.0_211/bin/java -jar /opt/payara5/glassfish/lib/client/appserver-cli.jar start-domain domain_name
    ExecStop = /opt/jdk1.8.0_211/bin/java -jar /opt/payara5/glassfish/lib/client/appserver-cli.jar stop-domain domain_name
    ExecReload=/opt/jdk1.8.0_211/bin/java -jar /opt/payara5/glassfish/lib/client/appserver-cli.jar restart-domain domain_name
    [Install] 

    WantedBy=multi-user.target

source