2.X/1. Getting Started

1-01-01. Installing and Running Elasticsearch

drscg 2017. 10. 1. 12:27

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

Elasticsearch로 무엇을 할 수 있는지를 이해하는 가장 쉬운 방법은 동작시켜 보는 것이다. 자, 시작해 보자!

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.

Elasticsearch를 설치하기 위한 요구 조건은 Java 최신 버전뿐 이다. 가급적이면, www.java.com 에서 정식 Java의 최신 버전을 설치하도록 하자.

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

Elasticsearch의 최신 버전은 elastic.co/downloads/elasticsearch 에서 다운 받을 수 있다.

To install Elasticsearch, download and extract the archive file for your platform. For more information, see the Installation topic in the Elasticsearch Reference.

Elasticsearch를 설치하려면, platform에 알맞은 압축파일을 내려 받아 압축을 풀면 된다. 더 많은 정보가 필요하다면, Elasticsearch Reference에서 Installation 부분을 참고하자.

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 supportedPuppet module or Chef cookbook.

Elasticsearch를 설치할 때, downloads page에서 제공하는 Debian이나 RPM package를 이용할 수 있다. 공식적으로 지원되는 Puppet module이나 Chef cookbook 을 이용할 수도 있다.

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

압축파일의 압축을 풀었다면, Elasticsearch를 실행할 준비가 된 것이다. foreground에서 시작해 보자.

cd elasticsearch-<version>
./bin/elasticsearch  

daemon으로 background에서 실행하려면 –d 를 추가하자.

Windows에서 Elasticsearch를 실행하려면, 대신 bin\elasticsearch.bat 를 실행하자.

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

다른 terminal window를 열어 다음을 실행해, 테스트해 보자.

curl 'http://localhost:9200/?pretty'
Tip

If you’re running Elasticsearch on Windows, you can download cURL fromhttp://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.

Elasticsearch를 Windows에서 실행하고 있다면, http://curl.haxx.se/download.html에서, cURL을 내려 받을 수 있다. cURL은 Elasticsearch에 request를 보내는 편리한 방법을 제공하고, cURL의 설치하면, 이 책의 많은 예제들을 copy/paste하여 테스트할 수 있다.

You should see a response like this:

아래와 같은 response를 볼 수 있다.

{
  "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. 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.

이것은 Elasticsearch node가 실행 중이고, 그것으로 테스트할 수 있다는 의미이다. node 는 Elasticsearch의 실행 중인 instance이다. cluster 는 동일한 cluster.name 을 가진 node의 그룹으로, 데이터를 공유하고 장애 대비, 확장 등을 제공하기 위해 함께 동작한다. (그러나, 단일 node 혼자서도 cluster를 형성할 수 있다.) node를 시작할 때, elasticsearch.yml 설정 파일의 cluster.name 을 변경할 수 있다. 이것과 다른 중요한 설정의 변경에 대한 자세한 정보는 이 책의 마지막 부분에 있는 Production Deployment에서 제공된다.

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.

예제 아래의 View in Sense link를 주목하자. Sense Console을 설치해, 이 책의 예제를 여러분의 Elasticsearch cluster에서 실행해 그 결과를 볼 수 있다.

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

Elasticsearch가 foreground에서 실행되고 있다면, Ctrl-C를 눌러 중단할 수 있다.

Installing Senseedit

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.

sense는 browser에서 직접 Elasticsearch에 request를 보내기 위한, 대화형 console을 제공하는 Kibana app이다. 이 책의 online version에서, 많은 예제 code는 View in Sense link를 포함하고 있다. 그 link를 클릭하면 예제 code가 sense console에서 열릴 것이다. sense를 설치할 필요는 없다. 하지만 여러분의 local Elasticsearch cluster에서 이 예제 code를 테스트함으로써, 이 책과 좀 더 많이 교감할 수 있을 것이다.

To install and run Sense:

sense를 설치하고 실행해 보자.

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

    Kibana directory에서 다음 명령을 실행하여, sense app을 내려 받아 설치하자.

    ./bin/kibana plugin --install elastic/sense 

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

  2. Start Kibana.

    Kibana를 실행하자.

    ./bin/kibana 

    Windows: bin\kibana.bat.

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

    web browser에서 http://localhost:5601/app/sense 로 이동하여, sense를 시작하자.


'2.X > 1. Getting Started' 카테고리의 다른 글

1. Getting Started  (0) 2017.10.01
1-01. You Know, for Search…  (0) 2017.10.01
1-01-02. Talking to Elasticsearch  (0) 2017.10.01
1-01-03. Document Oriented  (0) 2017.10.01
1-01-04. Finding Your Feet  (0) 2017.10.01