我使用的是Amazon Elasticsearch Service 2.3.4和Logstash 2.3.0。
我的配置
input {
jdbc {
# Postgres jdbc connection string to our database, mydb
jdbc_connection_string => "jdbc:mysql://awsmigration.XXXXXXXXX.ap-southeast-1.rds.amazonaws.com:3306/admin?zeroDateTimeBehavior=convertToNull"
# The user we wish to execute our statement as
jdbc_user => "dryrun"
jdbc_password => "dryruntesting"
# The path to our downloaded jdbc driver
jdbc_driver_library => "/opt/logstash/drivers/mysql-connector-java-5.1.39/mysql-connector-java-5.1.39-bin.jar"
# The name of the driver class for Postgresql
jdbc_driver_class => "com.mysql.jdbc.Driver"
# our query
statement => "SELECT * from Receipt"
jdbc_paging_enabled => true
jdbc_page_size => 200
}
}
output {
elasticsearch {
index => "slurp_receipt"
document_type => "Receipt"
document_id => "%{uid}"
hosts => ["https://search-XXXXXXXXXXXX.ap-southeast-1.es.amazonaws.com:443"]
aws_access_key_id => 'XXXXXXXXXXXXXXXXX'
aws_secret_access_key => 'XXXXXXXXXXXXXXX'
}
}
我收到了这个错误:
Fri Aug 26 07:30:13 UTC 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Unknown setting 'aws_access_key_id' for elasticsearch {:level=>:error}
Unknown setting 'aws_secret_access_key' for elasticsearch {:level=>:error}
Pipeline aborted due to error {:exception=>#<LogStash::ConfigurationError: Something is wrong with your configuration.>, :backtrace=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/config/mixin.rb:134:in `config_init'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/outputs/base.rb:63:in `initialize'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/output_delegator.rb:74:in `register'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/pipeline.rb:181:in `start_workers'", "org/jruby/RubyArray.java:1613:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/pipeline.rb:181:in `start_workers'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/pipeline.rb:136:in `run'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/agent.rb:473:in `start_pipeline'"], :level=>:error}
如何解决?
答案 0 :(得分:2)
假设您使用的是amazon_es插件,您的输出应如下所示:
output {
amazon_es {
index => "slurp_receipt"
hosts => ["https://search-XXXXXXXXXXXX.ap-southeast-1.es.amazonaws.com:443"]
aws_access_key_id => 'XXXXXXXXXXXXXXXXX'
aws_secret_access_key => 'XXXXXXXXXXXXXXX'
}
}
答案 1 :(得分:1)
aws_access_key_id
和aws_secret_access_key
不是Logstash elasticsearch插件的有效配置选项。
cf documentation