ElasticSerach的6.0.1安装和Kinbana安装

本文详细介绍了在CentOS环境下安装ElasticSearch 6.0.1的步骤,包括配置JDK、安装包下载、配置文件修改、用户权限设置、IK分词器安装等,以及解决常见启动错误的方法。同时,提供了Kibana的安装和配置教程,确保与ElasticSearch集群的正确连接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ElasticSerach:安装前期工作

  ①:安装JDK-1.8(下载解压,配置profile,很简单就不赘述了),Centos 7.0

  ②:下载ElasticSerach安装包,自行选择版本(本人选择6.0.1),下载地址:https://www.elastic.co/downloads/past-releases

  ③:下载ElasticSerach的IK分词器安装包,下载地址:https://github.com/medcl/elasticsearch-analysis-ik/releases

提供 ElasticSearch6.0.1和kinbana-6.0.1和JDK1.8,和IK和拼音分词器

链接:https://pan.baidu.com/s/1bZWgP4oAZbCN-91-U3enwg 
提取码:8e5e 

正式安装:

第一步:上传下载的elasticsearch-6.0.1.tar

tar -zxvf elasticsearch-6.0.1.tar

第二步:修改配置文件:conf/elasticserach.xml【清空所有配置文件】

elasticSerach.xml

#集群名
cluster.name : elens.es
#节点名
node.name : node-201

#设置绑定的ip地址,可以是ipv4或ipv6的,默认为0.0.0.0, 
#指绑定这台机器的任何一个ip
network.bind_host : 0.0.0.0

#设置其它节点和该节点交互的ip地址,如果不设置它会自动判断,
#值必须是个真实的ip地址 
network.publish_host : 192.168.1.202
 
#设置对外服务的http端口,默认为9200
http.port : 9200
 
#设置节点之间交互的tcp端口,默认是9300
transport.tcp.port : 9300
 
#是否允许跨域REST请求
http.cors.enabled : true

#允许 REST 请求来自何处
http.cors.allow-origin : "*"
 
#节点角色设置
node.master : true
node.data : true

#有成为主节点资格的节点列表 
discovery.zen.ping.unicast.hosts : ["192.168.1.201:9300", "192.168.1.202:9300", "192.168.1.203:9300","192.168.1.204:9300"]
 
#集群中一直正常运行的,有成为master节点资格的最少节点数(默认为1)
# (totalnumber of master-eligible nodes / 2 + 1)
discovery.zen.minimum_master_nodes : 2

第三步:创建虚拟机非Root用户,es不支持root用户启动

username:test                         password:test

第四步:chmod -R 777 elasticsearch-6.0.1                      [es解压的文件夹]  层级全部授权,防止没有权限执行失败!

第五步:ES启动报错

【1】: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536] 
【2】: max number of threads [1024] for user [es] is too low, increase to at least [4096] 
【3】: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

切换到root用户    
1、vi /etc/security/limits.conf 修改如下配置
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096

2、vi /etc/security/limits.d/90-nproc.conf   修改如下配置
* soft nproc 2048

3、vi /etc/sysctl.conf 添加配置
vm.max_map_count=655360 
运行命令 sysctl -p

第六步:下载es对应版本的IK分词器

cd /elasticsearch-6.0.1/plugins

wget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.0.1/elasticsearch-analysis-ik-6.0.1.zip

unzip elasticsearch-analysis-ik-6.0.1.zip

rm elasticsearch-analysis-ik-6.0.1.zip             [删除压缩包]

第六步:启动es

[test@bigdata003 elasticsearch-6.0.1]# ./bin/elasticsearch -d

第七步:页面访问9200端口

IP:9200

Kinbana的安装

1、环境准备

Kibana是ElasticSearch的可视化平台,依赖ElasticSearch,需要优先安装ElasticSearch。

示例:ElasticSearch 6.0.1 集群

2.Kibana下载

Kibana官方下载地址:https://www.elastic.co/cn/downloads/kibana

根据ElasticSearch版本及安装环境下载相应的Kibana安装包。

示例:kibana-6.0.1-linux-x86_64.tar.gz

3.Kibana 安装及配置

      将安装包上次到服务器,然后解压安装包,例如解压到:/mnt/

      tar –zxvf kibana-6.0.1-linux-x86_64.tar.gz -C /mnt/

然后到kibana安装目录的config下,编辑kibana.yml配置文件,添加如下配置:

