带有postgres的Ubuntu上SphinxQL的问题

问题描述 投票:0回答:1

[我想在Ubuntu 18.04和postgres 10的服务器上配置sphinxsearch。我使用此tut:

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-sphinx-on-ubuntu-16-04

我的sphinx_conf:

source src1
{
  type          = pgsql

  sql_host      = localhost
  sql_user      = postgres
  sql_pass      = my_pass
  sql_db        = test
  sql_port      = 2000

  sql_query     = \
  SELECT id, group_id, (date_added::TIMESTAMP) AS date_added, title, content \
  FROM documents

  sql_attr_uint         = group_id
  sql_attr_timestamp    = date_added
}
index test1
{
  source            = src1
  path              = /var/lib/sphinxsearch/data/test1
  docinfo           = extern
}
searchd
{
  listen            = 9312:pgsql2000
  listen            = 2000:sphinx
  log               = /var/log/sphinxsearch/searchd.log
  query_log         = /var/log/sphinxsearch/query.log
  read_timeout      = 5
  max_children      = 30
  pid_file          = /var/run/sphinxsearch/searchd.pid
  seamless_rotate   = 1
  preopen_indexes   = 1
  unlink_old        = 1
  binlog_path       = /var/lib/sphinxsearch/data
}

当我尝试在端口2000上运行psql时

psql --port 9312 -h0

我得到:

'Connection refused'.

Postgres_conf:

...
listen_addresses = '*'
port = 2000
...

有人处理吗?可以用postgres运行sphinx吗?

postgresql ubuntu sphinx
1个回答
0
投票
  listen            = 9312:pgsql2000

是错误的。 Sphinx不提供Postgres接口。将pgsql2000更改为mysql41并使用mysql客户端连接到它,而不是psql。

由于您的目标似乎是通过Postgres的Sphinx进行索引,所以我可以推荐此交互式教程https://play.manticoresearch.com/mysql/,它是有关Manticore Search / Sphinx从MySQL进行索引的,但是应该为您提供动手实践和对其工作方式的理解。之后,只需在源中将类型从“ mysql”更改为“ pgsql”应该很容易,并且应该相同。

© www.soinside.com 2019 - 2024. All rights reserved.