0

我在我的 Synology nas 的 docker 容器中安装了pm2的parse-serverparse-dashboard ,如下所示:

+------+                                                         +-------------+
|      +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 的生态系统.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 start 生态系统.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

但它返回:

服务器不可达:无法连接到服务器

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

但对我来说,仍然没有运气......

知道我在这里缺少什么吗?

4

1 回答 1

0

很明显,我的/home/parse/parse-dashboard/config.json

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

应该指向我的 DSM 机器,即:

"serverURL": "http://192.168.1.2:1337/parse"
于 2018-06-05T13:01:48.797 回答