admin管理员组

文章数量:1624789

第一步:下载、解压

第二步:安装

第三步:启动

(启动前要先把JAVA_HOME配置好)
直接在root用户下启动会报错,需要先创建新用户es并赋予权限

useradd es -p 123456

chmod -R 777 /xxxx  #这里R要大写,xxx是安装es的地方

在es文件夹下的/bin文件夹下执行./elasticsearch脚本,注意可能会出现报错:

ERROR: [1] bootstrap checks failed
[1]: Transport SSL must be enabled if security is enabled on a [basic] license. Please set [xpack.security.transport.ssl.enabled] to [true] or disable security by setting [xpack.security.enabled] to [false]

这里要到/elasticsearch/config/elasticsearch.yml文件中添加这两行:

xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true

注意还要将该文件中的ip地址都改正相应的。
之后便可以通过./elasticsearch启动es啦,这时候es是通过前台运行的,如需改为后台运行可以通过Ctrl+z将其停止,通过jobs查看es的序号,通过bg %x将其放在后台运行。

^Z
[1]+  已停止               ./elasticsearch
[es@centos bin]$ jobs
[1]+  已停止               ./elasticsearch
[es@centos bin]$ bg %1
[1]+ ./elasticsearch &
[es@centos bin]$ jobs
[1]+  运行中               ./elasticsearch &

第四步:修改密码

在bin文件夹下,通过./elasticsearch-setup-passwords进行密码修改,总共有6个,修改完成后就可以在浏览器中进行访问了。

Initiating the setup of passwords for reserved users elastic,apm_system,kibana,logstash_system,beats_system,remote_monitoring_user.
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]:
Enter password for [logstash_system]:
Reenter password for [logstash_system]:
Enter password for [beats_system]:
Reenter password for [beats_system]:
Enter password for [remote_monitoring_user]:
Reenter password for [remote_monitoring_user]:

在浏览器中输入ip+端口号(9200)访问,输入账号密码即可。

本文标签: 环境LinuxElasticsearch