在 Cassandra Enterprise (DSE) 中创建搜索索引时出错

Error When Creating Search Index in Cassandra Enterprise (DSE)

我正在尝试在 DSE 6.8 中的 table 上创建搜索索引。这是我在测试键空间中的 table:

CREATE TABLE users (
   username text,
   first_name text,
   last_name text,
   password text,
   email text,
   last_access timeuuid,
   PRIMARY KEY(username));

我试过这个查询:

CREATE SEARCH INDEX ON test.users;

这是回复:

InvalidRequest: Error from server: code=2200 [Invalid query] message="Search statements are not supported on this node"

我认为我应该在某些文件中更改某些内容以使 DSE 支持搜索语句。我已经将 /etc/default/dse 中的 SOLR_ENABLED 设置为 1。我对此完全陌生,我不知道我的 table 是否有问题。

任何人都可以提出可能导致此错误的原因吗?提前致谢。

如错误消息所示,您只能 create a Search index 在搜索模式下的 DSE 节点 运行 上。

通过运行下面的命令检查节点的工作负载。它会告诉你节点是 运行 纯 Cassandra 模式还是搜索模式。

$ dsetool status

如果您安装了带有 -s 标志的 DSE using the binary tarball, it doesn't use /etc/default/dse. Instead start DSE as a standalone process 以在搜索模式下启动它:

$ dse cassandra -s

干杯!