ElasticSearch2.3.1环境搭建哪些不为人知的坑
首先说明一点,大家最好不要用什么尝鲜版,用比稳定版就好了,要不麻烦不断,另外出了问题,最好去官网,或者google搜索,因为这样靠谱些,要不现在好多都是低版本的,1.4的什么的,结果按照安装,多少情况下有这样那样的问题。
郑重声明,本文ElasticSearch2.3.1最新版的安装,其他的版本请搭建自行google,最好不要百度,百度一般都是老文章,有些版本问题很多,瞎折腾
ElasticSearch 安装配置
这个有点老套了,具体大家去移步官网:https://www.elastic.co/guide/en/sense/current/installing.html
按照上面博客的步骤,我安装了elasticsearch-2.3.1版本的,Java 1.8版本,可是不知道为何运行不起来
Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:93)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:144)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
网站一搜,环境变量的问题,可是结果里里外外搞了三次就是不行,去官网搜一下,解决额 ./bin/elasticsearch -Des.insecure.allow.root=true
具体出现问题可以对号入座。这个是因为权限,分组的问题,可以给es用户组 权限等等 具体问题可以百度其他的
marvel的安装请参考官网
https://www.elastic.co/guide/en/marvel/current/installing-marvel.html
cd /usr/share/elasticsearch
sudo bin/plugin install license
sudo bin/plugin install marvel-agent
现在是:http://localhost:9200/_plugin/marvel/ 是空白,还是不知道啥原因,算了,先把数据库数据导入进来再说
推荐:Elasticsearch入门中文版 http://es.xiaoleilu.com/010_Intro/00_README.htm
https://www.gitbook.com/book/looly/elasticsearch-the-definitive-guide-cn/details
将MySQL中的数据导入ElasticSearch
上面那篇文章的问题,下面将会说明
由于es官网叫停river类的导入插件,因此原始的elasticsearch-jdbc-river变更为elasticsearch-jdbc,成为一个独立的导入工具。官方提到的同类型工具还有logstash,个人觉得logstash在做数据库同步的时候并不是很好用,有太多坑要填。
目前2.0以上版本并不支持windows的环境,所以各位同学不要试了,windows下最高支持到1.7.3。(2015.12.9)
所以大家看到
- ./bin/plugin --install river-jdbc --url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-river-jdbc/1.5.0.5/elasticsearch-river-jdbc-1.5.0.5-plugin.zip</span>
这样的命令 那么就是坑,因为官方不让安装了,因为这个问题,我折腾了好久
具体做法就是
- $ wget http://xbib.org/repository/org/xbib/elasticsearch/importer/elasticsearch-jdbc/2.3.1.0/elasticsearch-jdbc-2.3.1.0-dist.zip
- $ unzip elasticsearch-jdbc-2.3.1.0-dist.zip
编辑vim import.sh
下面 database是我MySQL数据库名称
table是我mysql的表名称
- "index" : "test",
index是es中的数据结构,你可以把他看成mysql中的库
- "type" : "stdutent"
type类似于mysql中的表
- bin=/root/elasticsearch-2.3.1/elasticsearch-jdbc-2.3.1.0/bin
- lib=/root/elasticsearch-2.3.1/elasticsearch-jdbc-2.3.1.0/lib
- echo '{
- "type" : "jdbc",
- "jdbc": {
- "url":"jdbc:mysql://localhost:3306/database",
- "user":"root",
- "password":"root",
- "sql":"select * from table",
- "index" : "test",
- "type" : "stdutent"
- }
- }'| java \
- -cp "${lib}/*" \
- -Dlog4j.configurationFile=${bin}/log4j2.xml \
- org.xbib.tools.Runner \
- org.xbib.tools.JDBCImporter
chmod +x import.sh 根据数据库原因,导入可能有些慢
运行之后./import.sh
往下
- [root@localhost elasticsearch-jdbc-2.3.1.0]# curl 'http://localhost:9200/test/student/_search?pretty&q=*'
如果有数据,说明导入成功
任何东西不考虑环境因素,那么坑很多,jdbc具体安装可以参考 这个可能是个完善的方法,我上面只能导入一个表的文件
详细的jdbc安装可以参考下面一篇文章
http://bluereader.org/article/122422454
ElasticSearch2.3.1环境搭建哪些不为人知的坑的更多相关文章
- kubernetes实战之consul简单测试环境搭建及填坑
这一节内容有点长,我们将介绍如何基于docker搭建一client一server的consul测试环境,以及如何搭建多server consul测试集群.在基于docker搭建多server的cons ...
- angular环境搭建时的坑
安装angular环境踩过一些坑,最终还是把工程跑起来了,这里描述一下我的步骤,不排除有些步骤是多余的,希望能对遇到同样问题的小伙伴有帮助. 下载最新版node.js. 安装node,安装过程一路点下 ...
- 搜索引擎ElasticSearch系列(一): ElasticSearch2.4.4环境搭建
一:ElasticSearch简介 Elasticsearch is a distributed, RESTful search and analytics engine capable of sol ...
- elasticsearch6.5集群环境搭建的一些坑
都说el配置很简单,确实比solr简单多了,不用手动配置一大堆,不过第一次配置也不轻松,因为马虎老是漏掉了许多地方 配置一个半小时才启动成功: 这里主要记录一下一些遇到的坑: 一 不能用root启动, ...
- facebook atc弱网环境搭建和踩坑总结
facebook atc介绍 Augmented Traffic Control(又名atc)是一种模拟网络状况的工具.由facebook开源,是一个允许开发人员控制设备与互联网连接的项目.atc可以 ...
- Titanium开发环境搭建第二个坑
1. build时总提示 --key-password <keypass> 参数没传,不填又说密码不对,填对了又说没传,应该是ide的问题,暂时不知怎样去设置该命令参数: 2. 继续去T ...
- Titanium开发环境搭建第一个坑
操作系统: Ubuntu 12.04 LTS AMD64 在Titanium Studio中,装Titanium CLI怎么都不能成功,到了一个进度,发现卡在那里,硬盘一直狂闪,发现在Studio的文 ...
- 一、laya学习笔记 --- layabox环境搭建 HelloWorld(坑:ts版本问题解决方案)
好吧,使用layabox需要从官网下载些啥呢 一.下载layabox 官网 https://www.layabox.com/ 首页上有两个,一个Engine,一个IDE Engine我下载的TS版本, ...
- PHP 环境搭建及zabbix安装遇到的一些坑.
参考https://segmentfault.com/a/1190000003409708 进行php环境搭建. 下载 php5 http://windows.php.net/download 下载 ...
随机推荐
- Application中数据传递及内存泄漏问题
原文地址:http://android.tgbus.com/Android/tutorial/201107/359474.shtml Application的使用 Application和Actovo ...
- Customize Acrylic Brush in UWP Applications(在UWP中自定义亚克力笔刷)
原文 Customize Acrylic Brush in UWP Applications(在UWP中自定义亚克力笔刷) Windows 10 Fall Creators Update(Build ...
- AI2XAML's Bug
原文:AI2XAML's Bug My picture is like this: I use Adobe Illustator CS to draw the outline of that, I s ...
- 【HLSL学习笔记】WPF Shader Effect Library算法解读之[BandedSwirl]
原文:[HLSL学习笔记]WPF Shader Effect Library算法解读之[BandedSwirl] 因工作原因,需要在Silverlight中使用Pixel Shader技术,这对于我来 ...
- 一次 .NET Core 中玩锁的经历:ManualResetEventSlim, Semaphore 与 SemaphoreSlim
最近同事对 .net core memcached 缓存客户端 EnyimMemcachedCore 进行了高并发下的压力测试,发现在 linux 上高并发下使用 async 异步方法读取缓存数据会 ...
- 2013年新年礼物---CrossFPC 终于出来了
2012年12月份,玛雅人的预言没有实现,一个内部进行了7年开发的CrossFPC 终于见光了. 网址:http://www.crossfpc.com/ Welcome to CrossFPC, a ...
- 【Git】文件暂存与提交
git工作目录文件的两种状态:已跟踪.未跟踪. 文件状态的变化周期: 查看当前文件状态: git status 跟踪新文件/暂存已修改文件 git add newfile 状态简览 git statu ...
- Python标准库(3.x): 内建函数扫盲
Built-in Functions abs() dict() help() min() setattr() all() dir() hex() next() slice() any() divmod ...
- Winform 点击TreeView控件节点的CheckBox不触发NodeMouseClick事件的做法
private void Tv_areainfo_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (!e.Node. ...
- C# WinForm TreeView选择父节点子节点全选
//设置标志,防止死循环 bool check = false; public void TV_AfterCheck(object sender, TreeViewEventArgs e) { if ...