Elasticsearch版本:7.0.0
Kibana版本:7.0.0
服务器:centos7.2 64位
Elasticsearch
1、下载
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.0.0-linux-x86_64.tar.gz
2、解压
[root@localhost elastic]# tar -zxvf elasticsearch-7.0.0-linux-x86_64.tar.gz
3、修改配置
[root@localhost elastic]# cd elasticsearch-7.0.0/
[root@localhost elasticsearch-7.0.0]# vim config/elasticsearch.yml
配置
# Use a descriptive name for your cluster:
cluster.name: my-application
# Set the bind address to a specific IP (IPv4 or IPv6):
# Set a custom port for HTTP:
http.port: 9200
# 下面配置必须加上,否则外部不能访问,不配置可以用nginx
network.host: 192.168.177.128
cluster.initial_master_nodes: ["node-1"]
http.cors.enabled: true
http.cors.allow-origin: "*"
4、运行
[root@localhost elasticsearch-7.0.0]# ./bin/elasticsearch
网页上打开
http://192.168.177.128:9200/
{
"name" : "localhost.localdomain",
"cluster_name" : "my-application",
"cluster_uuid" : "-NVZPxyURByju4VFh0HDuQ",
"version" : {
"number" : "7.0.0",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "b7e28a7",
"build_date" : "2019-04-05T22:55:32.697037Z",
"build_snapshot" : false,
"lucene_version" : "8.0.0",
"minimum_wire_compatibility_version" : "6.7.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
elasticsearch错误集
后台运行
[elsearch@localhost elasticsearch-7.0.0]$ nohup ./bin/elasticsearch &
[elsearch@localhost elasticsearch-7.0.0]$ nohup: ignoring input and appending output to ‘nohup.out’
nohup.out 中会打印运行信息
查看端口 netstat -nltp
[elsearch@localhost elasticsearch-7.0.0]$ netstat -nltp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN -
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN -
tcp6 0 0 :::3306 :::* LISTEN -
tcp6 0 0 :::111 :::* LISTEN -
tcp6 0 0 192.168.177.128:9200 :::* LISTEN 3464/java
tcp6 0 0 192.168.177.128:9300 :::* LISTEN 3464/java
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 ::1:631 :::* LISTEN -
tcp6 0 0 ::1:25 :::* LISTEN -
[elsearch@localhost elasticsearch-7.0.0]$
关闭
方式1
[elsearch@localhost elasticsearch-7.0.0]$ ps -ef|grep elasticsearch-7.0.0
elsearch 3464 2953 20 03:49 pts/0 00:00:21 /home/elastic/elasticsearch-7.0.0/jdk/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=/tmp/elasticsearch-3957884088718425250 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=data -XX:ErrorFile=logs/hs_err_pid%p.log -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m -Djava.locale.providers=COMPAT -Dio.netty.allocator.type=unpooled -Des.path.home=/home/elastic/elasticsearch-7.0.0 -Des.path.conf=/home/elastic/elasticsearch-7.0.0/config -Des.distribution.flavor=default -Des.distribution.type=tar -Des.bundled_jdk=true -cp /home/elastic/elasticsearch-7.0.0/lib/* org.elasticsearch.bootstrap.Elasticsearch
elsearch 3528 3464 0 03:49 pts/0 00:00:00 /home/elastic/elasticsearch-7.0.0/modules/x-pack-ml/platform/linux-x86_64/bin/controller
elsearch 3589 2953 0 03:51 pts/0 00:00:00 grep --color=auto elasticsearch-7.0.0
[elsearch@localhost elasticsearch-7.0.0]$ kill 3464
方式2
[elsearch@localhost elasticsearch-7.0.0]$ fuser -n tcp 9200
9200/tcp: 3464
[elsearch@localhost elasticsearch-7.0.0]$ kill 3464
或者直接netstat -nltp 然后kill进程号