# Kibana is served by a back end server. This setting specifies the port to use.
server.port: 5601

# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: "192.168.1.215"

# Enables you to specify a path to mount Kibana at if you are running behind a proxy. This only affects
# the URLs generated by Kibana, your proxy is expected to remove the basePath value before forwarding requests
# to Kibana. This setting cannot end in a slash.
#server.basePath: ""

# The maximum payload size in bytes for incoming server requests.
#server.maxPayloadBytes: 1048576

# The Kibana server's name.  This is used for display purposes.
#server.name: "your-hostname"

# The URL of the Elasticsearch instance to use for all your queries.
#此处填写的是ElastcSearch的主节点  ,注解点查看方法,192.168.1.212:9200/_cat/nodes
#    192.168.1.214 11 90  4 0.15 0.48 0.53 mdi * node-2     带星号的就是主节点

elasticsearch.url: "http://192.168.1.214:9200"

# When this setting's value is true Kibana uses the hostname specified in the server.host
# setting. When the value of this setting is false, Kibana uses the hostname of the host
# that connects to this Kibana instance.
#elasticsearch.preserveHost: true

# Kibana uses an index in Elasticsearch to store saved searches, visualizations and
# dashboards. Kibana creates a new index if the index doesn't already exist.
#kibana.index: ".kibana"

# The default application to load.
#kibana.defaultAppId: "discover"

# If your Elasticsearch is protected with basic authentication, these settings provide
# the username and password that the Kibana server uses to perform maintenance on the Kibana
# index at startup. Your Kibana users still need to authenticate with Elasticsearch, which
# is proxied through the Kibana server.
#elasticsearch.username: "user"
#elasticsearch.password: "pass"

# Enables SSL and paths to the PEM-format SSL certificate and SSL key files, respectively.
# These settings enable SSL for outgoing requests from the Kibana server to the browser.
#server.ssl.enabled: false
#server.ssl.certificate: /path/to/your/server.crt
#server.ssl.key: /path/to/your/server.key

# Optional settings that provide the paths to the PEM-format SSL certificate and key files.
# These files validate that your Elasticsearch backend uses the same key files.
#elasticsearch.ssl.certificate: /path/to/your/client.crt
#elasticsearch.ssl.key: /path/to/your/client.key

# Optional setting that enables you to specify a path to the PEM file for the certificate
# authority for your Elasticsearch instance.
#elasticsearch.ssl.certificateAuthorities: [ "/path/to/your/CA.pem" ]

# To disregard the validity of SSL certificates, change this setting's value to 'none'.
#elasticsearch.ssl.verificationMode: full

# Time in milliseconds to wait for Elasticsearch to respond to pings. Defaults to the value of
# the elasticsearch.requestTimeout setting.
#elasticsearch.pingTimeout: 1500

# Time in milliseconds to wait for responses from the back end or Elasticsearch. This value
# must be a positive integer.
#elasticsearch.requestTimeout: 30000

# List of Kibana client-side headers to send to Elasticsearch. To send *no* client-side
# headers, set this value to [] (an empty list).
#elasticsearch.requestHeadersWhitelist: [ authorization ]

# Header names and values that are sent to Elasticsearch. Any custom headers cannot be overwritten
# by client-side headers, regardless of the elasticsearch.requestHeadersWhitelist configuration.
#elasticsearch.customHeaders: {}

# Time in milliseconds for Elasticsearch to wait for responses from shards. Set to 0 to disable.
#elasticsearch.shardTimeout: 0

# Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying.
#elasticsearch.startupTimeout: 5000

# Specifies the path where Kibana creates the process ID file.
#pid.file: /var/run/kibana.pid

# Enables you specify a file where Kibana stores log output.
#logging.dest: stdout

# Set the value of this setting to true to suppress all logging output.
#logging.silent: false

# Set the value of this setting to true to suppress all logging output other than error messages.
#logging.quiet: false

# Set the value of this setting to true to log all events, including system usage information
# and all requests.
#logging.verbose: false

# Set the interval in milliseconds to sample system and process performance
# metrics. Minimum is 100ms. Defaults to 5000.
#ops.interval: 5000

# The default locale. This locale can be used in certain circumstances to substitute any missing
# translations.
#i18n.defaultLocale: "en"

[root@bigdata003 config]# ./bin/kibana &      #后台启动即可

[root@bigdata003 config]# ./bin/kibana &      

访问 192.168.1.215:5601

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值