尝试从cli查询时找不到请求的资源



我正试图通过curl命令对couchbase数据库执行一些查询。

根据文档,我可以使用获得有关特定bucket的信息

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

根据文档,对N1QL请求使用端口8093。(与使用端口8091的Buckets API相反(。

最新更新