ElasticSearch 7.2 學(xué)習(xí)一(搭建及配置)

yum安裝

在/etc/yum.repos.d/下新建文件elasticsearch.repo,內(nèi)容:

[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

執(zhí)行安裝命令:

yum install elasticsearch

設(shè)置開(kāi)機(jī)啟動(dòng):

chkconfig --add elasticsearch

啟動(dòng)和停止:

service elasticsearch start
service elasticsearch stop

測(cè)試:

curl -X GET "localhost:9200/"

文件路徑

Type Description Default Location Setting
home Elasticsearch home directory or $ES_HOME /usr/share/elasticsearch
bin Binary scripts including elasticsearch to start a node and elasticsearch-plugin to install plugins /usr/share/elasticsearch/bin
conf Configuration files including elasticsearch.yml /etc/elasticsearch
conf Environment variables including heap size, file descriptors. /etc/sysconfig/elasticsearch
data The location of the data files of each index / shard allocated on the node. Can hold multiple locations. /var/lib/elasticsearch path.data
logs Log files location. /var/log/elasticsearch path.logs
plugins Plugin files location. Each plugin will be contained in a subdirectory. /usr/share/elasticsearch/plugins
repo Shared file system repository locations. Can hold multiple locations. A file system repository can be placed in to any subdirectory of any directory specified here. Not configured path.repo

配置

vi /etc/elasticsearch/elasticsearch.yml
network.host: 0.0.0.0
cluster.initial_master_nodes: ["node-1"]

變更數(shù)據(jù)存放路徑

修改配置文件

vi /etc/elasticsearch/elasticsearch.yml

修改字段值:
path.data: /home/elasticsearch/data
遷移文件:

cp -r /var/lib/elasticsearch/nodes/* /home/elasticsearch/data/nodes/

設(shè)置權(quán)限:

cd /home/elasticsearch/
chown -R elasticsearch:elasticsearch *
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容