GVKun编程网logo

在OpenShift上安装elasticsearch(openstudio安装教程)

6

本文的目的是介绍在OpenShift上安装elasticsearch的详细情况,特别关注openstudio安装教程的相关信息。我们将通过专业的研究、有关数据的分析等多种方式,为您呈现一个全面的了解在

本文的目的是介绍在OpenShift上安装elasticsearch的详细情况,特别关注openstudio安装教程的相关信息。我们将通过专业的研究、有关数据的分析等多种方式,为您呈现一个全面的了解在OpenShift上安装elasticsearch的机会,同时也不会遗漏关于bboss v6.7.5 发布,支持 Elasticsearch 8 和 Opensearch、Centos 6.7 安装ElasticSearch2.3.3、Centos 7上安装Elasticsearch、CentOS 安装ElasticSearch的知识。

本文目录一览:

在OpenShift上安装elasticsearch(openstudio安装教程)

在OpenShift上安装elasticsearch(openstudio安装教程)

Elasticsearch 1.0.0通过阅读本教程安装了预构建版本。如果我启动elasticsearch,则会收到以下错误消息,我应该尝试旧版本的ES还是解决该问题?

[elastic-dataportal.rhcloud.com elasticsearch-1.0.0]\> ./bin/elasticsearch[2014-02-25 10:02:18,757][INFO ][node                     ] [Desmond Pitt] version[1.0.0], pid[203443], build[a46900e/2014-02-12T16:18:34Z][2014-02-25 10:02:18,764][INFO ][node                     ] [Desmond Pitt] initializing ...[2014-02-25 10:02:18,780][INFO ][plugins                  ] [Desmond Pitt] loaded [], sites []OpenJDK Server VM warning: You have loaded library /var/lib/openshift/430c93b1500446b03a00005c/app-root/data/elasticsearch-1.0.0/lib/sigar/libsigar-x86-linux.so which might have disabled stack guard. The VM will try to fix the stack guard now.It''s highly recommended that you fix the library with ''execstack -c <libfile>'', or link it with ''-z noexecstack''.[2014-02-25 10:02:32,198][INFO ][node                     ] [Desmond Pitt] initialized[2014-02-25 10:02:32,205][INFO ][node                     ] [Desmond Pitt] starting ...[2014-02-25 10:02:32,813][INFO ][transport                ] [Desmond Pitt] bound_address {inet[/127.8.212.129:3306]}, publish_address {inet[/127.8.212.129:3306]}[2014-02-25 10:02:35,949][INFO ][cluster.service          ] [Desmond Pitt] new_master [Desmond Pitt][_bWO_h9ETTWrMNr7x_yALg][ex-std-node134.prod.rhcloud.com][inet[/127.8.212.129:3306]], reason: zen-disco-join (elected_as_master)[2014-02-25 10:02:36,167][INFO ][discovery                ] [Desmond Pitt] elasticsearch/_bWO_h9ETTWrMNr7x_yALg{1.0.0}: Startup Failed ...- BindHttpException[Failed to bind to [8080]]        ChannelException[Failed to bind to: /127.8.212.129:8080]                BindException[Address already in use]

答案1

小编典典

您尝试将ES分配给已使用的端口8080。从那里的配置的罪魁祸首是http.port:${OPENSHIFT_DIY_PORT}。只需将两个port配置都保留在配置之外,或为envvar分配其他端口。ES的默认端口是http和9300的9200。

bboss v6.7.5 发布,支持 Elasticsearch 8 和 Opensearch

bboss v6.7.5 发布,支持 Elasticsearch 8 和 Opensearch

Elasticsearch Rest Client bboss v6.7.5 发布,支持 Elasticsearch 8.x 和 Opensearch 2.x。

v6.7.5 功能改进

  1. 修复 opensearch 兼容性 bug
  2. 处理文件输入插件,taskContext 设置参数不起作用,以及获取不到 fileinfo 信息问题
  3. 处理 mvc 框架 json 报文长度为 0 处理机制
  4. 优化数据同步 context.getStringValue 对数据库 clob 和 blob 字段的处理机制

