【问题标题】:Requested resource not found when trying to query from cli尝试从 cli 查询时未找到请求的资源
【发布时间】:2021-07-06 07:05:08
【问题描述】:

我正在尝试通过curl 命令在沙发数据库上执行一些查询。

根据文档,我能够使用以下方法获取有关特定存储桶的信息:

curl -v http://base.example.com:8091/pools/default/buckets/results -u 'admin':'xxxx'

问题是我无法使用以下命令执行查询:

curl -v http://base.company.com:8091/query/service -u 'admin':'xxxx' -d 'statement=SELECT * FROM device'

更具体地说,我收到以下错误:

*   Trying xx.xx.xx.xx:8091...
* Connected to base.company.com (xx.xx.xx.xx) port 8091 (#0)
* Server auth using Basic with user 'admin'
> POST /query/service HTTP/1.1
> Host: base.company.com:8091
> Authorization: Basic xxxxxxxxxxxx
> User-Agent: curl/7.77.0
> Accept: */*
> Content-Length: 30
> Content-Type: application/x-www-form-urlencoded
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Object Not Found
< X-XSS-Protection: 1; mode=block
< X-Permitted-Cross-Domain-Policies: none
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< Server: Couchbase Server
< Pragma: no-cache
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Date: Tue, 06 Jul 2021 06:49:22 GMT
< Content-Type: text/plain
< Content-Length: 31
< Cache-Control: no-cache,no-store,must-revalidate
<
Requested resource not found.
* Connection #0 to host base.company.com left intact

【问题讨论】:

    标签: curl couchbase


    【解决方案1】:

    根据documentation,将端口 8093 用于 N1QL 请求。 (相对于Buckets API, which uses port 8091)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-11
      • 1970-01-01
      • 1970-01-01
      • 2017-01-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多