多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] ### 1. 安装elasticsearch #### 1.系统设置 * 开启elasticsearch时,报 max file是4096而elasticsearch at last 65536的错误 1. 修改配置文件limits.conf ~~~ sudo vim /etc/security/limits.conf elasticsearch - nofile 65536 # elasticsearch是打算用哪个用户启动,就写哪个用户 ~~~ 2. 修改 ~~~ sudo vim /etc/pam.d/su session required pam_limits.so # 把这行取消注释 ~~~ 3. 重启机器 This change will only take effect the next time the elasticsearch user opens a new session. > Ubuntu下进程由init.d开启,会忽略/etc/security/limits.conf > Ubuntu ignores the limits.conf file for processes started by init.d. To enable the limits.conf file, edit /etc/pam.d/su and uncomment the following line: * * * * * #### 2. deb安装(推荐) ~~~ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.deb sha1sum elasticsearch-5.5.1.deb # 数据校验 可不做 sudo dpkg -i elasticsearch-5.5.1.deb sudo service elasticsearch start #启动 ~~~ #### 3.tar包 ~~~ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.tar.gz sha1sum elasticsearch-5.5.1.tar.gz tar -xzf elasticsearch-5.5.1.tar.gz cd elasticsearch-5.5.1/ ./bin/elasticsearch # 启动 ~~~ ### 2. 安装head插件 1. elasticsearch.yml加入 ~~~ http.cors.enabled: true http.cors.allow-origin: "*" ~~~ 2. 下载安装head ~~~ sudo ln -s /usr/bin/nodejs /usr/bin/node git clone https://github.com/mobz/elasticsearch-head cd elasticsearch-head npm install -g grunt --registry=https://registry.npm.taobao.org npm install npm install grunt --save # 启动服务 cd /home/tuna/elasticsearch-head/node_modules/grunt/bin nohup ./grunt server >/dev/null 2>&1 & ~~~ > * 访问 http://192.168.56.130:9100/