bboss 是一套基于 query dsl 语法操作和访问分布式搜索引擎 Elasticsearch/Opensearch 的 o/r mapping 高性能开发库,底层直接基于 http 协议操作和访问 Elasticsearch、Opensearch;基于 bboss,可以快速编写出访问和操作 Elasticsearch/Opensearch 的程序代码,简单、高效、可靠、安全。

快速开始 bboss 
https://esdoc.bbossgroups.com/#/quickstart

Centos 6.7 安装ElasticSearch2.3.3

Centos 6.7 安装ElasticSearch2.3.3

闲来无事,就来学习下被称为新全文的ElasticSearch。新手第一次装新全文,问题还是挺多的。

1.关于ElasticSearch

ElasticSearch是一个基于Lucene的搜索工具,它使用Java开发并且使用Lucene作为核心来实现索引和搜索的功能。但是它的目的是通过简单的Restful API来隐藏Lucene的复杂性,从而让全文搜索变得简单。

但是,Elasticsearch不仅仅是Lucene和全文搜索,我们还能这样去描述它:
1)分布式的实时文件存储,每个字段都被索引并可被搜索
2)分布式的实时分析搜索引擎
3)可以扩展到上百台服务器,处理PB级结构化或非结构化数据
而且,所有的这些功能被集成到一个服务里面,你的应用可以通过简单的RestfulAPI、各种语言的客户端甚至命令行与之交互。

2. 下载最新版的ElasticSearch的安装包,该版本可直接部署到Linux系统上

安装之前,请确认已安装好最新版的JDK版本,安装步骤请参照其他网友文章。最好把安装的工具包放在/opt目录,本人安装在centos 6.7下的/home目录下使用,wget命令得到该zip安装包。

Elasticsearch 2.3.3
ZIP https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/zip/elasticsearch/2.3.3/elasticsearch-2.3.3.zip</span>
Woo hoo! Your download is almost complete! It's clear you're about to do great things with data. Whether this is your first,tenth,or umpteenth download of an open source Elastic project,there's always something new to learn.

So,before you dive into the documentation,have a gander at the goodness below. Try something new,expand to a new use case,think up something totally novel,and,above all,stay curIoUs.

3. 正式安装ElasticSearch

在root用户,/home目录下解压zip包,创建软连接In -s elasticsearch2.3.3 elasticsearch,cd /elasticsearch后,执行 ./bin/elasticsearch,会出现如下的错误:

[root@xxxx bin]# ./elasticsearch
Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.</span>
	at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:93)
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:144)
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.

是ElasticSearch出于系统安全考虑设置的条件。由于ElasticSearch可以接收用户输入的脚本并且执行,为了系统安全考虑,因此可以创建一个单独的用户用来运行ElasticSearch。

1) 创建单独的用户组和elsearch用户:

	groupadd elsearch
	useradd elsearch -g elsearch -p elasticsearch

2) 更改/home/elasticsearch用户及组:

<span>	</span></span>cd /home
<span>	</span></span>chown -R elsearch:elsearch  elasticsearch

3) 使用elsearch用户执行安装命令

<span>	</span></span>su elsearch 
<span>	</span></span>cd elasticsearch/bin	执行 ./elasticsearch

4. 关于安装plugins(插件管理)

Exception in thread "main" java.lang.IllegalStateException: Unable to access 'path.plugins' (/home/hye/elasticsearch/plugins)
Likely root cause: java.nio.file.AccessDeniedException: /home/hye/elasticsearch/plugins
	at sun.nio.fs.UnixException.translatetoIOException(UnixException.java:84)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
	at java.nio.file.Files.createDirectory(Files.java:674)
	at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
	at java.nio.file.Files.createDirectories(Files.java:767)
	at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:337)
	at org.elasticsearch.bootstrap.Security.addpath(Security.java:314)
	at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:246)
	at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:212)
	at org.elasticsearch.bootstrap.Security.configure(Security.java:118)
	at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:196)
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167)
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.

请按照官网的plguins Managerment的介绍和安装方法进行安装:

4.1安装前的准备

Running as root
If Elasticsearch was installed using the deb or rpm package then run bin/plugin as root so it can write to the appropriate files on disk. Otherwise run bin/plugin as the user that owns all of the Elasticsearch files.

4.2 正式安装plugins插件

