标签:解压 tor soft 命令 配置文件 blog 执行命令 ber dp2
环境CentOS71.最好以非root用户解压ElasticSearch,如果用root用户,要不然以后还要将文件的权限以及组转移给非foot用户
1)解压elasticsearch-5.2.2.tar.gz到/opt/module目录下
[root@hdp21 ~]# su asy
[asy@hdp21 root]$ tar -zxvf elasticsearch-5.2.2.tar.gz -C /opt/module
2)在/opt/module/elasticsearch-5.2.2路径下创建data和logs文件夹
mkdir data
mkdir logs
如果你用root账号,请先添加一个非root账号,因为elaticsearch不能用root账号运行
user add asy
chown -R asy:asy /opt/module/elasticsearch-5.2.2/
3)root账号修改配置文件/opt/module/elasticsearch-5.2.2/config/elasticsearch.yml
[root@hdp21 config]# pwd
/opt/module/elasticsearch-5.2.2/config
[root@hdp21 config]# vi elasticsearch.yml
修改以下参数
cluster.name: Asy
node.name: node-1
path.data: /opt/module/elasticsearch-5.2.2/data
path.logs: /opt/module/elasticsearch-5.2.2/logs
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: hdp21
http.port: 9200
discovery.zen.ping.unicast.hosts: ["hdp21"]
path.data
path.logs data和logs的路径
network.host ip地址或者host域名地址
http.port端口号
5)配置linux系统环境(参考:
(1)编辑limits.conf 添加类似如下内容
[root@hdp21 config]# vi /etc/security/limits.conf
添加如下内容:
退回到上一级目录
并执行命令:
[root@hdp21 config]# cd ..
[root@hdp21 elasticsearch-5.2.2]# pwd
/opt/module/elasticsearch-5.2.2
[root@hdp21 elasticsearch-5.2.2]# sysctl -p
然后,重新启动elasticsearch,即可启动成功。
6)启动elasticsearch
[asy@hdp21 elasticsearch-5.2.2]$ bin/elasticsearch
后台启动方式
[asy@hdp21 elasticsearch-5.2.2]$ bin/elasticsearch-d
7)测试elasticsearch
[root@hdp21 ~]# curl http://hdp21:9200
{
"name" : "node1",
"cluster_name" : "Asy",
"cluster_uuid" : "8T7xJ-NLTbmYHOPKa3a4tA",
"version" : {
"number" : "5.2.2",
"build_hash" : "f9d9b74",
"build_date" : "2017-02-24T17:26:45.835Z",
"build_snapshot" : false,
"lucene_version" : "6.4.1"
},
"tagline" : "You Know, for Search"
}
执行bin/elasticsearch的时候
如果有 max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] 的报错
这个对应v/etc/security/limits.conf
Google浏览器调试Elastic Search
打开更多工具,扩展程序并且打开开发者模式
将elasticsearch-head.crx拖入浏览器窗口成功完成插件的安装
输入http://192.168.234.21:9200/
其中192.168.234.21为linux主机的IP地址,9200为端口号
标签:解压 tor soft 命令 配置文件 blog 执行命令 ber dp2
原文地址:http://blog.51cto.com/6989066/2334006