Elasticsearch/Elasticsearchhead安装总结

#下载
 wget http://yellowcong.qiniudn.com/elasticsearch-6.0.0.tar.gz
#解压
 tar -zxvf elasticsearch-6.0.0.tar.gz
 #添加用户
 adduser jing   
#设定密码
 passwd jing
#添加权限
 chown -R yellowcong  elasticsearch-6.0.0
#切换用户
 su jing 
#查看当前用户
 who am i
#启动elasticsearch
#修改sysctl配置
 vim /etc/sysctl.conf
#添加如下配置
 vm.max_map_count=655360
#让配置生效
 sysctl -p
#查看配置的数目
 sysctl -a|grep vm.max_map_count
#配置limits.conf
 vim /etc/security/limits.conf
 #jing 是用户名
 jing  hard    nofile  65536
 jing  soft    nofile  65536
#重新登录 jing 账户,查看是否生效
 su jing
#查看配置是否生效
 ulimit -Hn
 #修改elasticsearch.yml文件
 bootstrap.memory_lock: false
 bootstrap.system_call_filter: false
 head插件安装
 先安装,nvm,即是Node Version Manager(Node版本管理器)
 #使用  wget安装
 wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
 #激活nvm
 source ~/.nvm/nvm.sh
 #激活完成后,安装node
 nvm install node 
 #安装完成后,切换到该版本
 nvm use node
 #node验证
 node -v
 npm -v
#修改elasticsearch.yml文件
 #增加参数,使head插件可以访问es  
 http.cors.enabled: true  
 http.cors.allow-origin: "*"
#下载head插件
URL:https://codeload.github.com/mobz/elasticsearch-head/zip/master
 wget  https://github.com/mobz/elasticsearch-head/archive/master.zip
 #解压后 存放在 /usr/local/下 注:不要放在/elasticsearch-6.0.0/plugins下
 #安装grunt
 npm install -g grunt-cli
 grunt -version
 #修改服务器监听地址:Gruntfile.js
         connect: {
             server: {
                 options: {
                     port: 9100,
                     base: '.',
                     keepalive: true,
                     hostname: '*'
                 }
             }
         }
 #修改连接地址:_site/app.js
         init: function(parent) {
             this._super();
             this.prefs = services.Preferences.instance();
             this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.2.130:9200";
             
             
 #在elasticsearch-head-master目录下
 npm install(安装下载下来的包)
 #可以采用screen放在后台运行,不然退出ssh后grunt进程就关闭了。
 grunt server &
 #grunt server  退出ssh后grunt进程就关闭
#启动elastic服务
 elasticsearch-6.0.0/bin/elasticsearch
#后台启动
 elasticsearch-6.0.0/bin/elasticsearch -d
以上是 Elasticsearch/Elasticsearchhead安装总结 的全部内容, 来源链接: utcz.com/z/509151.html

