今天安装ElasticSearch试试看。
一、下载JDK,配置JDK环境
yum list java* yum install java-1.8.0-openjdk*
接着找它 rpm -qa | grep java rpm -ql java-1.8.0-openjdk-1.8.0.101-3.b13.el6_8.x86_64
下面配置JAVA_HOME环境变量 vim /etc/profile 后面加入以下内容 export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.el6_8.x86_64 export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin :wq退出vim编辑器 然后source /etc/profile就行了
二、下载ElasticSearch
cd /data/software/ wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/rpm/elasticsearch/2.3.2/elasticsearch-2.3.2.rpm
三、安装ElasticSearch
rpm -ivh elasticsearch-2.3.2.rpm
四、设置开机自启动
/sbin/chkconfig --add elasticsearch service elasticsearch start
启动之后,在浏览器输入http://ip:9200/如能输出下列信息,即表示安装成功
{ "name" : "Shooting Star", "cluster_name" : "elasticsearch", "version" : { "number" : "2.3.2", "build_hash" : "b9e4a6acad4008027e4038f6abed7f7dba346f94", "build_timestamp" : "2016-04-21T16:03:47Z", "build_snapshot" : false, "lucene_version" : "5.5.0" }, "tagline" : "You Know, for Search" }
五、安装elasticsearch-head插件
/usr/share/elasticsearch/bin/plugin install mobz/elasticsearch-head
安装完成之后,在浏览器输入:http://ip:9200/_plugin/head/ ,可以查看显示效果
修改配置到
默认路径:etc/elasticsearch/config/elasticsearch.yml #集群名(同一个集群,名称必须相同) cluster.name: my-application #服务节点名(每个服务节点不一样) node.name: node-1 #数据存储路径 path.data: /data/elasticsearch/data #服务日志路径 path.logs: /data/elasticsearch/logs #服务ip地址 network.host: 0.0.0.0 #服务端口 http.port: 9200 默认路径:/etc/sysconfig/elasticsearch #设置为可用内存的50% ES_HEAP_SIZE = 1g #其余参数参考说明进行调优(JVM)