启动
设为服务
在所有节点上建立服务配置文件并设置为开机启动:
vim /usr/lib/systemd/system/els.service
# systemd service file for ElasticSearch [Unit] Description=ElasticSearch Community Server After=network.target After=syslog.target
[Install] WantedBy=multi-user.target
[Service] User=es Group=es
Type=forking
LimitNOFILE=65535 LimitNPROC=65535 LimitMEMLOCK=infinity
WorkingDirectory=/usr/local/elasticsearch-7.16.2
PIDFile=/data/es/els.pid
# Start main service ExecStart=/usr/local/elasticsearch-7.16.2/bin/elasticsearch -d -p /data/es/els.pid
TimeoutStartSec=75 # systemd service file for ElasticSearch [Unit] Description=ElasticSearch Community Server After=network.target After=syslog.target [Install] WantedBy=multi-user.target [Service] User=es Group=es Type=forking LimitNOFILE=65535 LimitNPROC=65535 LimitMEMLOCK=infinity WorkingDirectory=/usr/local/elasticsearch-7.16.2 PIDFile=/data/es/els.pid # Start main service ExecStart=/usr/local/elasticsearch-7.16.2/bin/elasticsearch -d -p /data/es/els.pid TimeoutStartSec=75 systemctl enable els 启动systemctl start els systemctl status els 查看启动状态由于是通过http展示的节点JSON信息,故可以通过网页访问各节点IP:9200地址查看: 也可在终端通过CURL获取查看: curl -XGET http://ES-dn1:9200/_cluster/health?pretty curl -XGET http://ES-dn1:9200/_cat/nodes |
页码: 1 2