elasticsearch 1.5 + mysql安装配置与简单使用
2015-05-09 13:58
746 查看
1.下载es:
https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.5.2.deb
2.安装:
dpkg -i elasticsearch-1.5.1.deb
3.启动es
/etc/init.d/elasticsearch start
4.mysql导入插件:
./bin/plugin -url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-river-jdbc/1.5.0.2/elasticsearch-river-jdbc-1.5.0.2-plugin.zip-install river-jdbc
5.创建jdbc driver:
curl -xput 'http://localhost:9200/_river/my_jdbc_river/_meta' -d '
{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://localhost:3306/xxx",
"user" : "root",
"password" : "xxx",
"sql" : "select id,timestamp from xxxx",
"index":"table",
"type":"db"
}
}'
6.删除:
curl -xdelete 'http://182.92.181.250:9200/db/table'
7.其他配置
可以通过schedule参数来配置es的定时更新。
8.客户端
当然也可以使用es的java客户端来操作增删改查
例如:
https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.5.2.deb
2.安装:
dpkg -i elasticsearch-1.5.1.deb
3.启动es
/etc/init.d/elasticsearch start
4.mysql导入插件:
./bin/plugin -url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-river-jdbc/1.5.0.2/elasticsearch-river-jdbc-1.5.0.2-plugin.zip-install river-jdbc
5.创建jdbc driver:
curl -xput 'http://localhost:9200/_river/my_jdbc_river/_meta' -d '
{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://localhost:3306/xxx",
"user" : "root",
"password" : "xxx",
"sql" : "select id,timestamp from xxxx",
"index":"table",
"type":"db"
}
}'
6.删除:
curl -xdelete 'http://182.92.181.250:9200/db/table'
7.其他配置
可以通过schedule参数来配置es的定时更新。
8.客户端
当然也可以使用es的java客户端来操作增删改查
例如:
Client client = new TransportClient().addTransportAddress(new InetSocketTransportAddress("182.92.181.250", 9300)); GetResponse response = client.prepareGet().setIndex("_river").setType("table").execute().actionGet();
maven地址:
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId> <version>1.5.1</version>
</dependency>
</pre>参考链接:<p></p><pre>
http://www.elasticsearch.cn/guide/
https://www.elastic.co/downloads
https://github.com/jprante/elasticsearch-jdbc#time-based-selecting
https://github.com/elastic/elasticsearch
相关文章推荐
- 使用yum安装Mysql ,并进行简单配置
- Ubuntu Server 16.04.1 安装配置以及简单使用MySQL(云服务器配置)
- 【MySQL】(1)mysql-5.6.22-winx64数据库的安装、配置、简单使用
- Mysql-5.7-win64数据库安装教程 压缩解压版安装在win10 安装配置过程图解图示简单傻瓜式一条龙教程(最新更新2017.7.2)
- ElasticSearch安装及简单配置说明
- linux下安装mysql5.7.17及简单配置&&HIVE安装和使用
- CentOS 7.0 使用 yum 安装 MariaDB 与 MariaDB 的简单配置
- winxp MySQL 5.6.35 免安装版 简单配置
- MySQL下载安装、配置与使用(win7x64)
- Windows下MySQL下载安装、配置与使用
- Zookeeper的安装配置和简单使用-yellowcong
- Supervisor 安装,简单配置,使用入门
- Mac OS下安装mysql及其简单使用
- CentOS下安装mysql及配置使用
- CentOS7.0 MariaDB 安装配置后使用远程工具SQLyog 错误1130(远程连接mysql 授权)
- Mac Pro 下MySql的安装及配置使用
- 四、ElasticSearch5.5.2安装使用Kibana监控及配置
- windows下redis安装、配置与简单使用
- mysql 安装配置及经常使用操作
- CentOS 7.0 使用 yum 安装 MariaDB 与 MariaDB 的简单配置