flowpack/elasticsearch-contentrepositoryqueueindexer

基于作业队列的Neos CMS Elasticsearch索引器

5.2.2 2022-05-29 13:13 UTC

README

Latest Stable Version Total Downloads

此包可用于索引Elasticsearch中的大量节点。此包使用Flowpack JobQueue包异步处理索引。

主题

安装和配置

您需要根据需要安装正确的队列包。

可用包

请查看包文档以获取特定配置。

默认配置使用由JobQueue.Common包提供的FakeQueue,请注意,使用该包时,作业与flow nodeindexqueue:build命令同步执行。

检查Settings.yaml以根据队列包进行调整,您需要调整className

Flowpack:
  JobQueue:
    Common:
      presets:
        'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer':
          className: 'Flowpack\JobQueue\Common\Queue\FakeQueue'

如果您使用doctrine包,您必须手动设置tableName

Flowpack:
  JobQueue:
    Common:
      presets:
        'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer':
          className: 'Flowpack\JobQueue\Doctrine\Queue\DoctrineQueue'
      queues:
        'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer':
          options:
            tableName: 'flowpack_jobqueue_QueueIndexer'
        'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer.Live':
          options:
            tableName: 'flowpack_jobqueue_QueueIndexerLive'

索引

批量索引

如何构建索引作业

flow nodeindexqueue:build --workspace live

如何处理索引作业

您可以使用此CLI命令处理索引作业

flow nodeindexqueue:work --queue batch

实时索引

您可以通过编辑Settings.yaml禁用异步实时索引

Flowpack:
  ElasticSearch:
    ContentRepositoryQueueIndexer:
      enableLiveAsyncIndexing: false

您可以使用此CLI命令处理索引作业

flow nodeindexqueue:work --queue live

Supervisord配置

您可以使用像supervisord这样的工具来管理长时间运行的进程。下面是一个基本配置

[supervisord]

[supervisorctl]

[program:elasticsearch_batch_indexing]
command=php flow nodeindexqueue:work --queue batch
stdout_logfile=AUTO
stderr_logfile=AUTO
numprocs=4
process_name=elasticsearch_batch_indexing_%(process_num)02d
environment=FLOW_CONTEXT="Production"
autostart=true
autorestart=true
stopsignal=QUIT

[program:elasticsearch_live_indexing]
command=php flow nodeindexqueue:work --queue live
stdout_logfile=AUTO
stderr_logfile=AUTO
numprocs=4
process_name=elasticsearch_live_indexing_%(process_num)02d
environment=FLOW_CONTEXT="Production"
autostart=true
autorestart=true
stopsignal=QUIT

更新说明

升级到3.0后的破坏性更改

  • 以前,Beanstalk队列包默认安装,现在不再是这种情况。

升级到5.0后的破坏性更改

  • 移除了beanstalk队列配置。如果没有配置为其他队列包,则使用FakeQueue。

许可

许可协议为MIT,请参阅LICENSE