设为首页 收藏本站
查看: 1149|回复: 0

[经验分享] elk 安装与所遇问题

[复制链接]

尚未签到

发表于 2019-1-28 08:42:33 | 显示全部楼层 |阅读模式
  系统centos6.7
  1,安装jdk-1.8.0
yum install java-1.8.0-openjdk  2,下载elasticsearch-2.4.3.tar.gz并安装
tar zxvf elasticsearch-2.4.3.tar.gz -C /opt
vi /opt/elasticsearch-2.4.3/conf/elasticsearch.yml  添加配置
network.host: 0.0.0.0#server绑定本地服务器内外网ip
http.cors.enabled: true
http.cors.allow-origin: "*"  3,启动
  报错
  penJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
  Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.
  at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:94)
  at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:160)
  at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286)
  at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:45)
  Refer to the log for complete error details.
  [root@vultr elasticsearch]# su es bin/elasticsearch
  OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
  [2016-12-29 08:56:59,510][WARN ][bootstrap                ] unable to install syscall filter: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
  Exception in thread "main" java.lang.IllegalStateException: Unable to access 'path.plugins' (/opt/elasticsearch/plugins)
  Likely root cause: java.nio.file.AccessDeniedException: /opt/elasticsearch/plugins
  at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
  at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
  at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
  at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
  at java.nio.file.Files.createDirectory(Files.java:674)
  at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
  at java.nio.file.Files.createDirectories(Files.java:767)
  at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:337)
  at org.elasticsearch.bootstrap.Security.addPath(Security.java:314)
  at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:246)
  at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:212)
  at org.elasticsearch.bootstrap.Security.configure(Security.java:118)
  at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:212)
  at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:183)
  at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286)
  at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:45)
  Refer to the log for complete error details.
  原因:1,新版本不允许用root启动,2,软件目录没相应的权限
  解决:
groupadd es
useradd -g es es
passwd es  重新启动:
su es -c /opt/elasticsearch-2.4.3/bin/elasticsearch -Xmx2g -Xms2g -
Des.index.storage.type=memory –d > /dev/null 2>&1 &”
#因为我用的是虚拟机,内存比较小,所以启动看实际情况 -Xmx2g 是最大内存 -Xms2g 是最小内存 -d 是后台运行
#我的运行命令是
su es -c /opt/elasticsearch/bin/elasticsearch –d > /dev/null 2>&1 &  安装插件:elasticsearch-head(是集群前段显示页面)
  切换到bin目录下 执行
./plugin install  mobz/elasticsearch-head  页面展示:http://localhost/_plugin/head
  测试:
  curl http://localhost:9200 出现一个json 数据表明启动成功,如下
{
    "status": 200,
    "name": "Omen",
    "version": {
        "number": "1.1.1",
        "build_hash": "f1585f096d3f3985e73456debdc1a0745f512bbc",
        "build_timestamp": "2014-04-16T14:27:12Z",
        "build_snapshot": false,
        "lucene_version": "4.7"
    },
    "tagline": "You Know, for Search"
}
  安装插件:elasticsearch-kopf
  执行命令:
./plugin install lmenezes/elasticsearch-kopf  页面展示:http://localhost/_plugin/bigdesk/
  

  4,安装kibana

tar zxvf kibana-4.6.3-linux-x86_64.tar.gz -C /opt  修改配置
  因为和elasticsearch 在同一台服务器上,所以只需要修改elasticsearch的链接地址
elasticsearch_url: http://localhost:9200  启动

bin/kibana -p 5601 > /dev/null 2>&1 &  意思是以5601端口启动
  然后以http://ip:5601访问就可以了





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-668493-1-1.html 上篇帖子: ELK的安装配置使用 下篇帖子: ELK实时日志分析平台(elk+kafka+metricbeat)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表