我从mediawiki,nodejs v0.10.25有parsoid 0.4.0,当我/etc/init.d/parsoid启动时,我收到工作人员重新启动了在parsoid.log中的下一条消息,这条消息无限期地重复,使得我的parsoid.log无限增长,另一只手我没有在http://localhost:8142接收任何响应,8142是我的解析符所说的服务端口,当我以“/etc/init.d/parsoid start”开头时输出消息:
root@vscj016mlinuxserver:/usr/lib# /etc/init.d/parsoid start
Started Parsoid server on port 8142
root@vscj016mlinuxserver:/usr/lib#
/var/log/parsoid.log输出:
[info][master][13876] initializing 4 workers
[info][worker][13879] loading ...
[info][worker][13882] loading ...
[info][worker][13878] loading ...
[info][worker][13881] loading ...
[fatal][worker][13879] uncaught exception Object function createApplication() {
var app = function(req, res, next) {
app.handle(req, res, next);
};
mixin(app, EventEmitter.prototype, false);
mixin(app, proto, false);
app.request = { __proto__: req, app: app };
app.response = { __proto__: res, app: app };
app.init();
return app;
} has no method 'createServer'
TypeError: Object function createApplication() {
var app = function(req, res, next) {
app.handle(req, res, next);
};
mixin(app, EventEmitter.prototype, false);
mixin(app, proto, false);
app.request = { __proto__: req, app: app };
app.response = { __proto__: res, app: app };
app.init();
return app;
} has no method 'createServer'
at new ParsoidService (/usr/lib/parsoid/src/api/ParsoidService.js:23:20)
at Object.<anonymous> (/usr/lib/parsoid/src/api/server.js:202:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
另一方面,我可以看到de进程以“ps -ef | grep parsoid”开头,进程的de pids每次都会改变,如下所示:
parsoid 920 1 0 09:08 ? 00:00:00 /bin/sh -c /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js >> /var/log/parsoid/parsoid.log 2>&1
parsoid 949 920 0 09:08 ? 00:00:01 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2563 949 18 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2565 949 19 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2567 949 17 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2569 949 5 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
root 2572 2134 0 09:13 pts/0 00:00:00 grep --color=auto parsoid
root@vscj016mlinuxserver:/var/log/parsoid# ps -ef| grep parsoid
parsoid 920 1 0 09:08 ? 00:00:00 /bin/sh -c /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js >> /var/log/parsoid/parsoid.log 2>&1
parsoid 949 920 0 09:08 ? 00:00:01 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2579 949 23 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2581 949 23 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2583 949 0 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2585 949 0 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
root 2588 2134 0 09:13 pts/0 00:00:00 grep --color=auto parsoid
root@vscj016mlinuxserver:/var/log/parsoid# ps -ef| grep parsoid
parsoid 920 1 0 09:08 ? 00:00:00 /bin/sh -c /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js >> /var/log/parsoid/parsoid.log 2>&1
parsoid 949 920 0 09:08 ? 00:00:01 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2581 949 22 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2583 949 30 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2585 949 28 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
parsoid 2589 949 15 09:13 ? 00:00:00 /usr/bin/nodejs /usr/lib/parsoid/src/api/server.js -c /etc/mediawiki/parsoid/settings.js
我展示了/etc/mediawiki/parsoid/settings.js以及:
exports.setup = function(parsoidConfig) {
// Set your own user-agent string
// Otherwise, defaults to "Parsoid/<current-version-defined-in- package.json>"
//parsoidConfig.userAgent = "My-User-Agent-String";
// The URL of your MediaWiki API endpoint.
parsoidConfig.setMwApi('localhost', {uri: 'http://localhost/mediawiki/api.php'} );
// To specify a proxy (or proxy headers) specific to this prefix (which
// overrides defaultAPIProxyURI) use:
/*
parsoidConfig.setMwApi('localhost', {
uri: 'http://localhost/w/api.php',
// set `proxy` to `null` to override and force no proxying.
proxy: {
uri: 'http://my.proxy:1234/',
headers: { 'X-Forwarded-Proto': 'https' } // headers are optional
}
});
*/
......
......
......
这里我展示了安装的数据包和我的ubuntu服务器的版本:
root@vscj016mlinuxserver:/usr/lib# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
root@vscj016mlinuxserver:/usr/lib#
root@vscj016mlinuxserver:/usr/lib#
root@vscj016mlinuxserver:/usr/lib# dpkg -l parsoid
Deseado=Desconocido/Instalar/Eliminar/Purgar/Retener
| Estado=No/Instalado/Config-files/Desempaquetado/Medio-conf/Medio- inst/espera-disparo/pendiente-disparo
|/ Err?=(ninguno)/Requiere-reinst (Estado,Err: mayúsc.=malo)
||/ Nombre Versión Arquitectura Descripción
+++-=================================-=====================- =====================- =======================================================================
ii parsoid 0.4.0 amd64 Web service converting HTML+RDFa to MediaWiki wikitext and back
root@vscj016mlinuxserver:/usr/lib# dpkg -l nodejs
Deseado=Desconocido/Instalar/Eliminar/Purgar/Retener
| Estado=No/Instalado/Config-files/Desempaquetado/Medio-conf/Medio- inst/espera-disparo/pendiente-disparo
|/ Err?=(ninguno)/Requiere-reinst (Estado,Err: mayúsc.=malo)
||/ Nombre Versión Arquitectura Descripción
+++-=================================-=====================- =====================- =======================================================================
ii nodejs 0.10.25~dfsg2-2ubuntu amd64 evented I/O for V8 javascript
root@vscj016mlinuxserver:/usr/lib# dpkg -l nodejs-legacy
Deseado=Desconocido/Instalar/Eliminar/Purgar/Retener
| Estado=No/Instalado/Config-files/Desempaquetado/Medio-conf/Medio- inst/espera-disparo/pendiente-disparo
|/ Err?=(ninguno)/Requiere-reinst (Estado,Err: mayúsc.=malo)
||/ Nombre Versión Arquitectura Descripción
+++-=================================-=====================- =====================- =======================================================================
ii nodejs-legacy 0.10.25~dfsg2-2ubuntu all evented I/O for V8 javascript (legacy symlink)
root@vscj016mlinuxserver:/usr/lib#
答案 0 :(得分:0)
使用较新版本的Node,您将获得更好的时间,例如&gt; = 4.3。您可以使用NVM运行管理不同版本的节点:https://github.com/creationix/nvm
答案 1 :(得分:0)
这是我的parsoid配置,我不知道这是不是问题:
exports.setup = function(parsoidConfig) {
// Set your own user-agent string
// Otherwise, defaults to "Parsoid/<current-version-defined-in- package.json>"
//parsoidConfig.userAgent = "My-User-Agent-String";
// The URL of your MediaWiki API endpoint.
parsoidConfig.setMwApi('localhost', { uri: 'http://localhost/mediawiki/api.php' });
// To specify a proxy (or proxy headers) specific to this prefix (which
// overrides defaultAPIProxyURI) use:
/*
parsoidConfig.setMwApi('localhost', {
uri: 'http://localhost/w/api.php',
// set `proxy` to `null` to override and force no proxying.
proxy: {
uri: 'http://my.proxy:1234/',
headers: { 'X-Forwarded-Proto': 'https' } // headers are optional
}
});
*/
答案 2 :(得分:0)
this my /etc/mediawiki/parsoid configuration:
exports.setup = function(parsoidConfig) {
// Set your own user-agent string
// Otherwise, defaults to "Parsoid/<current-version-defined-in- package.json>"
//parsoidConfig.userAgent = "My-User-Agent-String";
// The URL of your MediaWiki API endpoint.
parsoidConfig.setMwApi('localhost', { uri: 'http://localhost/mediawiki/api.php' });
// To specify a proxy (or proxy headers) specific to this prefix (which
// overrides defaultAPIProxyURI) use:
/*
parsoidConfig.setMwApi('localhost', {
uri: 'http://localhost/w/api.php',
// set `proxy` to `null` to override and force no proxying.
proxy: {
uri: 'http://my.proxy:1234/',
headers: { 'X-Forwarded-Proto': 'https' } // headers are optional
}
});
*/