创建全文索引失败

  • nebula 版本:2.0.1
  • 部署方式:分布式
  • 是否为线上版本:N
  • 硬件信息
    • 磁盘:SSD
    • CPU、内存信息:4C、32G、3节点集群
  • 问题的具体描述

按照官网的步骤安装了ES和listener:Nebula 基于全文搜索引擎的文本搜索

ES模板配置:

PUT _template/nebula-template
{
  "index_patterns": [
    "nebula*"
  ],
  "settings": {
    "index": {
      "number_of_shards": 3,
      "number_of_replicas": 1
    }
  },
  "mappings": {
    "properties" : {
            "tag_id" : { "type" : "long" },
            "column_id" : { "type" : "text" },
            "value" :{ "type" : "keyword"}
        }
  }
}

nebula-storaged-listener.conf文件配置:

########## nebula-storaged-listener ###########
########## basics ##########
# Whether to run as a daemon process
--daemonize=true
# The file to host the process id
--pid_file=pids_listener/nebula-storaged.pid

########## logging ##########
# The directory to host logging files
--log_dir=logs_listener
# Log level, 0, 1, 2, 3 for INFO, WARNING, ERROR, FATAL respectively
--minloglevel=0
# Verbose log level, 1, 2, 3, 4, the higher of the level, the more verbose of the logging
--v=0
# Maximum seconds to buffer the log messages
--logbufsecs=0
# Whether to redirect stdout and stderr to separate output files
--redirect_stdout=true
# Destination filename of stdout and stderr, which will also reside in log_dir.
--stdout_log_file=storaged-stdout.log
--stderr_log_file=storaged-stderr.log
# Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
--stderrthreshold=2

########## networking ##########
# Meta server address
--meta_server_addrs=10.65.101.89:9559,10.65.101.42:9559,10.65.101.43:9559
# Local ip
--local_ip=10.65.101.89
# Storage daemon listening port
--port=44510
# HTTP service ip
--ws_ip=10.65.101.89
# HTTP service port
--ws_http_port=12021
# HTTP2 service port
--ws_h2_port=12031
# heartbeat with meta service
--heartbeat_interval_secs=10

########## storage ##########
# Listener wal directory. only one path is allowed.
--listener_path=data/listener
# This parameter can be ignored for compatibility. let's fill A default value of "data"
--data_path=data
# The type of part manager, [memory | meta]
--part_man_type=memory
# The default reserved bytes for one batch operation
--rocksdb_batch_size=4096
# The default block cache size used in BlockBasedTable.
# The unit is MB.
--rocksdb_block_cache=4
# The type of storage engine, `rocksdb', `memory', etc.
--engine_type=rocksdb
# The type of part, `simple', `consensus'...
--part_type=simple

之后按命令启动listener:./bin/nebula-storaged --flagfile etc/nebula-storaged-listener.conf

然后创建space和tag:

CREATE SPACE basketballplayer (partition_num=3,replica_factor=1, vid_type=fixed_string(30));
SIGN IN TEXT SERVICE (10.65.101.89:9200);
ADD LISTENER ELASTICSEARCH 10.65.101.89:9200,10.65.101.42:9200,10.65.101.43:9200;

CREATE TAG player(name string, age int);
CREATE TAG INDEX name ON player(name(20));

INSERT VERTEX player(name, age) VALUES 
  "Russell Westbrook": ("Russell Westbrook", 30), 
  "Chris Paul": ("Chris Paul", 33),
  "Boris Diaw": ("Boris Diaw", 36),
  "David West": ("David West", 38),
  "Danny Green": ("Danny Green", 31),
  "Tim Duncan": ("Tim Duncan", 42),
  "James Harden": ("James Harden", 29),
  "Tony Parker": ("Tony Parker", 36),
  "Aron Baynes": ("Aron Baynes", 32),
  "Ben Simmons": ("Ben Simmons", 22),
  "Blake Griffin": ("Blake Griffin", 30);

LOOKUP ON player WHERE PREFIX(player.name, "B");

发现最后一步报错:SemanticError: fulltext index not found : nebula_basketballplayer_tag
看es里面没有出创建出任何索引
show listener都是在线的:

logs_listener/nebula-storaged.INFO的日志:

看样子是listener的数据还没同步到es集群,这个过程是异步的,会有些延迟。

今天看ES,还是没有创建任何索引

不知道怎么去排查这个问题呢?

可能是listener同步wal的问题,这样尝试一下?把listener关闭,然后把listener所配置的那个listener_path目录删掉,再重启listener。关注一下listener的log信息(logs_listener下边)。

三个节点都启动了listener,是不是只在一个节点启动listener就好了?

按照你说的流程进行了操作,删除listener_path,重启listener后,listener所配置的那个listener_path目录没有被创建出来,listener日志显示正常:

I0722 03:02:40.202898 29729 MetaClient.cpp:558] Send request to meta "10.65.101.42":9559
I0722 03:02:40.206521 29729 MetaClient.cpp:2345] Metad last update time: 1626922913084
I0722 03:02:50.216531 29735 MetaClient.cpp:2326] Send heartbeat to "10.65.101.42":9559, clusterId 0
I0722 03:02:50.216661 29730 ThriftClientManager.inl:42] Getting a client to "10.65.101.42":9559
I0722 03:02:50.216696 29730 MetaClient.cpp:558] Send request to meta "10.65.101.42":9559
I0722 03:02:50.220273 29730 MetaClient.cpp:2345] Metad last update time: 1626922913084
I0722 03:03:00.226385 29735 MetaClient.cpp:2326] Send heartbeat to "10.65.101.42":9559, clusterId 0
I0722 03:03:00.226528 29731 ThriftClientManager.inl:42] Getting a client to "10.65.101.42":9559
I0722 03:03:00.226584 29731 MetaClient.cpp:558] Send request to meta "10.65.101.42":9559
I0722 03:03:00.229501 29731 MetaClient.cpp:2345] Metad last update time: 1626922913084

listener都是offline状态的?

对,都是offline状态,怎么解决?

找到问题了,原来ADD LISTENER ELASTICSEARCH这里配置的端口号,得是listener的端口号

该话题在最后一个回复创建后7天后自动关闭。不再允许新的回复。