Elasticsearch配置和使用

“/etc/elasticsearch/elasticsearch.yml”

创建用于存储的文件

[root@git01 ~]# mkdir /data/es-data -p
还需要授权
[root@git01 ~]# chown -R elasticsearch:elasticsearch /data/es-data
[root@git01 ~]# systemctl start elasticsearch
[root@git01 ~]# systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)
Active: active (running) since Sat 2019-04-06 17:19:55 CST; 2s ago
Docs: http://www.elastic.co
Main PID: 61299 (java)
CGroup: /system.slice/elasticsearch.service
└─61299 /bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFracti…
Apr 06 17:19:55 git01 systemd[1]: Started Elasticsearch.

[root@git01 ~]# grep ‘^[a-Z]’ /etc/elasticsearch/elasticsearch.yml
cluster.name: my-elk1_77
node.name: git01
path.data: /data/es-data
path.logs: /var/log/elasticsearch
bootstrap.memory_lock: true
network.host: 10.0.0.77
http.port: 9200

[1]: memory locking requested for elasticsearch process but memory is not locked

bootstrap.memory_lock: true 重新关起来吧


[root@git01 ~]# tail -f /var/log/elasticsearch/my-elk1_77.log

我们重新启动服务

[root@git01 ~]# systemctl start elasticsearch
然后打开网页访问:10.0.0.77:9200

得到一下内容:
{
“name” : “git01”, # 节点名称
“cluster_name” : “my-elk1_77”,
“cluster_uuid” : “tI180R1mQcSpZPdgV9krmg”,
“version” : {
“number” : “6.7.1”,
“build_flavor” : “default”,
“build_type” : “rpm”,
“build_hash” : “2f32220”,
“build_date” : “2019-04-02T15:59:27.961366Z”,
“build_snapshot” : false,
“lucene_version” : “7.7.0”,
“minimum_wire_compatibility_version” : “5.6.0”,
“minimum_index_compatibility_version” : “5.0.0”
},
“tagline” : “You Know, for Search”
}

[root@git01 ~]# ls /usr/share/elasticsearch/modules

  1. [root@git01 ~]# ls /usr/share/elasticsearch/modules
  2. aggs-matrix-stats lang-mustache reindex x-pack-deprecation x-pack-rollup
  3. analysis-common lang-painless repository-url x-pack-graph x-pack-security
  4. ingest-common mapper-extras transport-netty4 x-pack-ilm x-pack-sql
  5. ingest-geoip parent-join tribe x-pack-logstash x-pack-upgrade
  6. ingest-user-agent percolator x-pack-ccr x-pack-ml x-pack-watcher
  7. lang-expression rank-eval x-pack-core x-pack-monitoring