FOSElasticaBundle icon indicating copy to clipboard operation
FOSElasticaBundle copied to clipboard

FOSElasticaBundle- command (php bin/console fos:elastica:populate) do not work correctly. To do this, you need to create a fos_elastica.yaml or config.yml file?

Open vasyaShum opened this issue 2 years ago • 0 comments

Sorry for my English ...

File config\bundles.php

<?php
return [
    ...
    FOS\ElasticaBundle\FOSElasticaBundle::class => ['all' => true],
];

File docker-compose.override.yml

services:
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.17.14
    container_name: es01
    environment:
      - node.name=es01
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es02,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data01:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - elastic
  es02:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.17.14
    container_name: es02
    environment:
      - node.name=es02
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data02:/usr/share/elasticsearch/data
    networks:
      - elastic
  es03:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.17.14
    container_name: es03
    environment:
      - node.name=es03
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es02
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data03:/usr/share/elasticsearch/data
    networks:
      - elastic

volumes:
  data01:
    driver: local
  data02:
    driver: local
  data03:
    driver: local

networks:
  elastic:
    driver: bridge

I did everything according to this instruction : (Link)

Results now:

  • the container works (http://localhost:9200 returns result = "tagline" : "You Know, for Search")

Problems:

  • commands php bin/console fos:elastica:populate , php bin/console fos:elastica:create do not start They give an error...

Questions:

  1. Which file, you need to create a config/packages/fos_elastica.yaml or config/config.yml ?
  2. if you do as it says in the GitHub documentation (with the creation of config), then the fos command gives an error ( There are no commands defined in the "fos:elastica" namespace.)

Please help, I can't find answers for several days ...

vasyaShum avatar Oct 18 '23 10:10 vasyaShum