Elasticsearch 学习笔记 (二) 之 上手体验
来源:互联网 发布:如何删除网络驱动器 编辑:程序博客网 时间:2024/05/17 09:23
安装
elasticsearch 在Linux/Mac OS/Windows环境下都能运行, 安装非常简单:
1、上官网下载安装包
2、运行 bin/elasticsearch (Windows上运行 bin\elasticsearch.bat)
3、打开浏览器输入http://localhost:9200/ 或者: curl -X GET http://localhost:9200/
可以看到如下信息:
{ "name" : "Shi'ar Gladiator", "cluster_name" : "elasticsearch", "version" : { "number" : "2.3.3", "build_hash" : "218bdf10790eef486ff2c41a3df5cfa32dadcfde", "build_timestamp" : "2016-05-17T15:40:04Z", "build_snapshot" : false, "lucene_version" : "5.5.0" }, "tagline" : "You Know, for Search"}
恭喜你, Elasticsearch 已经安装成功 ^_^ 很简单有木有??
Elasticsearch目录
Type Description Default Location Setting
home
Home of elasticsearch installation.
path.home
bin
Binary scripts including elasticsearch
to start a node.
{path.home}/bin
conf
Configuration files including elasticsearch.yml
{path.home}/config
path.conf
data
The location of the data files of each index / shard allocated on the node. Can hold multiple locations.
{path.home}/data
path.data
logs
Log files location.
{path.home}/logs
path.logs
plugins
Plugin files location. Each plugin will be contained in a subdirectory.
{path.home}/plugins
path.plugins
repo
Shared file system repository locations. Can hold multiple locations. A file system repository can be placed in to any subdirectory of any directory specified here.
Not configured
path.repo
script
Location of script files.
{path.conf}/scripts
path.script
---------------------------------path.data: /mnt/first,/mnt/second---------------------------------
Or in an array format:
----------------------------------------path.data: ["/mnt/first", "/mnt/second"]----------------------------------------
环境变量
Elasticsearch 首先会读取通用的JAVA_OPTS环境变量来获取JVM参数, 除了可以用JAVA_OPTS配置JVM参数外, 还可以通过Elasticsearch提供的ES_JAVA_OPTS环境变量配置JVM参数, ES_JAVA_OPTS会覆盖JAVA_OPTS中配置的相同参数, 官方建议是在JAVA_OPTS中配置通用的参数, 在ES_JAVA_OPTS中配置针对Elasticsearch需要调整的参数。
环境变量最主要的作用是指定 -Xmx 最大堆大小和 -Xms 最小堆大小。
Elasticsearch配置
elasticsearch的配置文件有两个config/elasticsearch.yml 和 config/logging.yml
听名字不难看出, 前者是配置主要参数的地方, 后者是配置日志参数的地方。
通常elasticsearch用默认的配置参数就够了, 如果有特殊需求要调整默认参数也很简单, 打开上面说的两个文件, 内容很简单, 能配置的参数都有注释和例子, 这里不在赘述。
以服务方式启动
Linux
elasticsearch针对不同的linux发行版提供了不同的二进制安装包, 下载专用的安装包即可轻松实现以服务方式启动。 当然如果你要找刺激, 也可以下载tar包, 自己配置成服务。
Windows
Windows版的zip包中官方提供了一个脚本(bin/service.bat)
用法:service.bat install|remove|start|stop|manager[SERVICE_ID]
参数说明:
install
Install Elasticsearch as a service
remove
Remove the installed Elasticsearch service (and stop the service if started)
start
Start the Elasticsearch service (if installed)
stop
Stop the Elasticsearch service (if started)
manager
Start a GUI for managing the installed service
- Elasticsearch 学习笔记 (二) 之 上手体验
- Elasticsearch学习笔记之二(ES集群)
- elasticsearch学习笔记(二)
- Elasticsearch学习笔记(二)Elasticsearch入门
- elasticsearch学习笔记(二)
- Struts学习笔记之快速上手
- elasticsearch服务器开发学习笔记(二)
- elasticsearch服务器开发学习笔记(三.二)
- Elasticsearch学习笔记(二) mysql数据同步
- AngularJS初上手体验<二>Hello Word!
- 《OpenCV3编程入门》学习笔记二:快速上手OpenCV
- Elasticsearch上手
- Raspberry Pi上手笔记之二 - 安装操作系统
- jQuery 学习笔记 一 初体验《二》
- IPython上手学习笔记
- 机器学习算法之二:5分钟上手K-Means
- J2EE系列之Hibernate4学习笔记(二)--Hibernate4增删改查体验
- Hibernate初体验Cat之快速上手
- 对象和类
- 面向对象基础
- 发现tomcat死活编译不了项目的解决方法
- Oracle DBLink 理解、授权、创建、删除、访问表授权
- thinkphp模型过滤查询字段,表达式方法
- Elasticsearch 学习笔记 (二) 之 上手体验
- Swift资源包--Sort方法
- 图片拉伸---resizableImageWithCapInsets
- $.getJson中文参数乱码
- vim查找/替换字符串
- 一个5位数,判断它是不是回文数。即12321是回文数,个位与万位相同,十位与千位相同。
- Linux命令 - Mount
- 你需要知道的 16 个 Linux 服务器监控命令
- MIRO报错Table T169V: entry 1110 does not exist