新版elasticsearch的插件安装

https://github.com/mobz/elasticsearch-head

http://mobz.github.io/elasticsearch-head

Running

There are multiple ways of running elasticsearch-head.

Running with built in server

  • git clone git://github.com/mobz/elasticsearch-head.git
  • cd elasticsearch-head
  • npm install
  • npm run start

This will start a local webserver running on port 9100 serving elasticsearch-head

Running with docker

  • for Elasticsearch 5.x: docker run -p 9100:9100 mobz/elasticsearch-head:5
  • for Elasticsearch 2.x: docker run -p 9100:9100 mobz/elasticsearch-head:2
  • for Elasticsearch 1.x: docker run -p 9100:9100 mobz/elasticsearch-head:1
  • for fans of alpine there is mobz/elasticsearch-head:5-alpine

Running as a Chrome extension

  • Install ElasticSearch Head from the Chrome Web Store.
  • Click the extension icon in the toolbar of your web browser.

Running as a plugin of Elasticsearch (deprecated)

  • for Elasticsearch 5.x: site plugins are not supported. Run as a standalone server
  • for Elasticsearch 2.x: sudo elasticsearch/bin/plugin install mobz/elasticsearch-head
  • for Elasticsearch 1.x: sudo elasticsearch/bin/plugin -install mobz/elasticsearch-head/1.x
  • for Elasticsearch 0.x: sudo elasticsearch/bin/plugin -install mobz/elasticsearch-head/0.9
  • open http://localhost:9200/_plugin/head/

This will automatically download the appropriate version of elasticsearch-head from github and run it as a plugin within the elasticsearch cluster. In this mode elasticsearch-head automatically connects to the node that is running it

Running with the local proxy

This is an experimental feature which creates a local proxy for many remote elasticsearch clusters

  • configure clusters in proxy/clusters
  • create a file per remote cluster you want to connect to ( see localhost9200.json as example )
  • requires node >= 6.0
  • npm install
  • npm run proxy

At the moment it only works with grunt server running on http://localhost:9100

Alternatives

  • File System: elastisearch-head is a standalone webapp written in good-ol’ html5. This means, you can put it up on any webserver, run it directly from the filesystem. It’ll even fit on a floppy disk.
  • DEB package: There is an unofficial deb package. the plugin executable will be available at /usr/share/elasticsearch/bin/plugin.
  • Homebrew: There is an unofficial keg. The plugin executable will be available at /usr/local/Cellar/elasticsearch/(elasticsearch version)/libexec/bin/plugin.

Connecting to elasticsearch

By default elasticsearch exposes a http rest API on port 9200 which elasticsearch-head connects to.

Enable CORS in elasticsearch

When not running as a plugin of elasticsearch (which is not even possible from version 5) you must enable CORS in elasticsearch otherwise your browser will rejects requests which appear insecure.

In elasticsearch configuration;

  • add http.cors.enabled: true
  • you must also set http.cors.allow-origin because no origin allowed by default. http.cors.allow-origin: "*" is valid value, however it’s considered as a security risk as your cluster is open to cross origin from anywhere.

Basic Authentication

elasticsearch-head will add basic auth headers to each request if you pass in the correct url parameters
You will also need to add http.cors.allow-headers: Authorization to the elasticsearch configuration

x-pack

elasticsearch x-pack requires basic authentication and CORS as described above. Make sure you have the correct CORS setup and then open es-head with a url like “http://localhost:9100/?auth_user=elastic&auth_password=changeme”

URL Parameters

Parameters may be appended to the url to set an initial state eg. head/index.html?base_uri=http://node-01.example.com:9200

  • base_uri force elasticsearch-head to connect to a particular node.
  • dashboard experimental feature to open elasticsearch-head in a mode suitable for dashboard / radiator. Accepts one parameter dashboard=cluster
  • auth_user adds basic auth credentials to http requests ( requires elasticsearch-http-basic plugin or a reverse proxy )
  • auth_password basic auth password as above (note: without additional security layers, passwords are sent over the network in the clear )
  • lang force elasticsearch-head to use specified ui language (eg: en, fr, pt, zh, zh-TW, tr, ja)

Contributing

To contribute to elasticsearch-head you will need the following developer tools

  1. git and a github account
  2. node
  3. grunt-cli
  4. (to run jasmine tests) phantomjs

Then

  1. create a fork of elasticsearch-head on github
  2. clone your fork to your machine
  3. cd elasticsearch-head
  4. npm install # downloads node dev dependencies
  5. grunt dev # builds the distribution files, then watches the src directory for changes (if you have an warning like "Warning: Task “clean” failed. Use —force to continue.", well use —force ;) )

Changes to both _site and src directories must be committed, to allow people to 
run elasticsearch-head without running dev tools and follow existing dev patterns, 
such as indenting with tabs.

安装

yum localinstall elasticsearch-6.1.1.rpm -y
mkdir -p /elk/{data,logs} && chown -R elasticsearch.elasticsearch /elk

配置

grep '^[a-Z]' /etc/elasticsearch/elasticsearch.yml
cluster.name: yoho8elk      #ELK的集群名称,名称相同即属于是同一个集群
node.name: manager-node-1   #本机在集群内的节点名称ode-1
path.data: /elk/data        #数据保存目录
path.logs: /elk/logs        #日志保存目录
bootstrap.memory_lock: true     #服务启动的时候锁定足够的内存,防止数据写入swap,可能会导致云主机报错.可以不填写.
network.host: 0.0.0.0       #监听 10.0.1.0网段的
http.port: 9200         
discovery.zen.ping.unicast.hosts: ["10.0.1.100", "10.0.1.24"]

