繁体   English   中英

Debian PM2无法启动Elasticsearch服务器

[英]Debian pm2 unable to start elasticsearch server

我在linux debian核心上运行节点服务器。
我正在使用pm2在后台运行所有进程并监视它们。
除了elasticsearch服务器以外,其他所有东西都正常工作,我收到一条我不理解的错误消息。

SyntaxError: Unexpected token ILLEGAL
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function._load (/usr/lib/node_modules/pm2/node_modules/pmx/lib/transaction.js:62:21)
    at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:46:21)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)

当我做pm2 list以查看其他进程时,这是结果:

在此处输入图片说明

我用来pm2 start ./bin/elasticsearch服务器的命令就是pm2 start ./bin/elasticsearch而不是文档所说的./bin/elasticsearch

我将仅在本地运行elasticsearch服务器,因此正确的ip是127.0.0.1端口9200
我还要提到的是,如果我正常运行,没有PM2的elasticsearch服务器做的工作。

这是我的elasticsearch.yml配置文件。

cluster.name: swissnet
node.name: "swissnet-data"
node.master: true
node.data: true
path.data: ../local-data/
path.logs: ../local-logs/
ES_HEAP_SIZE: 300m
network.host: 127.0.0.1
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["127.0.0.1"]
discovery.zen.minimum_master_nodes: 3
gateway.recover_after_nodes: 8
gateway.expected_nodes: 10
gateway.recover_after_time: 5m
ES_JAVA_OPTS: "-Des.insecure.allow.root=true"

有任何想法吗? 还欢迎Elasticsearch.yml更新。

您需要创建文件sh,例如:ES_service.sh

#!/bin/bash
sh /your_path/bin/elasticsearch

然后运行您的pm2命令:

pm2 start ES_service.sh --name=elasticsearch

使用pm2列表检查您的服务我在Ubuntu和Centos 7中使用过它,一切正常,也许有帮助

问候

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM