1. 先安装jdk

yum search java|grep jdk
查看yum库中都有哪些jdk版本

yum install java-1.8.0-openjdk.x86_64

两次y确认

2. centOS wget的安装和使用

安装:yum install wget

3. 安装 Elasticsearch

Elasticsearch的安装很简单,下载下来解压即可,这里使用wget下载,当然也可通过网页下载 https://www.elastic.co/downloads/elasticsearch ,再拷贝。

(1) wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.3.tar.gz

(2) 解压到/usr/local/

tar -zxvf elasticsearch-5.6.3.tar.gz -C /usr/local/

(3) Elasticsearch 要求不能使用超级用户root运行,所以我们建立一个testuser账号

# 创建testuser账户
adduser testuser
# 修改密码
passwd testuser

给testuser用户elasticsearch目录的授权

chown -R testuser /usr/local/elasticsearch-5.6.3/

切换至elasticsearch目录,并以testuser用户运行

运行elasticsearch,如果想后台运行后面加 -d

Elasticsearch后端启动命令为:./bin/elasticsearch -d

如果没有没有error,就运行成功啦

4. 新开一个终端,用curl访问

curl 'http://localhost:9200/?pretty'

5. vim安装

yum search vim

安装VIM:

yum install vim-enhanced

 

6. 指定ip地址

编辑es的配置文件

[testuser@localhost elasticsearch-5.6.3]$ vim ./config/elasticsearch.yml1

找到network.host: 一行,去除#号,修改为:

network.host: [_local_, 172.30.6.1]1

172.30.6.1为指定的ip地址,可以是多个。

这样就可以在浏览器里打开啦

http://172.30.6.1:9200/?pretty

7. 查看运行状态:

curl http://localhost:9200

安装完后启动服务:
systemctl start elasticsearch.service

8. 安装Elasticsearch head插件

wget  https://github.com/mobz/elasticsearch-head/archive/master.zip

unzip master.zip

9. 安装node

wget https://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.4.7-linux-x64.tar.gz

tar -zxvf node-v4.4.7-linux-x64.tar.gz

vi /etc/profile

export NODE_HOME=/usr/java/head/node
export PATH=$PATH:$NODE_HOME/bin
export NODE_PATH=$NODE_HOME/lib/node_modules

执行 source /etc/profile

10. 安装npm

安装 nodejs:

curl -sL https://rpm.nodesource.com/setup_6.x  |  bash  -

yum install -y nodejs

如果提示你需要安装构建工具 gcc gcc++ 什么的你就安装就行了,安装完了再重新安装 nodejs

命令:node -v 如果输出版本号就安装成功了。

更新 npm

npm install npm@latest -g

命令:npm -v 输出版本号就成功安装了。

【卸载npm:sudo npm uninstall npm -g   ,

卸载nodejs包:yum remove nodejs,

cd 到yum源配置文件夹:cd /etc/yum.repo.d ,删除以 node 开头的源;

清除 yum 缓存 yum clean all 】

11. 安装grunt

whereis elasticsearch

执行后会生成node_modules文件夹

npm install -g grunt-cli

检查是否安装成功

grunt -version

12. 安装netstat

yum install net-tools

13. 先从yum安装git

yum –y install git

14. 下载head

git clone git://github.com/mobz/elasticsearch-head.git

cd elasticsearch-head

npm install
npm run start

启动后会出现连接不上.....
因head运行在9100上,而elasticsearch在9200上,因此需要配置跨越访问。
在 elasticsearch.yml中添加cors允许跨越访问,* 表示允许任何ip进行访问,可改为指定ip:
http.cors.enabled: true
http.cors.allow-origin: "*"

修改head插件源码  修改服务器监听地址:Gruntfile.js

修改连接地址:_site/app.js

运行head

在elasticsearch-head-master目

npm install phantomjs-prebuilt@2.1.16 --ignore-scripts

nohup grunt server &exit

访问http://xxx:9100

添加防火墙:firewall-cmd --zone=public --add-port=9100/tcp --permanent

