- exportJAVA_HOME=/usr/java/jdk1.7.0_71exportJRE_HOME=$JAVA_HOME/jreexportCLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
- exportPATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
- bootstrap.mlockall:true
- index.number_of_shards:1
- index.number_of_replicas:0
- #index.translog.flush_threshold_ops: 100000
- #index.refresh_interval: -1
- index.translog.flush_threshold_ops: 5000
- index.refresh_interval: 1
- network.bind_host: 172.16.18.114
- #节点间通讯公布到其他节点的IP地址
- #假设不设置由ES自己决定它可能会发现一个地址。可是其他节点可能訪问不了,这样节点间通讯将失败
- network.publish_host: 172.16.18.114
- # Security 同意全部http请求
- http.cors.enabled:true
- http.cors.allow-origin:"/.*/"
- # 使jvm使用os。max-open-fileses_parms="-Delasticsearch -Des.max-open-files=ture"
- # Start up the service
- # 改动OS打开最大文件数ulimit -n1000000ulimit-lunlimited
- launch_service"$pidfile" "$daemonized" "$properties"
- ......if["x$ES_MIN_MEM"="x"];thenES_MIN_MEM=256mfi
- if["x$ES_MAX_MEM"="x"];thenES_MAX_MEM=1gfi
- if["x$ES_HEAP_SIZE"!="x"];thenES_MIN_MEM=$ES_HEAP_SIZEES_MAX_MEM=$ES_HEAP_SIZE
- fi
- #set min memory as 2gES_MIN_MEM=2g#set max memory as 2gES_MAX_MEM=2g
- ......
- {"cluster_name":"elasticsearch","nodes": {"7PEaZbvxToCL2O2KuMGRYQ": {"name":"Gertrude Yorkes","transport_address":"inet[/172.16.18.116:9300]","host":"casimbak","ip":"172.16.18.116","version":"1.4.4","build":"c88f77f","http_address":"inet[/172.16.18.116:9200]","settings": {"index": {"number_of_replicas":"0","translog": {"flush_threshold_ops":"5000"},"number_of_shards":"1","refresh_interval":"1"},"path": {"logs":"/home/jfy/soft/elasticsearch-1.4.4/logs","home":"/home/jfy/soft/elasticsearch-1.4.4"},"cluster": {"name":"elasticsearch"},"bootstrap": {"mlockall":"true"},"client": {"type":"node"},"http": {"cors": {"enabled":"true","allow-origin":"/.*/"}
- },"foreground":"yes","name":"Gertrude Yorkes","max-open-files":"ture"},"process": {"refresh_interval_in_millis":1000,"id":13896,"max_file_descriptors":1000000,"mlockall": true
- },...}
- }
- }
- "index": {
- "number_of_replicas": "0",
- "translog": {
- "flush_threshold_ops": "5000"
- },
- "number_of_shards": "1",
- "refresh_interval": "1"
- },
- "process": {
- "refresh_interval_in_millis": 1000,
- "id": 13896,
- "max_file_descriptors": 1000000,
- "mlockall": true
- },
- input {#file {
- # type => "mysql_log"
- # path => "/usr/local/mysql/data/localhost.log"
- # codec => plain{
- # charset => "GBK"
- # }
- #}file {
- type =>"hostapd_log"path =>"/root/hostapd/hostapd.log"sincedb_path =>"/home/jfy/soft/logstash-1.4.2/sincedb_hostapd.access"
- #start_position => "beginning"
- #http://logstash.net/docs/1.4.2/codecs/plaincodec => plain{
- charset =>"GBK"}
- }
- file {
- type =>"hkt_log"path =>"/usr1/app/log/bsapp.tr"sincedb_path =>"/home/jfy/soft/logstash-1.4.2/sincedb_hkt.access"start_position =>"beginning"codec => plain{
- charset =>"GBK"}
- }# stdin {
- # type => "hostapd_log"
- # }}#filter {
- # grep {
- # match => [ "@message", "mysql|GET|error" ]
- # }
- #}output {
- redis {
- host =>'172.16.18.116'data_type =>'list'key =>'logstash:redis'
- # codec => plain{
- # charset => "UTF-8"
- # }}# elasticsearch {
- # #embedded => true
- # host => "172.16.18.116"
- # }}
- input {
- redis {
- host =>'127.0.0.1'data_type =>'list'key =>'logstash:redis'
- #threads => 10
- #batch_count => 1000}
- }
- output {
- elasticsearch {#embedded => truehost => localhost#workers => 10}
- }
- 假设kibana与elasticsearch不在同一机器则改动:
- elasticsearch:"http://192.168.91.128:9200",#这里实际上是浏览器直接訪问该地址连接elasticsearch否则默认。一定不要改动
假设出现 connection failed,则改动 elasticsearch/config/elasticsearch.yml。添加:
- http.cors.enabled:true
- http.cors.allow-origin:"/.*/"
详细含义參见: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-http.html
来源: http://www.bubuko.com/infodetail-2119390.html