本人安装的是Core Elasticsearch plugins,按照图中的安装步骤,完成安装。

Plugin Management 
Core Elasticsearch pluginsedit
Core Elasticsearch plugins can be installed as follows:
sudo bin/plugin install [plugin_name]
For instance,to install the core ICU plugin,just run the following command:
sudo bin/plugin install analysis-icu
This command will install the version of the plugin that matches your Elasticsearch version.
Community and non-core pluginsedit
Non-core plugins provided by Elasticsearch,or plugins provided by the community,can be installed from download.elastic.co,from Maven (Central and Sonatype),or from GitHub. In this case,the command is as follows:
sudo bin/plugin install [org]/[user|component]/[version]</span><span>

5. 启动ElasticSearch

使用非root用户进行安装:

<span>	</span>su elsearch
<span>	</span>cd elasticsearch/bin
<span>	</span>./elasticsearch

如果想要ElasticSearch在后端运行:
<span>	</span>./elasticsearch -d

控制台显示:(启动ElasticSearch成功)

[elsearch@xhyu-100 elasticsearch]$ ./bin/elasticsearch
[2016-06-19 00:27:24,188][WARN ][bootstrap                ] unable to install syscall filter: seccomp unavailable: CONfig_SECCOMP not compiled into kernel,CONfig_SECCOMP and CONfig_SECCOMP_FILTER are needed
[2016-06-19 00:27:24,417][INFO ][node                     ] [Mad-Dog] version[2.3.3],pid[4260],build[218bdf1/2016-05-17T15:40:04Z]
[2016-06-19 00:27:24,417][INFO ][node                     ] [Mad-Dog] initializing ...
[2016-06-19 00:27:25,040][INFO ][plugins                  ] [Mad-Dog] modules [reindex,lang-expression,lang-groovy],plugins [analysis-icu],sites []
[2016-06-19 00:27:25,066][INFO ][env                      ] [Mad-Dog] using [1] data paths,mounts [[/ (/dev/sda3)]],net usable_space [33.4gb],net total_space [45.6gb],spins? [possibly],types [ext4]
[2016-06-19 00:27:25,066][INFO ][env                      ] [Mad-Dog] heap size [1015.6mb],compressed ordinary object pointers [true]
[2016-06-19 00:27:25,066][WARN ][env                      ] [Mad-Dog] max file descriptors [4096] for elasticsearch process likely too low,consider increasing to at least [65536]
[2016-06-19 00:27:27,264][INFO ][node                     ] [Mad-Dog] initialized
[2016-06-19 00:27:27,264][INFO ][node                     ] [Mad-Dog] starting ...
[2016-06-19 00:27:27,330][INFO ][transport                ] [Mad-Dog] publish_address {192.168.31.200:9300},bound_addresses {192.168.31.200:9300}
[2016-06-19 00:27:27,333][INFO ][discovery                ] [Mad-Dog] elasticsearch/-H0Z_q6irsuYDXd1b1jCAg
[2016-06-19 00:27:30,390][INFO ][cluster.service          ] [Mad-Dog] new_master {Mad-Dog}{-H0Z_q6irsuYDXd1b1jCAg}{192.168.31.200}{192.168.31.200:9300},reason: zen-disco-join(elected_as_master,[0] joins received)
[2016-06-19 00:27:30,420][INFO ][http                     ] [Mad-Dog] publish_address {192.168.31.200:9200},bound_addresses {192.168.31.200:9200}
[2016-06-19 00:27:30,420][INFO ][node                     ] [Mad-Dog] started
[2016-06-19 00:27:30,441][INFO ][gateway                  ] [Mad-Dog] recovered [0] indices into cluster_state

6. ElasticSearch界面验证失败,修改ElasticSearch配置文件

未修改配置文件前,使用非root用户进行elasticsearch安装。

[root@xxxx elasticsearch]# curl -X GET http://机器ip:9200/
curl: (7) Couldn't connect to host

按照网上的文章和官网安装说明,并没有修改默认配置文件的说法。

/home/hye/elasticsearch/config

修改完后,开启验证界面,最好找个好点浏览器,QQ浏览器就别用了。可以用Chrome浏览器。

在界面输入:http://安装机器ip:9200/,页面回馈信息如下:

