1 Star 0 Fork 0

bufolai/elasticsearch-definitive-guide

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
10_Installing_ES.asciidoc 4.97 KB
一键复制 编辑 原始数据 按行查看 历史
Zachary Tong 提交于 2016-01-21 16:30 . Fix typo in URL

Installing and Running Elasticsearch

The easiest way to understand what Elasticsearch can do for you is to play with it, so let’s get started!

The only requirement for installing Elasticsearch is a recent version of Java. Preferably, you should install the latest version of the official Java from www.java.com.

You can get the latest version of Elasticsearch from elastic.co/downloads/elasticsearch.

To install Elasticsearch, download and extract the archive file for your platform. For more information, see the {ref}/_installation.html[Installation] topic in the Elasticsearch Reference.

Tip

When installing Elasticsearch in production, you can choose to use the Debian or RPM packages provided on the downloads page. You can also use the officially supported Puppet module or Chef cookbook.

Once you’ve extracted the archive file, Elasticsearch is ready to run. To start it up in the foreground:

cd elasticsearch-<version>
./bin/elasticsearch (1) (2)
  1. Add -d if you want to run it in the background as a daemon.

  2. If you’re running Elasticsearch on Windows, simply run bin\elasticsearch.bat instead.

Test it out by opening another terminal window and running the following:

curl 'http://localhost:9200/?pretty'
Tip
If you’re running Elasticsearch on Windows, you can download cURL from http://curl.haxx.se/download.html. cURL provides a convenient way to submit requests to Elasticsearch and installing cURL enables you to copy and paste many of the examples in this book to try them out.

You should see a response like this:

{
  "name" : "Tom Foster",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "2.1.0",
    "build_hash" : "72cd1f1a3eee09505e036106146dc1949dc5dc87",
    "build_timestamp" : "2015-11-18T22:40:03Z",
    "build_snapshot" : false,
    "lucene_version" : "5.3.1"
  },
  "tagline" : "You Know, for Search"
}

This means that you have an Elasticsearch node up and running, and you can start experimenting with it. A node is a running instance of Elasticsearch. A cluster is a group of nodes with the same cluster.name that are working together to share data and to provide failover and scale. (A single node, however, can form a cluster all by itself.) You can change the cluster.name in the elasticsearch.yml configuration file that’s loaded when you start a node. More information about this and other Important Configuration Changes is provided in the Production Deployment section at the end of this book.

Tip
See that View in Sense link at the bottom of the example? Install the Sense console to run the examples in this book against your own Elasticsearch cluster and view the results.

When Elasticsearch is running in the foreground, you can stop it by pressing Ctrl-C.

Installing Sense

Sense is a Kibana app that provides an interactive console for submitting requests to Elasticsearch directly from your browser. Many of the code examples in the online version of this book include a View in Sense link. When clicked, it opens up a working example of the code in the Sense console. You do not have to install Sense, but it will make this book much more interactive by allowing you to experiment with the code samples on your local Elasticsearch cluster.

To install and run Sense:

  1. Run the following command in the Kibana directory to download and install the Sense app:

    ./bin/kibana plugin --install elastic/sense (1)
    1. Windows: bin\kibana.bat plugin --install elastic/sense.

  2. Start Kibana.

    ./bin/kibana (1)
    1. Windows: bin\kibana.bat.

  3. Open Sense your web browser by going to http://localhost:5601/app/sense.

Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/bufoai/elasticsearch-definitive-guide.git
git@gitee.com:bufoai/elasticsearch-definitive-guide.git
bufoai
elasticsearch-definitive-guide
elasticsearch-definitive-guide
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385