在WAS 6.1里为NodeAgent创建Windows系统服务

简介: http://yulimin.javaeye.com/blog/361589   WASService 命令行工具允许您在 Linux 和 Windows 操作系统上为产品 Java 进程创建服务。 当安装向导创建服务时,卸载程序可以除去服务。如果使用 WASService 命令自已创建一个服务,那么当该服务不再有效时,您必须除去它。卸载程序不会除去您使用 WASService 命令创建的

http://yulimin.javaeye.com/blog/361589

 

WASService 命令行工具允许您在 Linux 和 Windows 操作系统上为产品 Java 进程创建服务。
当安装向导创建服务时,卸载程序可以除去服务。如果使用 WASService 命令自已创建一个服务,那么当该服务不再有效时,您必须除去它。卸载程序不会除去您使用 WASService 命令创建的服务。
WASService 命令行工具位于 app_server_root/bin 目录中。
WASService 命令行工具创建服务或更新现有服务的详细命令如下:

Java代码 复制代码
  1. WASService.exe -add service_name   
  2.    -serverName  server_name   
  3.    -profilePath server_profile_directory   
  4.    [-wasHome  app_server_root]   
  5.    [-configRoot configuration_repository_directory]   
  6.    [-startArgs additional_start_arguments]   
  7.    [-stopArgs additional_stop_arguments]   
  8.    [-userid user_id -password password]   
  9.    [-logFile service_log_file]   
  10.    [-logRoot server_log_directory]   
  11.    [-restart true | false]   
  12.    [-startType automatic | manual | disabled]  



WASService 命令行工具启动现有服务的命令
WASService.exe -start service_name [optional startServer.bat parameters]

WASService 命令行工具停止正在运行的服务的命令
WASService.exe -stop service_name [optional stopServer.bat parameters]

WASService 命令行工具查看服务状态的命令
WASService.exe -status service_name

WASService 命令行工具删除服务的命令
WASService.exe -remove service_name


假设 WAS 安装在 D:/IBM/WebSphere/AppServer 目录下,要创建的 NodeAgent 概要文件在 D:/IBM/WebSphere/AppServer/profiles/AppSrv01/ 目录之下,则可以进行如下操作,将 NodeAgent 添加到 Windows 的服务当中
1、进入 WASService 命令行工具目录:
cd D:/IBM/WebSphere/AppServer/bin
2、运行 WASService 命令行工具:
WASService -add nodeagent
-servername nodeagent
-profilePath D:/IBM/WebSphere/AppServer/profiles/AppSrv01
-wasHome "D:/IBM/WebSphere/AppServer"
-logfile "D:/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent/startNodeAgent.log"
-logRoot "D:/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent"
-restart true
-startType automatic

Java代码 复制代码
  1. WASService -add nodeagent -servername nodeagent -profilePath D:/IBM/WebSphere/AppServer/profiles/AppSrv01 -wasHome "D:/IBM/WebSphere/AppServer" -logfile "D:/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent/startNodeAgent.log" -logRoot "D:/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent" -restart true -startType automatic  



查看系统服务,可以看到添加了“IBM WebSphere Application Server V6.1 - nodeagent”一个服务,启动它之后,可以在
D:/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent/目录下看到如下文件的相关启动情况:
startNodeAgent.log
startServer.log
nodeagent.pid

相关的操作日志如下:
创建服务:
D:/IBM/WebSphere/AppServer/bin>WASService -add nodeagent -servername nodeagent -profilePath D:/IBM/WebSphere/AppServer/profiles/AppSrv01 -wasHome "D:/IBM/WebSphere/AppServer" -logfile "D:/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent/startNodeAgent.log" -logRoot "D:/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent" -restart true -startType automatic
Adding Service: nodeagent
        Config Root: D:/IBM/WebSphere/AppServer/profiles/AppSrv01/config
        Server Name: nodeagent
        Profile Path: D:/IBM/WebSphere/AppServer/profiles/AppSrv01
        Was Home: D:/IBM/WebSphere/AppServer/
        Start Args:
        Restart: 1
IBM WebSphere Application Server V6.1 - nodeagent service successfully added.


启动服务
D:/IBM/WebSphere/AppServer/bin>WASService.exe -start "nodeagent"
Starting Service: nodeagent
Successfully started service.


查看服务运行状态
D:/IBM/WebSphere/AppServer/bin>WASService.exe -status "nodeagent"
The service is running.

