1. 卸载elasticsearch
1.1 删除安装包
sudo dpkg -P elasticsearch
卸载出错
1.2 删除 elasticsearch 用户和组的办法
1.3 再运行下面命令删除文件
sudo dpkg -P elasticsearch
1.4 再删除 /var/lib/elasticsearch
1.5 检查elasticsearch 是否卸载干净
2.安装elasticsearch
2. 1 下载安装elasticsearch
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.2.deb
2.2 安装elasticsearch
sudo dpkg -i elasticsearch-5.1.2.deb
接下来就是运行了,这是关键所在,首先我们前往安装目录elasticsearch的安装目录,一般会在:cd /usr/share/elasticsearch
sudo -R 775 elasticsearch/