linux 服务器配置 elasticsearch和 管理工具kibana(三)

  • Post author:
  • Post category:linux


前两节 主要介绍了elasticsearch和 管理工具kibana 的安装。

这一节,主要再整理完善一下 他们的一些启动和进程方面的配置。

让 elasticsearch进程在后台运行:

./elasticsearch -d

为了避免关闭命令窗口而失效,即使 control+c 也不会退出,要想杀死进程,请执行 ps  和kill 命令:

[root@iZbp1fiznm0sijxfwnj5bbZ ~]# ps  -aux | grep  elas
es        6739  2.0 39.7 2823892 747384 pts/0  Sl   17:52   0:34 /usr/local/elasticsearch/jdk/bin/java -Xms500m -Xmx500m -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-1813043701275465645 -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=/usr/local/elasticsearch -Des.path.conf=/usr/local/elasticsearch/config -Des.distribution.flavor=default -Des.distribution.type=tar -Des.bundled_jdk=true -cp /usr/local/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -d
es        6754  0.0  0.2  72296  5372 pts/0    Sl   17:52   0:00 /usr/local/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller
root      6849  0.0  0.0 112724   988 pts/1    R+   18:19   0:00 grep --color=auto elas
[root@iZbp1fiznm0sijxfwnj5bbZ ~]# kill -9 6379

同理来操作 kibana.

如果,杀不死 kibana进程,也可以查看端口,杀死端口进程:

[root@iZbp1fiznm0sijxfwnj5bbZ ~]# lsof -i:5601
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
node    7030 root   20u  IPv4  60601      0t0  TCP *:esmagent (LISTEN)
[root@iZbp1fiznm0sijxfwnj5bbZ ~]# kill -9 7030

说明:kibana 常驻后台,命令:

 nohup ./kibana &

结果:

[root@iZbp1fiznm0sijxfwnj5bbZ bin]# nohup ./kibana &
[1] 7128
[root@iZbp1fiznm0sijxfwnj5bbZ bin]# nohup: 忽略输入并把输出追加到"nohup.out"

其中 7128 是 端口 5601 的进程id

[root@iZbp1fiznm0sijxfwnj5bbZ ~]# lsof -i:5601
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
node    7128 root   18u  IPv4  63221      0t0  TCP *:esmagent (LISTEN)

附加:

查看占用cpu 最多的十个进程,命令:

 ps aux|head -1;ps aux|grep -v PID|sort -rn -k +3|head



版权声明:本文为u010377516原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。