Centos 7上安装Elasticsearch
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的更多相关文章
- 在Windows上安装Elasticsearch 5.0
在windows上安装Elasticsearch Elasticsearch可以使用.zip软件包安装在Windows上. elasticsearch-service.bat命令,它将设置Elasti ...
- 在CentOS 7上安装.NET Core R2跑Hello World
前言 在上个月.NET Core出了最新版本预览版,只是在Window系统上试验了一下.原本想等发布正式版的时候在linux系统上试试,可能还需要一段时间,刚好有空可以折腾一下. 由于之前安装的Ubu ...
- 如何在 CentOS 7 上安装 Redis 服务器
大家好,本文的主题是 Redis,我们将要在 CentOS 7 上安装它.编译源代码,安装二进制文件,创建.安装文件.在安装了它的组件之后,我们还会配置 redis ,就像配置操作系统参数一样,目标就 ...
- Linux Centos 系统上安装BT客户端 Transmission
Linux Centos 系统上安装BT客户端 Transmission Transmission是一种BitTorrent客户端,特点是一个跨平台的后端和其上的简洁的用户界面,以MIT许可证和G ...
- 在CentOS 7上安装phpMyAdmin
原文 在CentOS 7上安装phpMyAdmin phpMyAdmin是一款以PHP为基础,基于Web的MySQL/MariaDB数据库管理工具.虽然已经存在着一些诸如Adminer的轻量级数据库管 ...
- 在CentOS 6上安装Apache和PHP
本文演示如何在CentOS 6上安装Apache和PHP.CentOS 6自带的是Apache 2.2.3和PHP 5.1.6,您可以使用默认的CentOS包管理器进行安装yum.使用yum(而不是使 ...
- CentOS Linux上安装Oracle11g笔记
CentOS Linux上安装Oracle11g 到 otn.oracle.com 网站上下载 Linux版的oracle 11g 编辑 /etc/sysctl.conf : kernel.shmal ...
- 在Linux上安装Elasticsearch Kibaba.md
在Linux上安装Elasticsearch Kibaba Kibana是一个开源为elasticsearch 引擎提供数据和数据分析 1.下载安装 切换到root账户,按顺序依次执行以下命令 rpm ...
- 在Linux上安装Elasticsearch Head工具.md
在Linux上安装Elasticsearch Head工具 1.修改elasticsearch的参数 编辑elasticsearch的配置文件elasticsearch.yml $ vim /data ...
随机推荐
- document.location.search 的作用
document.location.search 的作用 document.location.search 比如一个URL是XXXX?g=1,那么document.location.search的值就 ...
- header头参数不能带下划线
header头参数不能带下划线:game_id是错误的
- Android知识点textview加横线的属性
textView.getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG ); //下划线 textView.getPaint().setAntiAlias(tr ...
- vue 创建单文件组件 注册组件 以及组件的使用
<template> <div id="app"> <v-home></v-home> <hr > <br> ...
- Postgresql 珍藏级文章
https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server 如何设置参数值 https://www.cnblogs.com/zhao ...
- for循环循环时间
)) { Console.WriteLine(dt); } ("2011-5-5") 按需求定义 AddDays函数, 一天一天的增长
- 并发编程:IO多路复用。
一 IO模型: Stevens在文章中一共比较了五种IO Model: * blocking IO#阻塞模型 * nonblocking IO#非阻塞 * IO multiplexing#多路复用 ...
- dns 域名地址
Public DNS+ 是属于 腾讯云旗下的公共 DNS 服务.拥有 80 多条国内线路和 4 条海外线路,有 BGP Anycast 技术,也是国内首家支持谷歌 ECS (edns-client-s ...
- Dom4j解析、生成Xml
1以下代码未Xml的解析和生成代码 <?xml version="1.0" encoding="UTF-8"?> <users> < ...
- python基础易错总结
1.python安装配置环境变量 [右键计算机]------->[属性]------->[高级系统设置]------->[高级]------->[环境变量]--------&g ...