- 安裝
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.3.1-linux-x86_64.tar.gz
tar -zxvf elasticsearch-*.tar.gz
- 啟動(dòng)
Run bin/elasticsearch (or bin\elasticsearch.bat on Windows)
3.坑點(diǎn)
- 不能用root用戶運(yùn)行es袁勺,切換普通用戶就好固阁。
groupadd elk # 創(chuàng)建用戶組elk
useradd elk -g elk -p 111111 # 創(chuàng)建新用戶elk跪妥,-g elk 設(shè)置其用戶組為 elk,-p 111 設(shè)置其密碼6個(gè)1
chown -R elk:elk /opt # 更改 /opt 文件夾及內(nèi)部文件的所屬用戶及組為 elk:elk
su elk # 切換到非root用戶elk下來
- 本機(jī)無法訪問虛擬機(jī)的es
###修改es目錄中config下elasticsearch.yml,末尾添加
network.host: 0.0.0.0
http.port: 9200
transport.host: localhost
transport.tcp.port: 9300
本機(jī)訪問 虛擬機(jī)ip:9200出現(xiàn)如下即可
{
"name": "localhost.centos-1",
"cluster_name": "elasticsearch",
"cluster_uuid": "qaFgH4p_SpqUPOlThF3m_w",
"version": {
"number": "7.3.1",
"build_flavor": "default",
"build_type": "tar",
"build_hash": "4749ba6",
"build_date": "2019-08-19T20:19:25.651794Z",
"build_snapshot": false,
"lucene_version": "8.1.0",
"minimum_wire_compatibility_version": "6.8.0",
"minimum_index_compatibility_version": "6.0.0-beta1"
},
"tagline": "You Know, for Search"
}
訪問前先關(guān)閉防火墻
CentOS 7.0默認(rèn)使用的是firewall作為防火墻
- 查看防火墻狀態(tài)
firewall-cmd --state
- 停止firewall
systemctl stop firewalld.service
- 禁止firewall開機(jī)啟動(dòng)
systemctl disable firewalld.service