1. 启动 elasticsearch 命令:

[root@localhost bin]$ ./elasticsearch-7.6.2/bin/elasticsearch -d

2. 停止 elasticsearch 命令:

首先需要利用JAVA的 jps 命令工具,查看到 Elasticserach的进程ID,再用 kill 命令杀进程

[tangjunhua@localhost bin]$ jps
30180 Jps
29417 Elasticsearch

[tangjunhua@localhost bin]$ kill -9 29417

3. 更改密码

首先,需要修改elasticsearch.yml的配置文件,增加 discovery.type: single-node,否则会报错。

[tangjunhua@localhost bin]$ vim ../config/elasticsearch.yml

xpack.security.enabled: true
discovery.type: single-node

[tangjunhua@localhost bin]$ ./elasticsearch-setup-passwords interactive
You will be prompted to enter passwords as the process progresses.
Please confirm that you would like to continue [y/N]y

Enter password for [elastic]:
Reenter password for [elastic]:
Enter password for [apm_system]:
Reenter password for [apm_system]:
Enter password for [kibana]:
Reenter password for [kibana]:

 

 

更多推荐