elasticsearch安装教程
运行环境如下Centos 6.4
elasticsearch1.7.2
jdk-7u67-linux-x64.rpm
一、检查当前操作系统的版本
# hostname //查看当前的主机名称
es
# uname -m //查看系统是多少位
x86_64
# uname -r //查看内核版本
2.6.32-358.el6.x86_64
# cat /etc/redhat-release //查看Centos 版本号
CentOS release 6.4 (Final)
#
二、安装JDK环境(jdk-7u67-linux-x64.rpm)
# rpm -ivh jdk-7u67-linux-x64.rpm
Preparing... ###########################################
1:jdk ###########################################
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
jfxrt.jar... 配置环境变量 vi /etc/profile在这个文件的最后添加上配置
#set java environment
JAVA_HOME=/usr/java/jdk1.7.0_67
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH 立刻让环境变量配置文件生效
#
# source /etc/profile //这两种生效方法 你用哪种都可以的
#
# . /etc/profile
# 测试一下环境变量是否成功安装
# java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode) JDK安装完毕......
三、安装 elasticsearch1.7.2 软件
# pwd
/usr/local/elasticsearch-1.7.2
# ll
total 40
drwxr-xr-x. 2 root root4096 Mar 17 22:49 bin
drwxr-xr-x. 2 root root4096 Mar 17 22:49 config
drwxr-xr-x. 3 root root4096 Mar 17 22:49 lib
-rw-rw-r--. 1 root root 11358 Sep 142015 LICENSE.txt
-rw-rw-r--. 1 root root 150 Sep 142015 NOTICE.txt
-rw-rw-r--. 1 root root8700 Sep 142015 README.textile
启动 elasticsearch
# pwd
/usr/local/elasticsearch-1.7.2/bin
# ll
total 324
-rwxr-xr-x. 1 root root 8114 Sep 142015 elasticsearch
-rw-rw-r--. 1 root root 901 Sep 142015 elasticsearch.bat
-rw-rw-r--. 1 root root 2797 Sep 142015 elasticsearch.in.bat
-rwxr-xr-x. 1 root root 2170 Sep 142015 elasticsearch.in.sh
-rw-rw-r--. 1 root root 104448 Sep 142015 elasticsearch-service-mgr.exe
-rw-rw-r--. 1 root root 103936 Sep 142015 elasticsearch-service-x64.exe
-rw-rw-r--. 1 root root80896 Sep 142015 elasticsearch-service-x86.exe
-rwxr-xr-x. 1 root root 2523 Sep 142015 plugin
-rw-rw-r--. 1 root root 482 Sep 142015 plugin.bat
-rw-rw-r--. 1 root root 6210 Sep 142015 service.bat
# /bin/sh ./elasticsearch //启动了....
开始进入测试了....
克隆一个SecureCRT 会话选项来关闭防火墙设置
# /etc/init.d/iptables stop
iptables: Flushing firewall rules:
iptables: Setting chains to policy ACCEPT: filter
iptables: Unloading modules: 关闭之后 在浏览器上面输入地址: http://172.16.10.100:9200/
http://s2.运维网.com/wyfs02/M02/7D/8A/wKiom1bqVYbSOJJZAABtBuAbsz8153.png
成功安装.....
四、我们要配置成开自启动服务
到这里把软件下载:https://github.com/elastic/elasticsearch-servicewrapper
并上传服务器上面去
# pwd
/usr/local/src
# unzip elasticsearch-servicewrapper-master.zip//解压软件
# ll
total 153708
-rw-r--r--. 1 root root28478292 Dec 29 10:47 elasticsearch-1.7.2.tar.gz
drwxr-xr-x. 3 root root 4096 Feb 14 03:02 elasticsearch-servicewrapper-master
-rw-r--r--. 1 root root 2054227 Mar 17 14:10 elasticsearch-servicewrapper-master.zip
-rw-r--r--. 1 root root 126857158 Dec 21 17:09 jdk-7u67-linux-x64.rpm
# mv elasticsearch-servicewrapper-master/service/ /usr/local/elasticsearch-1.7.2/bin/
#//将service目录移动到 elasticsearch下面的bin目录下面去
# pwd
/usr/local/elasticsearch-1.7.2/bin/service
# ./elasticsearch
Usage: ./elasticsearch [ console | start | stop.... ]
Commands:
console Launch in the current console.
start Start in the background as a daemon process.
stop Stop if running as a daemon or in another console.
restart Stop if running and then start.
condrestartRestart only if already running.
status Query the current status.
install Install to start automatically when system boots.
remove Uninstall.
dump Request a Java thread dump if running.
开始安装服务
# ./elasticsearch install //开始安装
Detected RHEL or Fedora:
Installing the Elasticsearch daemon..# /etc/init.d/elasticsearch status//查看运行状态
Elasticsearch is not running.
# chkconfig --list elasticsearch
elasticsearch 0:off 1:off 2:on 3:on 4:on 5:on 6:off
========================
配置OK....恭喜你
页:
[1]