Centos 7上安装Elasticsearch的更多相关文章

  1. 在Windows上安装Elasticsearch 5.0

    在windows上安装Elasticsearch Elasticsearch可以使用.zip软件包安装在Windows上. elasticsearch-service.bat命令,它将设置Elasti ...

  2. 在CentOS 7上安装.NET Core R2跑Hello World

    前言 在上个月.NET Core出了最新版本预览版,只是在Window系统上试验了一下.原本想等发布正式版的时候在linux系统上试试,可能还需要一段时间,刚好有空可以折腾一下. 由于之前安装的Ubu ...

  3. 如何在 CentOS 7 上安装 Redis 服务器

    大家好,本文的主题是 Redis,我们将要在 CentOS 7 上安装它.编译源代码,安装二进制文件,创建.安装文件.在安装了它的组件之后,我们还会配置 redis ,就像配置操作系统参数一样,目标就 ...

  4. Linux Centos 系统上安装BT客户端 Transmission

    Linux Centos 系统上安装BT客户端 Transmission   Transmission是一种BitTorrent客户端,特点是一个跨平台的后端和其上的简洁的用户界面,以MIT许可证和G ...

  5. 在CentOS 7上安装phpMyAdmin

    原文 在CentOS 7上安装phpMyAdmin phpMyAdmin是一款以PHP为基础,基于Web的MySQL/MariaDB数据库管理工具.虽然已经存在着一些诸如Adminer的轻量级数据库管 ...

  6. 在CentOS 6上安装Apache和PHP

    本文演示如何在CentOS 6上安装Apache和PHP.CentOS 6自带的是Apache 2.2.3和PHP 5.1.6,您可以使用默认的CentOS包管理器进行安装yum.使用yum(而不是使 ...

  7. CentOS Linux上安装Oracle11g笔记

    CentOS Linux上安装Oracle11g 到 otn.oracle.com 网站上下载 Linux版的oracle 11g 编辑 /etc/sysctl.conf : kernel.shmal ...

  8. 在Linux上安装Elasticsearch Kibaba.md

    在Linux上安装Elasticsearch Kibaba Kibana是一个开源为elasticsearch 引擎提供数据和数据分析 1.下载安装 切换到root账户,按顺序依次执行以下命令 rpm ...

  9. 在Linux上安装Elasticsearch Head工具.md

    在Linux上安装Elasticsearch Head工具 1.修改elasticsearch的参数 编辑elasticsearch的配置文件elasticsearch.yml $ vim /data ...

随机推荐

  1. AS3面试题 个人理解

    现在as3面试 感觉就那几个题目来回考.有了题库,大家都看了 都答上来了 题目本身也就失去了考核的意义.而且题目本身也有很多偏的(不常用的)在考. 真正的面试官现在肯定也不会把笔试成绩当作标准.所谓: ...

  2. svn 被锁住 冲突 Can't revert without reverting children

    解决 执行以下命令 D:\development\work>svn rm –-keep-local D:\development\work\ohho\common\logic\backstage ...

  3. Null hypothesis TypeⅠerror Type Ⅱ error

    Null hypothesis usually express the phenomenon of no effect or no difference. TypeⅠerror is the inco ...

  4. [转]截图软件分享 - Snipaste

    http://chromecj.com/software/2018-10/1538.html https://zh.snipaste.com/download.html

  5. [转][C#]HttpClient 代码示例

    转自:https://www.cnblogs.com/amosli/p/3918538.html 也参考了:https://www.cnblogs.com/ShadowFiend007/p/80668 ...

  6. 描述wxWidgets中事件处理的类型转化

    wxWidgets是一个比较常用的UI界面库,我曾经试着使用wxWidgets写一个UI编辑工具,在此期间,学习了一些wxWidgets的知识.我对wxWidgets的绑定(Bind)比较好奇,想知道 ...

  7. Mysql 之闪回技术 binlog2sql

    1.下载 https://github.com/danfengcao/binlog2sql http://rpmfind.net Search: python-pip pip 是一个Python包管理 ...

  8. SAS DATA ENCODING 解决odbc乱码问题

    首先获取编码格式: %PUT %SYSFUNC(getOption(ENCODING)); libname findoout ODBC datasrc=SurveyReport user=shendu ...

  9. servlet和jsp概述

    1.servlet的作用 B/S系统:浏览器/服务器(Servlet的服务模式) Servlet是运行在web服务器或应用服务器上的java程序,它是一个中间层,负责连接来自web浏览器或其它HTTP ...

  10. Java - 20 Java 继承

    Java 继承 继承是java面向对象编程技术的一块基石,因为它允许创建分等级层次的类.继承可以理解为一个对象从另一个对象获取属性的过程. 如果类A是类B的父类,而类B是类C的父类,我们也称C是A的子 ...