我刚刚通过你们自己的帮助设法使我的服务状态处于活动状态,但是它仍然显示节点服务实际上没有运行。
简而言之,我知道我的节点应用程序正在运行,但出于所有密集目的,它没有按预期运行。
服务状态
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
我相信这与这个问题有关:
Starting node application with node
works but not when starting it with/usr/bin/node
/usr/bin/node
似乎是包管理器安装的节点可执行文件,v4.2.6
对于parsoid
.该命令
node
在这里起作用,因为该命令已通过运行链接到/root/.nvm/versions/node/v6.7.0/bin/node
installed 。nvm
v6.7.0
要解决此问题,请创建指向当前 nvm 版本的符号链接(以便在更新时能够轻松调整)并在
.service
文件中使用该路径。注意: 我不建议删除符号链接或文件
/usr/bin/node
以便在那里放置具有该名称的符号链接,因为这可能会干扰“stock”节点安装。