Proxy 尝试将Logstash配置为使用带有LS#u JAVA#u选项的代理,但它没有';好像不行
Elastic正在Azure中的Windows Server 2012 R2虚拟机上运行。 VM1:使用Windows Server 2012 R2在我的工作站上以Hyper-V运行。无代理 VM2:使用Windows Server 2012 R2在受保护域中安装;需要代理 我的日志存储配置(My.config)具有以下输出定义:Proxy 尝试将Logstash配置为使用带有LS#u JAVA#u选项的代理,但它没有';好像不行,proxy,logstash,Proxy,Logstash,Elastic正在Azure中的Windows Server 2012 R2虚拟机上运行。 VM1:使用Windows Server 2012 R2在我的工作站上以Hyper-V运行。无代理 VM2:使用Windows Server 2012 R2在受保护域中安装;需要代理 我的日志存储配置(My.config)具有以下输出定义: elasticsearch { host => "myhost.cloudapp.net" cluster => "mycluster
elasticsearch
{
host => "myhost.cloudapp.net"
cluster => "mycluster"
document_type => "%{type}"
index => "%{index}_%{+YYYY.MM.dd}"
template_name => "%{index}"
document_id => "%{id}"
protocol => "http"
}
VM1可以很好地将数据加载到弹性搜索主机中
我从VM1压缩了logstash文件夹,并将其复制到VM2中,然后将其解压缩。然后我创建了一个start.bat文件,该文件放在\logstash\bin中
cls
SET JAVA_HOME=D:\JDK
SET LS_JAVA_OPTS=-Dhttp.proxyHost=myproxy.mydomain.com -Dhttp.proxyPort=8080
logstash.bat agent -f my.conf
在VM2上运行此命令时,在命令提示窗口中生成以下命令:
io/console not supported; tty will not be manipulated
Failed to install template: connect timed out {:level=>:error}
Logstash startup completed
Got error to send bulk of actions: connect timed out {:level=>:error}
Failed to flush outgoing items {:outgoing_count=>1, :exception=>#<Manticore::Timeout: connect timed out>,
:backtrace=>["D:/LogStash/vendor/bundle/jruby/1.9/gems/manticore-0.4.1-java/lib/manticore/response.rb:35:in `initialize'",
"org/jruby/RubyProc.java:271:in `call'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/manticore-0.4.1-java/lib/manticore/response.rb:61:in `call'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/manticore-0.4.1-java/lib/manticore/response.rb:225:in `call_once'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/manticore-0.4.1-java/lib/manticore/response.rb:128:in `code'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.12/lib/elasticsearch/transport/transport/http/manticore.rb:71:in `perform_request'",
"org/jruby/RubyProc.java:271:in `call'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.12/lib/elasticsearch/transport/transport/base.rb:190:in `perform_request'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.12/lib/elasticsearch/transport/transport/http/manticore.rb:54:in `perform_request'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.12/lib/elasticsearch/transport/client.rb:119:in `perform_request'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/elasticsearch-api-1.0.12/lib/elasticsearch/api/actions/bulk.rb:80:in `bulk'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-1.0.1-java/lib/logstash/outputs/elasticsearch/protocol.rb:103:in `bulk'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-1.0.1-java/lib/logstash/outputs/elasticsearch.rb:505:in `submit'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-1.0.1-java/lib/logstash/outputs/elasticsearch.rb:529:in `flush'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/stud-0.0.20/lib/stud/buffer.rb:219:in `buffer_flush'",
"org/jruby/RubyHash.java:1341:in `each'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/stud-0.0.20/lib/stud/buffer.rb:216:in `buffer_flush'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/stud-0.0.20/lib/stud/buffer.rb:112:in `buffer_initialize'",
"org/jruby/RubyKernel.java:1511:in `loop'",
"D:/LogStash/vendor/bundle/jruby/1.9/gems/stud-0.0.20/lib/stud/buffer.rb:110:in `buffer_initialize'"], :level=>:warn}
我得到的错误是(只复制了下面的异常消息)
任何帮助都将不胜感激。请尝试:输出{ 弹性搜索{ index=>“%{index}{+YYYY.MM.dd}” 主机=>“myhost.cloudapp.net” 端口=>“9200” 协议=>http 空闲\u刷新\u时间=>1 冲洗尺寸=>5000 }
}与elastic search和a的好心人交谈,他们确认LogStash目前不支持转发代理。但是,已提出新的请求以添加此功能()
他们建议同时使用反向代理(如果可能)。找到JVM监视器,并验证在设置LS_JAVA_OPTS时,值没有附加到VM参数。我现在在start.bat中设置JAVA_OPTS变量。使用JVM监视器,我的“VM Arguments”系统变量包含我的代理信息。这似乎没有任何效果。
http
{
http_method => "post"
url => "http://myhost.cloudapp.net/myindex/mytype"
}
:response=>nil, :exception=>#<Errno::EBADF: Bad file descriptor - Bad file descriptor>
GET http://myhost.cloudapp.net:9200/_cat/indices?_=1436330129174 HTTP/1.1
Referer: http://myhost.cloudapp.net:9200/_plugin/marvel/sense/index.html
Accept: text/plain, */*; q=0.01
Accept-Language: en-US
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
Host: xirtes.cloudapp.net:9200
Proxy-Connection: Keep-Alive