我刚刚通过你们自己的帮助设法使我的服务状态处于活动状态,但是节点服务似乎仍然没有实际运行。
简而言之,我知道我的节点应用程序正在运行,但出于所有密集目的,它没有按应有的方式运行。
服务状态
root@server:/etc/systemd/system# systemctl status parsoid.service
● parsoid.service - MediaWiki Parsoid Server
Loaded: loaded (/etc/systemd/system/parsoid.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2018-12-15 21:18:06 GMT; 29s ago
Main PID: 18799 (node)
Tasks: 9
Memory: 34.8M
CPU: 1.449s
CGroup: /system.slice/parsoid.service
└─18799 /usr/bin/node /var/www/gwart/mediawiki/extensions/VisualEditor/parsoid/bin/server.js
Dec 15 21:18:06 server.live-servers.net systemd[1]: Started MediaWiki Parsoid Server.
Dec 15 21:18:07 server.live-servers.net node[18799]: {"name":"parsoid","hostname":"server.live-servers.net","pid":18799,"level":30,"levelPath":"info/service-runner","msg":"master(18799) initializing 2 workers","time":"2018-12-15T21:18:07.189Z","v":0}
Dec 15 21:18:07 server.live-servers.net node[18799]: {"name":"parsoid","hostname":"server.live-servers.net","pid":18811,"level":60,"moduleName":"lib/index.js","levelPath":"fatal/service-runner/worker","msg":"Unexpected token ...","time":"2018-12-15T21:18:07.898Z","v":0}
Dec 15 21:18:08 server.live-servers.net node[18799]: {"name":"parsoid","hostname":"server.live-servers.net","pid":18799,"level":40,"message":"first worker died during startup, continue startup","worker_pid":18811,"exit_code":1,"startup_attempt":1,"levelPath":"warn/service-runner/master","msg
Dec 15 21:18:09 server.live-servers.net systemd[1]: Started MediaWiki Parsoid Server.
lines 1-15/15 (END)
寻找端口 8000
root@server:/etc/systemd/system# netstat -tulpn | grep 8000
root@server:/etc/systemd/system#
但是我可以看到节点应用程序正在运行
root@server:/etc/systemd/system# ps ax | grep node
18799 ? Ssl 0:00 /usr/bin/node /var/www/gwart/mediawiki/extensions/VisualEditor/parsoid/bin/server.js
20820 pts/1 S+ 0:00 grep --color=auto node
服务档案
[Unit]
Description=MediaWiki Parsoid Server
[Service]
ExecStart=/usr/bin/node /var/www/gwart/mediawiki/extensions/VisualEditor/parsoid/bin/server.js
Restart=always
User=root
Group=root
Environment=PATH=/usr/bin/node:/usr/local/bin
StandardOutput=syslog
StandardError=syslog
WorkingDirectory=/var/www/gwart/mediawiki/extensions/VisualEditor/parsoid
[Install]
WantedBy=multi-user.target
我相信这与这个问题有关:
启动节点应用程序可以node
工作,但启动时不可以/usr/bin/node
答案1
/usr/bin/node
似乎是由包管理器安装的节点可执行文件,并且v4.2.6
对于parsoid
.
该命令node
在这里起作用是因为该命令是/root/.nvm/versions/node/v6.7.0/bin/node
通过nvm
运行链接到安装的v6.7.0
。
要解决此问题,请创建指向当前 nvm 版本的符号链接(以便能够在更新时轻松调整)并在文件中使用该路径.service
。
笔记:
我不建议删除符号链接或文件/usr/bin/node
以便在那里放置具有该名称的符号链接,因为这可能会干扰“库存”节点安装。