starrocks3.1.14查询es8

3.1.14 1 fe + 1 be 查询es 8.6.1

es开启了https访问。

sr查询es8查不到数据

CREATE EXTERNAL CATALOG es22a_catalog
comment “es22_catalog”
PROPERTIES (“enable_docvalue_scan” = “true”,
“es.nodes.wan.only” = “false”,
“hosts” = “https://10.6.18.22:9200”,
“es.net.ssl” = “true”,
“type” = “es”,
“user” = “elastic”,
“password” = “mqxxxxmM”,
“enable_keyword_sniff” = “true”
)

set catalog es22a_catalog;
use default_db;

MySQL [default_db]> show create table tb_properties_data_19594;
±-------------------------±------------------------------------------------------------------------+
| Table | Create Table |
±-------------------------±------------------------------------------------------------------------+
| tb_properties_data_19594 | CREATE TABLE tb_properties_data_19594 (
query json DEFAULT NULL
) |
±-------------------------±------------------------------------------------------------------------+
1 row in set (0.13 sec)

MySQL [default_db]> select * from tb_properties_data_13154 limit 10;
ERROR 1064 (HY000): Failed to connect to ES server, errmsg is: Empty reply from server


es访问,查看索引mapping:

curl --user elastic:mqNRixxxxxxM -k -XGET https://10.6.18.23:9200/tb_properties_data_19594/_mapping

{“tb_properties_data_19594”:{“mappings”:{“dynamic_templates”:[{“handPropertiesAnyStringToKeyword”:{“match_mapping_type”:“string”,“mapping”:{“ignore_above”:2048,“type”:“keyword”}}}],“properties”:{“query”:{“properties”:{“range”:{“properties”:{“datatimestamp”:{“properties”:{“lt”:{“type”:“long”}}}}}}}}}}}

如果不加-k,就访问不了

curl --user elastic:mqNRiOd5rAGh7TXiWGmM -XGET https://10.6.18.23:9200/tb_properties_data_13154/_mapping
curl: (60) Peer’s certificate issuer has been marked as not trusted by the user.
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a “bundle”
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn’t adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you’d like to turn off curl’s verification of the certificate, use
the -k (or --insecure) option.