【问题标题】:Unable to create marklogic rest api instance无法创建 marklogic rest api 实例
【发布时间】:2018-05-31 20:31:42
【问题描述】:

我正在尝试使用以下配置创建 rest-api 实例: rest-api.json

{
 "rest-api": {
     "name": "restdb-api",
     "database": "restdb",
     "port": "8003",
     "xdbc-enabled": true,
     "forests-per-host": 1,
     "error-format": "json"
  }
}

curl --anyauth --user admin:admin -i -X POST -d @"./REST/rest-api.json"  -H "Content-type: application/json" http://localhost:8002/LATEST/rest-apis

端点返回 201 created,但我无法在 http://localhost:8003 访问创建的端点。我尝试过使用其他端口,但同样的事情正在发生。端口 8003 未在侦听。请帮我解决这个问题。

HTTP/1.1 401 Unauthorized
Server: MarkLogic
WWW-Authenticate: Digest realm="public", qop="auth", nonce="36473d01f5e45a:ND9/6NHD0sw9o2y/xad/uQ==", opaque="e9594a1b7e019a97"
Content-Type: text/html; charset=utf-8
Content-Length: 209
Connection: Keep-Alive
Keep-Alive: timeout=5

HTTP/1.1 201 Created
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5

【问题讨论】:

    标签: rest marklogic marklogic-9


    【解决方案1】:

    既然你说你在本地 docker 容器上运行,你可能需要发布端口。

    见 Docker Expose

    请从链接中注意 - “EXPOSE 指令实际上并没有发布端口。它充当构建图像的人和运行容器的人之间的一种文档,关于哪些端口打算成为已发布。要在运行容器时实际发布端口,请使用 docker run 上的 -p 标志发布和映射一个或多个端口,或使用 -P 标志发布所有暴露的端口并将它们映射到高位端口。"

    希望有帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-09-24
      • 2023-03-26
      • 2022-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多