转载自: http://techieroop.com/install-elasticsearch-2-x-on-centos-6/
This article will cover install Elasticsearch 2.x version on CentOS 6. Also guideline to change to Default Cluster and Index settings in Elasticsearch 2.x. So Let’s start with prerequisites
Prerequisites:
Elasticsearch needed at least Java 7.
Install Elasticsearch 2.x On CentOS 6 using Elasticsearch Repository
Install Public Signing Key:
rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
Create new repo in your /etc/yum.repos.d/ directory. For example I have created elasticsearch.repo here.
/etc/yum.repos.d/elasticsearch.repo
[elasticsearch-2.x] name=Elasticsearch repository for 2.x packages baseurl=http://packages.elastic.co/elasticsearch/2.x/centos gpgcheck=1 gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch enabled=1
Now Elasticsearch 2.x will avilable for installation using yum
yum install elasticsearch
Note: The repositories do not work with older rpm based distributions that still use RPM v3, like CentOS5.
chkconfig --add elasticsearch
Otherwise if your distribution is using systemd:
sudo /bin/systemctl daemon-reload sudo /bin/systemctl enable elasticsearch.service
Now we have done with Elasticsearch installation. You can check your default Elasticsearch configuration in/etc/elasticsearch/elasticsearch.yml
By default its cluster name will be elasticsearch.
Now we will change Cluster, Index and Host info in elasticsearch.yml
To illustrate here I am naming my Elasticsearch cluster name “Techieroop” and node name “techieroop-es-node“. Add your host into “discovery.zen.ping.unicast.hosts“.
Summary of important Elasticsearch Configuration:
cluster.name: TechieRoop node.name: techieroop-es-node discovery.zen.ping.unicast.hosts: ["127.0.0.1"]
Your elasticsearch.yml will be look like this
# =========== Elasticsearch Configuration ============== # # NOTE: Elasticsearch comes with reasonable defaults for most settings. # Before you set out to tweak and tune the configuration, make sure you # understand what are you trying to accomplish and the consequences. # # The primary way of configuring a node is via this file. This template lists # the most important settings you may want to configure for a production cluster. # # Please see the documentation for further information on configuration options: # <http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html> # # ----------------- Cluster --------------- # # Use a descriptive name for your cluster: # cluster.name: TechieRoop # #------------------- Node ---------------- # # Use a descriptive name for the node: # node.name: techieroop-es-node # # Add custom attributes to the node: # # node.rack: r1 # # ----------------- Paths ---------------- # # Path to directory where to store the data (separate multiple locations by comma): # # path.data: /path/to/data # # Path to log files: # # path.logs: /path/to/logs # # ------------------ Memory ----------------- # # Lock the memory on startup: # # bootstrap.mlockall: true # # Make sure that the `ES_HEAP_SIZE` environment variable is set to about half the memory # available on the system and that the owner of the process is allowed to use this limit. # # Elasticsearch performs poorly when the system is swapping the memory. # # ----------------- Network ---------------- # # Set the bind address to a specific IP (IPv4 or IPv6): # # network.host: 192.168.0.1 # # Set a custom port for HTTP: # # http.port: 9200 # # For more information, see the documentation at: # <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html> # # ---------------- Gateway ------------------- # # Block initial recovery after a full cluster restart until N nodes are started: # # gateway.recover_after_nodes: 3 # # For more information, see the documentation at: # <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html> # # --------------- Discovery ----------------- # # Elasticsearch nodes will find each other via unicast, by default. # # Pass an initial list of hosts to perform discovery when new node is started: # The default list of hosts is ["127.0.0.1", "[::1]"] # discovery.zen.ping.unicast.hosts: ["127.0.0.1"] # # Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1): # # discovery.zen.minimum_master_nodes: 3 # # For more information, see the documentation at: # <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html> # # --------------- Various ----------------- # # Disable starting multiple nodes on a single system: # # node.max_local_storage_nodes: 1 # # Require explicit names when deleting indices: # # action.destructive_requires_name: true
Start the Elasticsearch:
sudo service elasticsearch start
Verify you installation :
curl -XGET 'localhost:9200'
Output:
{ "name" : "techieroop-es-node", "cluster_name" : "Techieroop", "version" : { "number" : "2.1.1", "build_hash" : "40e2c53a6b6c2972b3d13846e450e66f4375bd71", "build_timestamp" : "2015-12-15T13:05:55Z", "build_snapshot" : false, "lucene_version" : "5.3.1" }, "tagline" : "You Know, for Search" }
Install Elasticsearch 2.x on CentOS 6http://techieroop.com/install-elasticsearch-2-x-on-centos-6/http://techieroop.com/wp-content/uploads/2016/01/install-elasticsearch-2-on-centos6.pnghttp://techieroop.com/wp-content/uploads/2016/01/install-elasticsearch-2-on-centos6-150x150.png17 January 2016ElasticsearchElastic,Elasticsearch
<h3>Install Elasticsearch 2.1 on CentOS 6</h3> This article will cover install Elasticsearch 2.x version on CentOS 6. Also guideline to change to Default Cluster and Index settings in Elasticsearch 2.x. So Let's start with prerequisites<strong>Prerequisites:</strong>Elasticsearch needed at least Java 7. <h3>Install Elasticsearch 2.x On CentOS 6 using Elasticsearch Repository</h3> <strong>Install Public Signing Key:</strong> <pre>rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch</pre> Create new repo in your <strong>/etc/yum.repos.d/</strong> directory. For example I have created elasticsearch.repo here./etc/yum.repos.d/elasticsearch.repo <pre>[elasticsearch-2.x] name=Elasticsearch repository for 2.x packages baseurl=http://packages.elastic.co/elasticsearch/2.x/centos gpgcheck=1 gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch enabled=1</pre> Now Elasticsearch 2.x will avilable for installation using yum <pre>yum install elasticsearch</pre> Note: The repositories do not work with older rpm based distributions that still use RPM v3, like CentOS5. <pre>chkconfig --add elasticsearch</pre> Otherwise if your distribution is using systemd: <pre>sudo /bin/systemctl daemon-reload sudo /bin/systemctl enable elasticsearch.service</pre> Now we have done with Elasticsearch installation. You can check your default Elasticsearch configuration in <strong>/etc/elasticsearch/elasticsearch.yml</strong>By default its cluster name will be elasticsearch.Now we will change Cluster, Index and Host info in elasticsearch.ymlTo illustrate here I am naming my Elasticsearch cluster name "<em><strong>Techieroop</strong></em>" and node name "<em><strong>techieroop-es-node</strong></em>". Add your host into "<strong><em>discovery.zen.ping.unicast.hosts</em></strong>".Summary of important Elasticsearch Configuration: <pre>cluster.name: TechieRoop node.name: techieroop-es-node discovery.zen.ping.unicast.hosts: ["127.0.0.1"]</pre> Your <strong>elasticsearch.yml</strong> will be look like this <pre># =========== Elasticsearch Configuration ============== # # NOTE: Elasticsearch comes with reasonable defaults for most settings. # Before you set out to tweak and tune the configuration, make sure you # understand what are you trying to accomplish and the consequences. # # The primary way of configuring a node is via this file. This template lists # the most important settings you may want to configure for a production cluster. # # Please see the documentation for further information on configuration options: # <http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html> # # ----------------- Cluster --------------- # # Use a descriptive name for your cluster: # cluster.name: TechieRoop # #------------------- Node ---------------- # # Use a descriptive name for the node: # node.name: techieroop-es-node # # Add custom attributes to the node: # # node.rack: r1 # # ----------------- Paths ---------------- # # Path to directory where to store the data (separate multiple locations by comma): # # path.data: /path/to/data # # Path to log files: # # path.logs: /path/to/logs # # ------------------ Memory ----------------- # # Lock the memory on startup: # # bootstrap.mlockall: true # # Make sure that the `ES_HEAP_SIZE` environment variable is set to about half the memory # available on the system and that the owner of the process is allowed to use this limit. # # Elasticsearch performs poorly when the system is swapping the memory. # # ----------------- Network ---------------- # # Set the bind address to a specific IP (IPv4 or IPv6): # # network.host: 192.168.0.1 # # Set a custom port for HTTP: # # http.port: 9200 # # For more information, see the documentation at: # <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html> # # ---------------- Gateway ------------------- # # Block initial recovery after a full cluster restart until N nodes are started: # # gateway.recover_after_nodes: 3 # # For more information, see the documentation at: # <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html> # # --------------- Discovery ----------------- # # Elasticsearch nodes will find each other via unicast, by default. # # Pass an initial list of hosts to perform discovery when new node is started: # The default list of hosts is ["127.0.0.1", "[::1]"] # discovery.zen.ping.unicast.hosts: ["127.0.0.1"] # # Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1): # # discovery.zen.minimum_master_nodes: 3 # # For more information, see the documentation at: # <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html> # # --------------- Various ----------------- # # Disable starting multiple nodes on a single system: # # node.max_local_storage_nodes: 1 # # Require explicit names when deleting indices: # # action.destructive_requires_name: true </pre> <strong>Start the Elasticsearch:</strong> <pre>sudo service elasticsearch start</pre> <strong>Verify you installation :</strong> <pre>curl -XGET 'localhost:9200'</pre> <strong>Output:</strong> <pre>{ "name" : "techieroop-es-node", "cluster_name" : "Techieroop", "version" : { "number" : "2.1.1", "build_hash" : "40e2c53a6b6c2972b3d13846e450e66f4375bd71", "build_timestamp" : "2015-12-15T13:05:55Z", "build_snapshot" : false, "lucene_version" : "5.3.1" }, "tagline" : "You Know, for Search" }</pre>Roopendrahttps://plus.google.com/+TechieroopendraRoopendraVishwakarmaroopendramca@gmail.comAdministratorI'm Roopendra Vishwakarma, a Programmer and Blogger from India. I have experience in Web Development and Open Source Technology. I mostly write about latest technology, getting started tutorial and tricks and tips.TechieRoop
相关推荐
安装命令可能是 `sudo yum install -y elasticsearch-7.17.3.x86_64.rpm` 或者 `sudo dnf install -y elasticsearch-7.17.3.x86_64.rpm`。 另一个文件 `gradle-7.4.2-all.zip` 是Gradle构建工具的完整版本,版本号...
### Elasticsearch 的下载、配置与使用案例详解 #### 一、Elasticsearch 简介 Elasticsearch 是一款基于 Apache Lucene 构建的开源分布式搜索引擎。它支持高并发访问和实时数据分析,广泛应用于日志分析、全文检索...
版本号中的数字"6.99.0"可能意味着它支持Elasticsearch 6.x系列的所有特性,但请注意,对于不同版本的Elasticsearch,可能存在兼容性问题,因此使用时需确认与你的Elasticsearch实例匹配。 使用elasticsearch-dump...
### Elasticsearch 数据库下载、配置与使用案例详解 #### 概述 本文档旨在详细介绍如何利用Elasticsearch构建一套高效、可扩展的日志分析系统。该系统不仅能够收集、存储大量日志信息,还支持快速搜索与分析,以及...
2. **操作系统**: CentOS 7是基于RPM包管理的Linux发行版,适合安装Elasticsearch。 3. **Java运行环境**: Elasticsearch依赖JDK 8,因此安装前需确保系统已安装JDK并设置好`JAVA_HOME`环境变量。 ### 二、安装Java...
### Elasticsearch 数据库下载、配置与使用案例详解 #### 一、Elasticsearch 概述 Elasticsearch 是一款基于 Lucene 开发的分布式、RESTful 风格的搜索和分析引擎,它能够处理大量的数据并提供快速的搜索响应。...
在本文中,我们将深入探讨如何在CentOS 7系统上安装Elasticsearch并配置Logstash进行数据同步。Elasticsearch是一款强大的分布式搜索和分析引擎,而Logstash则是一款数据收集和处理工具,常用于日志管理和实时数据...
name=Elasticsearch repository for 2.x packages baseurl=http://packages.elastic.co/elasticsearch/2.x/centos gpgcheck=1 gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch enabled=1 [root@linux-...
在支持RPM包管理系统的Linux发行版(如CentOS、Fedora等)上,`elasticsearch-oss-7.10.0-x86_64.rpm`文件提供了方便的安装方式。你可以使用`yum install`或`dnf install`命令来安装。首先,通过`sudo rpm -ivh ...
`.rpm`扩展名表明这是一个使用RPM(Red Hat Package Manager)格式打包的软件包,这是Linux发行版如RHEL、Fedora和CentOS等广泛使用的软件安装和管理系统。通过运行`yum install`或`dnf install`命令,用户可以方便...
- 安装RPM包:`rpm -i elasticsearch-5.0.0.rpm` - **源码安装**: - 下载Elasticsearch源码包:`curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz` - 解压并进入...
3. **安装 Elasticsearch**:你可以从 Elasticsearch 官方网站下载最新版本的 RPM 包,或者添加官方 GPG 密钥和 YUM 存储库,然后使用 `sudo yum install elasticsearch` 命令安装。 4. **配置 Elasticsearch**:...
- **使用yuminstall安装**:`yum install elasticsearch`。 - **修改elasticsearch配置**:编辑`/etc/elasticsearch/elasticsearch.yml`文件,修改`network.host`参数。 - **启动elasticsearch**:`systemctl start ...
ELK堆栈则是一个强大的日志分析和可视化解决方案,由Elasticsearch提供数据存储和搜索功能、Logstash进行日志处理以及Kibana用于数据的可视化。这一部分的内容在提供的文档片段中并未详细说明,但通常涉及各自组件的...
3. 使用`yum install`或`dnf install`命令来安装JDK,命令格式为:`yum install /path/to/jdk-8u144-linux-x64.rpm` 或 `dnf install /path/to/jdk-8u144-linux-x64.rpm`,这里的`/path/to/`应替换为实际的文件路径...
总结来说,Nessus 8.10在CentOS 7上的安装和portscan功能使用涉及到系统的预处理、RPM包安装、依赖安装、服务配置、端口扫描策略的创建和执行等多个环节。了解并掌握这些知识点,可以有效地进行网络安全性评估和维护...
安装方法是在 Elasticsearch 根目录执行 `bin/elasticsearch-plugin install file:///path/to/elasticsearch-analysis-ik-master.zip`,然后重启 Elasticsearch。 - **拼音插件**:elasticsearch-analysis-pinyin-...
1. **数据源集成**:Grafana支持多种数据源,包括Prometheus、InfluxDB、Elasticsearch、MySQL、PostgreSQL等,这使得它能够处理来自不同系统的数据,并在一个统一的界面上展示。 2. **丰富的图表类型**:Grafana...