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. SQL优化系列——子查询

    sql调优方法: (1)not in子查询优化 尽量避免子查询select * from a where id not in(select id from b); select * from a wh ...

  2. PAT 乙级 1066 图像过滤(15) C++版

    1066. 图像过滤(15) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 图像过滤是把图像中不重要的像素都染成 ...

  3. Flink安装启动

    1.下载安装包并解压 下载网址:https://flink.apache.org/ 版本选择可以根据安装的hadoop版本和Scala版本进行选择 我用的是:flink-1.3.3-bin-hadoo ...

  4. python浅copy和深copy

    import   copy person =["name",[count,3000]] husband=copy.copy(person) wife=copy.copy(perso ...

  5. mysql数据库数据备份与恢复

    备份数据: C:\Users\Administrator>mysqldump -uroot --password -v test01 test02 >e:\temp\\a3.sql Ent ...

  6. Kaptcha

    Kaptcha:google自动生成验证码组件 kaptcha的使用比较方便,只需添加jar包依赖之后简单地配置就可以使用了 kaptcha所有配置都可以通过web.xml来完成,如果你的项目中使用了 ...

  7. (转)Intellij IDEA 快捷键整理

    [常规] Ctrl+Shift + Enter,语句完成 “!”,否定完成,输入表达式时按 “!”键 Ctrl+E,最近的文件 Ctrl+Shift+E,最近更改的文件 Shift+Click,可以关 ...

  8. Android 硬编码

    public class TextViewActivity extends Activity { // 声明TextView对象 private TextView textView; @Overrid ...

  9. Visual Studio 2012 & MyEclipse2015 快捷键对比

  10. Android悬浮框,在Service中打开悬浮窗;在Service中打开Dialog;

    文章介绍了如何在Service中显示悬浮框,在Service中弹出Dialog,在Service中做耗时的轮询操作: 背景需求: 公司的项目现在的逻辑是这样的:发送一个指令,然后3秒一次轮询去查询这个 ...