解析仪表板:无法访问服务器:无法连接服务器错误

Parse-Dashboard: Server Not Reachable: unable to connect server Error

我的 synology nas 中的 docker 容器中有 parse-server and parse-dashboard installed with pm2,如下所示:

+------+                                                         +-------------+
|      +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 设置,我正在关注:this tutorial

这是我的解析服务器和解析仪表板 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(这将 return {"error":"unauthorized"}

我可以访问 192.168.1.2:4040

但是 return:

Server not reachable: unable to connect to server

我看到很多这个问题可以通过将 parse-dashboard 配置 "serverURL": "http://localhost:1337/parse" 更改为 "serverURL": "http://172.17.0.2:1337/parse"

来解决

但对我来说,还是不走运...

知道我错过了什么吗?

显然,我的 /home/parse/parse-dashboard/config.json:

"serverURL": "http://172.17.0.2:1337/parse"

应该指向我的 DSM 机器:

"serverURL": "http://192.168.1.2:1337/parse"