停止服务
D:/IBM/WebSphere/AppServer/bin>WASService.exe -stop "nodeagent"
Successfully stopped service.

查看服务运行状态
D:/IBM/WebSphere/AppServer/bin>WASService.exe -status "nodeagent"
The service is stopped.

删除服务
D:/IBM/WebSphere/AppServer/bin>WASService.exe -remove nodeagent
Remove Service: nodeagent
Successfully removed service

相关文章
|
1月前
|
开发框架 监控 安全
Windows Defender 导致 Web IIS 服务异常停止排查
某日凌晨IIS服务异常停止,经查为Windows Defender安全补丁KB2267602触发引擎更新,导致系统资源波动,进而引发应用池回收。确认非人为操作,系统无重启。通过分析日志与监控,定位原因为Defender更新后扫描加重负载。解决方案:将IIS及.NET相关路径添加至Defender排除列表,避免业务影响。
323 116
|
7月前
|
安全 数据安全/隐私保护 Windows
如何在Windows 10系统中查看已连接WiFi密码-亲测可用-优雅草卓伊凡
如何在Windows 10系统中查看已连接WiFi密码-亲测可用-优雅草卓伊凡
361 15
如何在Windows 10系统中查看已连接WiFi密码-亲测可用-优雅草卓伊凡
|
7月前
|
关系型数据库 虚拟化 UED
Omnissa Horizon Windows OS Optimization Tool 2503 - Windows 系统映像优化工具
Omnissa Horizon Windows OS Optimization Tool 2503 - Windows 系统映像优化工具
304 7
Omnissa Horizon Windows OS Optimization Tool 2503 - Windows 系统映像优化工具
|
2月前
|
运维 安全 Linux
【清爽加速】Windows 11 Pro 24H2-Emmy精简系统
“清爽加速”Windows 11 Pro 24H2 针对老旧或低配设备,通过精简系统、优化服务与简化装机流程,降低资源占用,提升运行流畅度,兼顾安全性与稳定性,让老设备也能轻松应对日常办公与轻度娱乐需求。
【清爽加速】Windows 11 Pro 24H2-Emmy精简系统
|
2月前
|
安全 数据安全/隐私保护 Windows
ZyperWin++使用教程!让Windows更丝滑!c盘飘红一键搞定!ZyperWin++解决系统优化、Office安装和系统激活
ZyperWin++是一款仅5MB的开源免费Windows优化工具,支持快速优化、自定义设置与垃圾清理,兼具系统加速、隐私保护、Office安装等功能,轻便无广告,小白也能轻松上手,是提升电脑性能的全能管家。
932 0
|
2月前
|
安全 搜索推荐 开发者
【适度精简】Windows 7 旗舰版-emmy精简系统
Windows 7旗舰版因硬件占用高、冗余组件多、兼容性差及缺乏安全更新等问题,逐渐难以满足用户需求。适度精简版通过去除无用组件、优化性能与安全性,提升老旧设备运行效率,增强兼容性与稳定性,同时保留用户熟悉的操作界面,降低学习成本,满足个性化需求,延续Windows 7的实用价值。
|
3月前
|
Ubuntu Linux Windows
windows11系统安装ubuntu系统详细步骤
安装后,您可以直接从商店启动应用程序来源
701 0
|
5月前
|
Ubuntu Linux 数据安全/隐私保护
Windows中安装WSL 2和Ubuntu系统的教程
回看这一路,有趣吧?你已经跨界成为了一个Windows和Linux的桥梁。期待在代码的世界里,把一切玩得风生水起!
302 13
|
4月前
|
持续交付 Windows
如何使用Sysprep准备Windows系统并使用自动应答
通过Sysprep准备Windows系统,可实现SID重置与系统定制。进入Sysprep后,可安装软件、设置默认桌面文件,并使用Windows SIM创建应答文件以实现自动化部署。适用于系统克隆与批量部署场景。
|
6月前
|
JSON 安全 数据可视化
Elasticsearch(es)在Windows系统上的安装与部署(含Kibana)
Kibana 是 Elastic Stack(原 ELK Stack)中的核心数据可视化工具,主要与 Elasticsearch 配合使用,提供强大的数据探索、分析和展示功能。elasticsearch安装在windows上一般是zip文件,解压到对应目录。文件,elasticsearch8.x以上版本是自动开启安全认证的。kibana安装在windows上一般是zip文件,解压到对应目录。elasticsearch的默认端口是9200,访问。默认用户是elastic,密码需要重置。
3239 0