Logstash mysql

Hi, i’ve the same problem. Logstash can’t load data from mysql db to elasticsearch.

I use docker.

Thanks for your help

Welcome!

The same problem of what?

What is the problem?

Thank you very much.
I have configured elasticsearch, written my docker-compose.yml and installed Dockerfile. When I launch the app with docker-compose up -d. The mysql database is not imported into elasticsearch.
I send you my docker-compose and Dockerfile.

  logging:
        driver: "json-file"
        options:
            max-size: "10k"
            max-file: "10"
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.9.3
    container_name: elasticsearch
    # restart: on-failure
    environment:
      - discovery.type=single-node
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
    ports:
      - '9201:9200'
      - '9301:9300'
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - ./volumes/elasticsearch:/usr/share/elasticsearch/data
    logging:
        driver: "json-file"
        options:
            max-size: "10k"
            max-file: "10"

  phpmyadmin:
    image: phpmyadmin/phpmyadmin:latest
    restart: always
    environment:
      PMA_HOST: w_mysql
      PMA_PORT: 3306
    ports:
      - 8080:80
  logstash:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: logstash
    # restart: on-failure
    depends_on:
      - w_mysql
      - elasticsearch
    ports:
      - '9600:9600'
    volumes:
      - ./volumes/logstash/pipeline/:/usr/share/logstash/pipeline/
      - ./volumes/logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml
      - ./volumes/logstash/config/pipelines.yml:/usr/share/logstash/config/pipelines.yml
      - ./volumes/logstash/config/queries/:/usr/share/logstash/config/queries/
    logging:
      driver: "json-file"
      options:
        max-size: "10k"
        max-file: "10"
  kibana:
    image: docker.elastic.co/kibana/kibana:7.9.3
    container_name: kibana
    environment:
      - "ELASTICSEARCH_URL=http://elasticsearch:9200"
      - "SERVER_NAME=127.0.0.1"
    ports:
      - 5601:5601
    depends_on:
      - elasticsearch

#Dockerfile#
  GNU nano 6.2                                                                                                                       Dockerfile
FROM docker.elastic.co/logstash/logstash:7.9.3

type or paste code here

  GNU nano 6.2                                                                                                                       Dockerfile
FROM docker.elastic.co/logstash/logstash:7.9.3

# Download JDBC connector for Logstash
RUN curl -L --output "mysql-connector-java-8.0.22.tar.gz" "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.22.tar.gz" \
    && tar -xf "mysql-connector-java-8.0.22.tar.gz" "mysql-connector-java-8.0.22/mysql-connector-java-8.0.22.jar" \
    && mv "mysql-connector-java-8.0.22/mysql-connector-java-8.0.22.jar" "mysql-connector-java-8.0.22.jar" \
    && rm -r "mysql-connector-java-8.0.22" "mysql-connector-java-8.0.22.tar.gz"

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.