然后编辑ES的配置文件:
vi config/elasticsearch.yml
修改以下配置项:
cluster.name=es_cluster node.name=node0 path.data=/tmp/elasticsearch/data path.logs=/tmp/elasticsearch/logs #当前hostname或IP,我这里是centos2 network.host=centos2 network.port=9200
./elasticsearch -d -p pidfile
./elasticsearch --cluster.name my_cluster_name --node.name my_node_name
./bin/plugin install mobz/elasticsearch-head
tar -zxvf logstash-2.1.1.tar.gz cd logstash-2.1.1
编写配置文件(名字和位置可以随意,这里我放在config目录下,取名为log4j_to_es.conf):
mkdir config vi config/file_to_es.conf
# For detail structure of this file # Set: