1.logstash Import script :

loginfo.conf

input {
    jdbc {
      jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/commondb"
      jdbc_user => "root"
      jdbc_password => "123456"
      jdbc_driver_library => "/data/logstash/mysql-connector-java-5.1.46.jar"
      jdbc_driver_class => "com.mysql.jdbc.Driver"
      jdbc_paging_enabled => "true"
      jdbc_page_size => "50000"
      statement_filepath => "/data/logstash/test.sql"
      lowercase_column_names => false
     # schedule => "* * * * *"
      type => "loginfo"
    }
}

output {
    if[type] == "loginfo"{
        elasticsearch {
        hosts  => "127.0.0.1:9200"
        index => "loginfo"
        document_type => "info"
        document_id => "%{id}"
        }
    }

    #  Console output content 
    stdout {
        codec => json_lines
    }
}

perform ./bin/logstash -f loginfo.conf;

ES appear :

terms of settlement :

Modify the number of index copies after creation :

curl -X PUT "http://localhost:9200/loginfo/_settings?pretty" -H 'Content-Type: application/json' -d '{"index":{"number_of_replicas":0}}'