“ElasticSearch:安装、head插件、集群、root启动”的版本间差异
跳到导航
跳到搜索
(建立内容为“category:ElasticSearch == 关于 == 【转自:[https://www.orchome.com/489 https://www.orchome.com/489]】 == Linux下安装 == * 确保jdk为jdk1.8.0_73…”的新页面) |
|||
第89行: | 第89行: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
如果出现: | 如果出现: | ||
<syntaxhighlight lang="bash" highlight=""> | |||
npm cannot be installed without Node.js. | npm cannot be installed without Node.js. | ||
Install Node.js first, and then try again. | Install Node.js first, and then try again. | ||
</syntaxhighlight> | </syntaxhighlight> | ||
则需要 安装Node.js: | 则需要 安装Node.js: | ||
<syntaxhighlight lang="bash" highlight=""> | |||
yum install -y nodejs | yum install -y nodejs | ||
</syntaxhighlight> | </syntaxhighlight> | ||
第100行: | 第100行: | ||
如果node.js版本过低,则需要升级: | 如果node.js版本过低,则需要升级: | ||
<syntaxhighlight lang="bash" highlight=""> | |||
# 第一步:首先安装 n 模块: | # 第一步:首先安装 n 模块: | ||
npm install -g n | npm install -g n |
2021年5月22日 (六) 18:34的版本
关于
【转自:https://www.orchome.com/489】
Linux下安装
- 确保jdk为jdk1.8.0_73以上,并已确保安装ok。
- 下载 ElasticSearch:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.1.tar.gz tar -zxvf elasticsearch-5.1.1.tar.gz cd elasticsearch-5.1.1
- 修改limit限制:(5.0以后都要修改)
> vi /etc/security/limits.conf * soft nofile 65536 * hard nofile 65536 > echo 'vm.max_map_count=262144'>> /etc/sysctl.conf > sysctl -p > vi /etc/security/limits.d/90-nproc.conf * soft nproc 2048
- 设置配置文件:
> vim config/elasticsearch.yml node.name: node-1 path.data: /tmp/elasticsearch/data path.logs: /tmp/elasticsearch/logs network.host: 192.168.x.x http.port: 9200 # 跨域 http.cors.enabled: true http.cors.allow-origin: "*"
- 创建用户:
# 创建elasticsearch用户 groupadd elasticsearch useradd elasticsearch -g elasticsearch -p elasticsearch # 赋权限 chown elasticsearch:elasticsearch -R /usr/local/elasticsearch-5.1.1
- 启动:
su - elasticsearch -c "nohup /usr/local/elasticsearch-5.1.1/bin/elasticsearch >/dev/null 2>&1 &"
head插件的安装
- 下载:
git clone git://github.com/mobz/elasticsearch-head.git cd elasticsearch-head
- 在 elasticsearch-head 目录下 node_modules/grunt 下如果没有 grunt 二进制程序,需要执行:
cd elasticsearch-head npm install grunt --save
- 修改服务器监听地址:
- 启动服务:
- 访问:https://192.168.1.1:9100
如果没有npm,则需安装npm
如下:
curl https://npmjs.org/install.sh | sh
sh install.sh
如果出现:
npm cannot be installed without Node.js.
Install Node.js first, and then try again.
则需要 安装Node.js:
yum install -y nodejs
如果node.js版本过低,则需要升级:
# 第一步:首先安装 n 模块:
npm install -g n
# 第二步:升级node.js到最新稳定版
n stable