我将解析服务器和解析仪表板与pm2一起安装在synology中的停靠容器中,如下所示:
+------+ +-------------+
| +NIC1 (192.168.1.100) <--> Router <--> (192.168.1.2) NIC1 + |
| PC | | DSM |
| +NIC2 (10.10.0.100) <--Peer-2-Peer---> (10.10.0.2) NIC2 + |
+------+ | [DOCKER] |
|(172.17.0.2) |
+-------------+参考:对于pm2设置,我如下所示:本教程
下面是我的解析服务器和解析仪表板pm2生态系统(在PM2的ecosystem.json中定义):
{
"apps" : [{
"name" : "parse-wrapper",
"script" : "/usr/bin/parse-server",
"watch" : true,
"merge_logs" : true,
"cwd" : "/home/parse",
"args" : "--serverURL http://localhost:1337/parse",
"env": {
"PARSE_SERVER_CLOUD_CODE_MAIN": "/home/parse/cloud/main.js",
"PARSE_SERVER_DATABASE_URI": "mongodb://localhost/test",
"PARSE_SERVER_APPLICATION_ID": "aeb932b93a9125c19df2fcaf3fd69fcb",
"PARSE_SERVER_MASTER_KEY": "358898112f354f8db593ea004ee88fed",
}
},{
"name" : "parse-dashboard-wrapper",
"script" : "/usr/bin/parse-dashboard",
"watch" : true,
"merge_logs" : true,
"cwd" : "/home/parse/parse-dashboard",
"args" : "--config /home/parse/parse-dashboard/config.json --allowInsecureHTTP=1"
}]
}下面是我的解析仪表板配置: /home/parse/ parse-dashboard /config.json
{
"apps": [{
"serverURL": "http://172.17.0.2:1337/parse",
"appId": "aeb932b93a9125c19df2fcaf3fd69fcb",
"masterKey": "358898112f354f8db593ea004ee88fed",
"appName": "Parse Server",
"iconName": "",
"primaryBackgroundColor": "",
"secondaryBackgroundColor": ""
}],
"users": [{
"user": "user",
"pass": "1234"
}],
"iconsFolder": "icons"
}运行后: pm2启动ecosystem.json
下面是解析服务器日志:pm2 logs 0
masterKey: ***REDACTED***
serverURL: http://localhost:1337/parse
masterKeyIps: []
logsFolder: ./logs
databaseURI: mongodb://localhost/test
userSensitiveFields: ["email"]
enableAnonymousUsers: true
allowClientClassCreation: true
maxUploadSize: 20mb
customPages: {}
sessionLength: 31536000
expireInactiveSessions: true
revokeSessionOnPasswordReset: true
schemaCacheTTL: 5000
cacheTTL: 5000
cacheMaxSize: 10000
objectIdSize: 10
port: 1337
host: 0.0.0.0
mountPath: /parse
scheduledPush: false
collectionPrefix:
verifyUserEmails: false
preventLoginWithUnverifiedEmail: false
enableSingleSchemaCache: false
jsonLogs: false
verbose: false
level: undefined
[1269] parse-server running on http://localhost:1337/parse下面是解析仪表板日志:pm2 logs 1
The dashboard is now available at http://0.0.0.0:4040/运行后,我可以访问192.168.1.2:1337/parse (这将返回{"error":"unauthorized"})。
我可以访问192.168.1.2:4040
但它回来了:
无法到达的服务器:无法连接到服务器
我看到很多这个问题都可以通过将解析仪表板配置"serverURL": "http://localhost:1337/parse"更改为"serverURL": "http://172.17.0.2:1337/parse"来解决。
但对我来说还是没有运气..。
知道我在这里错过了什么吗?
发布于 2018-06-05 13:01:48
所以很明显,我的/home/parse/parse/config.json
"serverURL": "http://172.17.0.2:1337/parse"应该指向我的DSM机器,即:
"serverURL": "http://192.168.1.2:1337/parse"https://stackoverflow.com/questions/50685281
复制相似问题