{
  "name" : "Mad-Dog","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"
}

至此,安装结束。。。(今天博客上传图片有问题,只能用文字描述了,抱歉)

Centos 7上安装Elasticsearch

Centos 7上安装Elasticsearch

 

 

 

 

1. 先安装jdk

yum search java|grep jdk
查看yum库中都有哪些jdk版本

分享图片

yum install java-1.8.0-openjdk.x86_64

两次y确认

分享图片

 

2. centOS wget的安装和使用

安装:yum install wget

分享图片

 

 

3. 安装 Elasticsearch

Elasticsearch的安装很简单,下载下来解压即可,这里使用wget下载,当然也可通过网页下载 https://www.elastic.co/downloads/elasticsearch ,再拷贝。

(1) wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.3.tar.gz

(2) 解压到/usr/local/

 tar -zxvf elasticsearch-5.6.3.tar.gz -C /usr/local/

(3) Elasticsearch 要求不能使用超级用户root运行,所以我们建立一个testuser账号

# 创建testuser账户
adduser testuser
# 修改密码
passwd testuser

 

给testuser用户elasticsearch目录的授权

chown -R testuser /usr/local/elasticsearch-5.6.3/

 

 切换至elasticsearch目录,并以testuser用户运行

 

运行elasticsearch,如果想后台运行后面加 -d

分享图片

 

如果没有没有error,就运行成功啦

 

4. 新开一个终端,用curl访问

分享图片

 

 5. vim安装

yum search vim

分享图片

 

安装VIM:

 yum install vim-enhanced

分享图片

 

6. 指定ip地址

编辑es的配置文件

 

[[email protected] elasticsearch-5.6.3]$ vim ./config/elasticsearch.yml1

找到network.host: 一行,去除#号,修改为: 

network.host: [_local_,172.30.6.1]1

172.30.6.1为指定的ip地址,可以是多个。

这样就可以在浏览器里打开啦

http://172.30.6.1:9200/?pretty

CentOS 安装ElasticSearch

CentOS 安装ElasticSearch

1.下载ElasticSearch

1.1 下载ElasticSearch

https://downlElasticSearchoad.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.3.5/elasticsearch-2.3.5.tar.gz

1.2下载ElasticSearch插件head

@L_301_1@

2.安装ElasticSearch

2.1 解压安装包

将elasticsearch-2.3.5.tar.gz上传到目录/usr/local

解压文件

[root@master ~]#  cd /usr/local
[root@master local]# tar -zxvf elasticsearch-2.3.5.tar.gz
2.2 修改配置文件
[root@master local]# vi elasticsearch-2.3.5/config/elasticsearch.yml
#集群名称
cluster.name: elasticsearch
#节点名称
node.name: node01
#数据文件的路径
path.data: /path/to/data、
#日志文件的路径
path.logs: /path/to/logs
#本机器的IP地址
network.host: 192.168.41.2
#elasticsearch的HTTP端口号
http.port: 9200
#集群的配置,如果有多个,则用逗号隔开
discovery.zen.ping.unicast.hosts: ["192.168.41.2"]

2.3 修改启动文件

允许root用户启动,修改启动文件,添加下面一行

ES_JAVA_OPTS="-Des.insecure.allow.root=true"
[root@master bin]# vi  /usr/local/elasticsearch-2.3.5/bin/elasticsearch

2.4 安装插件head

解压文件elasticsearch-head-master.zip

[root@master _site]# unzip elasticsearch-head-master.zip

将解压之后elasticsearch-head-master下面的文件全部拷贝到

/usr/local/elasticsearch-2.3.5/plugins/head/_site/