修改内存限制,并同步配置文件:

https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html

vim jvm.options
-Xms1g
-Xmx1g
#官方配置文档最大建议30G以内。

修改节点2的配置文件。

[root@test-manager elasticsearch]# scp elasticsearch.yml test-web04:/etc/elasticsearch/
[root@test-web04 elasticsearch]# grep '^[a-Z]' /etc/elasticsearch/elasticsearch.yml
cluster.name: yoho8elk
node.name: test-web04-node-2
path.data: /elk/data
path.logs: /elk/logs
bootstrap.memory_lock: true     #在云主机上加上这个参数可能会报错。
network.host: 0.0.0.0           #监听 0.0.0.0网段的
http.port: 9200
discovery.zen.ping.unicast.hosts: ["10.0.1.100", "10.0.1.24"]

设置java路径

which: no java in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin)
ln -sv /application/jdk/bin/java* /usr/local/sbin/

启动elasticsearch

systemctl start elasticsearch
systemctl enable elasticsearch
systemctl status elasticsearch

访问测试

curl 10.0.1.100:9200

集群管理head 插件

git clone git://github.com/mobz/elasticsearch-head.git
yum install -y npm
yum update openssl -y 
npm install grunt -save
npm install  或 npm install -g cnpm --registry=https://registry.npm.taobao.org && cnpm install 

启动插件

npm run start  &
netstat -lntp |grep 9100

修改elasticsearch支持跨域访问并重启

vim /etc/elasticsearch/elasticsearch.yml
http.cors.enabled: true #最下方添加
http.cors.allow-origin: "*"


systemctl restart elasticsearch

ik分词器

/usr/share/elasticsearch/bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.1.2/elasticsearch-analysis-ik-6.1.2.zip
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 可以通过以下步骤安装Windows Elasticsearch插件: 1. 确认您已经安装Elasticsearch。如果没有安装,请先下载并安装Elasticsearch。 2. 打开命令提示符或PowerShell并进入Elasticsearch安装目录。 3. 输入以下命令安装插件: bin/elasticsearch-plugin install [插件名称] 例如,要安装“analysis-smartcn”插件,请输入以下命令: bin/elasticsearch-plugin install analysis-smartcn 4. 等待插件安装完成。 5. 重新启动Elasticsearch以使插件生效。 安装完成后,您应该能够在Elasticsearch中使用该插件了。 ### 回答2: 要安装Windows上的Elasticsearch插件,你可以按照以下步骤进行操作: 1. 首先,确保已经安装了Java Development Kit (JDK)。你可以从Oracle官网下载并安装适用于你的Windows版本的JDK。 2. 访问Elasticsearch的官方网站,进入下载页面。在Windows操作系统下找到合适的版本,根据你的需求下载对应的Elasticsearch安装文件。 3. 下载完成后,将安装文件解压到一个合适的位置。你可以选择任意目录,只要确保有足够的可用磁盘空间。 4. 打开Elasticsearch的解压目录,导航到bin文件夹下。 5. 在bin文件夹下,你可以找到一个名为"elasticsearch-plugin"的可执行文件。 6. 打开命令提示符(CMD)或者PowerShell,切换到elasticsearch的bin目录。你可以执行以下命令进入该目录: ``` cd path_to_elasticsearch/bin ``` 7. 运行以下命令来安装一个插件(以x-pack插件为例): ``` elasticsearch-plugin install x-pack ``` 其中,"x-pack"是插件的名称。你可以根据实际需求替换成其他插件名称。 8. 安装过程可能需要一些时间,取决于你的网络连接速度和插件大小。安装完成后,你可以在bin目录下的elasticsearch.yml配置文件中配置插件。 9. 完成以上步骤后,你可以通过运行以下命令启动Elasticsearch服务: ``` elasticsearch ``` 10. 至此,你已经成功安装Elasticsearch插件并启动了服务。你可以通过访问http://localhost:9200来确认Elasticsearch是否正确运行,并尝试在插件中增加自定义功能。 希望以上步骤能帮助你顺利安装Windows上的Elasticsearch插件。 ### 回答3: 要安装Windows Elasticsearch插件,可以按照以下步骤进行操作: 1. 首先,确保已经安装Elasticsearch。可以从Elasticsearch官方网站(https://www.elastic.co/products/elasticsearch)下载并安装它。 2. 打开命令提示符或Powershell窗口,并导航到Elasticsearch安装目录的bin目录。例如,输入`cd C:\elasticsearch\bin`以进入该目录。 3. 在bin目录中,运行以下命令安装插件: ``` elasticsearch-plugin.bat install plugin_name ``` 这里的`plugin_name`是想要安装插件的名称。根据需要将`plugin_name`替换为实际的插件名称。 4. 插件安装过程中,可能会要求确认或同意用户协议。按照提示进行相应操作。 5. 插件安装成功后,重新启动Elasticsearch服务以使插件生效。可以通过运行以下命令来重启服务: ``` elasticsearch-service.bat restart ``` 这将重新启动Elasticsearch服务并加载新安装插件。 6. 安装完成后,可以在Elasticsearch的配置文件中配置插件的详细设置,或使用默认配置运行插件。 请注意,具体的插件安装步骤可能会因插件版本、依赖项等因素而有所差异。因此,最好在安装插件之前查阅插件的官方文档,了解更详细的安装步骤和要求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值