-I use openJdk 1.8
*-Elasticsearch 6.8.1+Logstash 6.8.1+mysql *
*-My file elasticsearch/elasticsearch.yml : *
cluster.name: mamaison
node.name: server1.bonjour
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
action.auto_create_index: true
http.cors.enabled: true
http.cors.allow-origin: "/.*/"
http.cors.allow-methods: OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers: "X-Requested-With,X-Auth-Token,Content-Type, Content-Length, Authorization"
**-My file logstash/config/mamaison.config : **
input {
jdbc{
jdbc_driver_library => "/home/xxxx/driver/mysql-connector-java-8.0.12.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/nom_base"
jdbc_user => "user"
jdbc_password => "xxxx"
schedule => " * * * *"
statement => "SELECT * from mamaison"
}
}
filter{
json{
source => "ville"
target => "ville"
}
json{
source => "region"
target => "region"
}
json{
source => "caracteristique"
target => "caracteristique"
}
json{
source => "type_annonce"
target => "type_annonce"
}
json{
source => "category"
target => "category"
}
json{
source => "quartier"
target => "quartier"
}
json{
source => "user"
target => "user"
}
}
output {
stdout { codec => json_lines }
elasticsearch {
hosts => "199.192.23.237:9200"
index => "mamaison"
document_type => "annonces"
action => 'update'
document_id => '%{id}'
doc_as_upsert => "true"
}
}
The error is in the output elasticsearch. Connection refused but the configuration of elasticsearch is great and listen on this port:
tcp6 0 0 :::9200 :::* LISTEN 18817/java
tcp6 0 0 :::9300 :::* LISTEN 18817/java
- And the service is started :
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: active (running) since lkm 2019-06-27 05:33:14 UTC; 19min ago
Docs: http://www.elastic.co
Main PID: 18817 (java)
CGroup: /system.slice/elasticsearch.service
├─18817 /bin/java -Xms200m -Xmx200m -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Des.networkaddress.ca...
└─18879 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller
jon 27 05:33:14 systemd[1]: Started Elasticsearch.
- It's work with curl 199.192.23.237 :
curl -XGET 199.192.23.237:9200
{
"name" : "server1.bonjour",
"cluster_name" : "mamaison",
"cluster_uuid" : "y09N-Ed4T7Of5fYCOefchg",
"version" : {
"number" : "6.8.1",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "1fad4e1",
"build_date" : "2019-06-18T13:16:52.517138Z",
"build_snapshot" : false,
"lucene_version" : "7.7.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"