2.5 启动ES
[root@master bin]# ./elasticsearch &
[1] 2662
[root@master bin]# [2017-02-24 23:00:05,050][WARN ][bootstrap                ] jvm uses the client vm,make sure to run `java` with the server vm for best performance by adding `-server` to the command line
[2017-02-24 23:00:05,217][WARN ][bootstrap                ] running as ROOT user. this is a bad idea!
[2017-02-24 23:00:05,349][WARN ][bootstrap                ] unable to install syscall filter: seccomp unavailable: requires kernel 3.5+ with CONfig_SECCOMP and CONfig_SECCOMP_FILTER compiled in
[2017-02-24 23:00:07,281][INFO ][node                     ] [node01] version[2.3.5],pid[2662],build[90f439f/2016-07-27T10:36:52Z]
[2017-02-24 23:00:07,282][INFO ][node                     ] [node01] initializing ...
[2017-02-24 23:00:10,434][INFO ][plugins                  ] [node01] modules [reindex,lang-expression,lang-groovy],plugins [head],sites [head]
[2017-02-24 23:00:10,571][INFO ][env                      ] [node01] using [1] data paths,mounts [[/ (/dev/sda2)]],net usable_space [11gb],net total_space [17.4gb],spins? [possibly],types [ext4]
[2017-02-24 23:00:10,572][INFO ][env                      ] [node01] heap size [1017.6mb],compressed ordinary object pointers [unkNown]
[2017-02-24 23:00:10,572][WARN ][env                      ] [node01] max file descriptors [4096] for elasticsearch process likely too low,consider increasing to at least [65536]
[2017-02-24 23:00:19,202][INFO ][node                     ] [node01] initialized
[2017-02-24 23:00:19,202][INFO ][node                     ] [node01] starting ...
[2017-02-24 23:00:19,824][INFO ][transport                ] [node01] publish_address {192.168.41.2:9300},bound_addresses {192.168.41.2:9300}
[2017-02-24 23:00:19,907][INFO ][discovery                ] [node01] elasticsearch/ZBLxvnHXSC6mheg6xCFjtg
[2017-02-24 23:00:23,118][INFO ][cluster.service          ] [node01] new_master {node01}{ZBLxvnHXSC6mheg6xCFjtg}{192.168.41.2}{192.168.41.2:9300},reason: zen-disco-join(elected_as_master,[0] joins received)
[2017-02-24 23:00:23,236][INFO ][http                     ] [node01] publish_address {192.168.41.2:9200},bound_addresses {192.168.41.2:9200}
[2017-02-24 23:00:23,240][INFO ][node                     ] [node01] started
[2017-02-24 23:00:23,410][INFO ][gateway                  ] [node01] recovered [0] indices into cluster_state
2.6查看ES进程
[root@master bin]# ps -ef|grep elasticsearch
root      2662  2238  1 15:00 pts/0    00:01:21 /usr/local/jdk1.8.0_11/bin/java -xms256m -Xmx1g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcmarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+disableExplicitGC -Dfile.encoding=UTF-8 -Djna.nosys=true -Des.insecure.allow.root=true -Des.path.home=/usr/local/elasticsearch-2.3.5 -cp /usr/local/elasticsearch-2.3.5/lib/elasticsearch-2.3.5.jar:/usr/local/elasticsearch-2.3.5/lib/* org.elasticsearch.bootstrap.Elasticsearch start
2.7 查看ES状态
[root@master logs]# curl -X GET 'http://192.168.41.2:9200/_cluster/health?pretty=1'
{
  "cluster_name" : "elasticsearch","status" : "green","timed_out" : false,"number_of_nodes" : 1,"number_of_data_nodes" : 1,"active_primary_shards" : 0,"active_shards" : 0,"relocating_shards" : 0,"initializing_shards" : 0,"unassigned_shards" : 0,"delayed_unassigned_shards" : 0,"number_of_pending_tasks" : 0,"number_of_in_flight_fetch" : 0,"task_max_waiting_in_queue_millis" : 0,"active_shards_percent_as_number" : 100.0
}

2.8 开放端口

修改防火墙,开放端口9200,9300

[root@master ~]# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9200 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9300 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited

重启防火墙,使得修改立即生效

[root@master ~]# service iptables restart
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]

2.9 查看head插件

谷歌浏览器访问

http://192.168.41.2:9200/_plugin/head/

今天关于在OpenShift上安装elasticsearchopenstudio安装教程的讲解已经结束,谢谢您的阅读,如果想了解更多关于bboss v6.7.5 发布,支持 Elasticsearch 8 和 Opensearch、Centos 6.7 安装ElasticSearch2.3.3、Centos 7上安装Elasticsearch、CentOS 安装ElasticSearch的相关知识,请在本站搜索。

本文标签: