进入bin目录启动elasticsearch:

lunadeMacBook-Air:elasticsearch-6.1.0 luna$ cd bin/
lunadeMacBook-Air:bin luna$ sudo ./elasticsearch
Password:
[2018-02-04T17:15:48,785][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-6.1.0.jar:6.1.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.1.0.jar:6.1.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.1.0.jar:6.1.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.1.0.jar:6.1.0]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.1.0.jar:6.1.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.1.0.jar:6.1.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[elasticsearch-6.1.0.jar:6.1.0]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:104) ~[elasticsearch-6.1.0.jar:6.1.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:171) ~[elasticsearch-6.1.0.jar:6.1.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:322) ~[elasticsearch-6.1.0.jar:6.1.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.1.0.jar:6.1.0]
... 6 more

由于elasticsearch权限控制严格,不能用root用户启动。

那就把elasticsearch这个文件夹授权个一个用户吧。

1、进入安装目录:

lunadeMacBook-Air:local luna$ cd
lunadeMacBook-Air:~ luna$ cd /usr/local/
lunadeMacBook-Air:local luna$ ll
total 0
drwxr-xr-x 11 root wheel 374 2 3 21:31 ./
drwxr-xr-x@ 10 root wheel 340 5 23 2017 ../
drwxr-xr-x 3 root wheel 102 8 29 14:01 CNCB/
drwxr-xr-x 5 root wheel 170 6 17 2016 bin/
drwxr-xr-x@ 12 luna wheel 408 2 4 17:27 elasticsearch-6.1.0/
drwx------ 8 luna wheel 272 2 3 21:08 lib/
drwxr-xr-x 3 root wheel 102 8 29 14:01 libexec/
drwxr-xr-x 2 root wheel 68 6 18 2017 mysql/
drwxr-xr-x 3 root wheel 102 11 14 00:41 redis/
drwxr-xr-x 3 root wheel 102 3 7 2017 remotedesktop/
drwxr-xr-x 6 luna wheel 204 2 3 21:08 tools/

2、授权 elasticsearch-6.1.0给我笔记本登陆用户luna

lunadeMacBook-Air:local luna$ sudo chown -R luna elasticsearch-6.1.0/

3 、启动

lunadeMacBook-Air:bin luna$ ./elasticsearch
[2018-02-04T17:27:51,275][INFO ][o.e.n.Node ] [] initializing ...
[2018-02-04T17:27:51,679][INFO ][o.e.e.NodeEnvironment ] [HcAbRrt] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [31.8gb], net total_space [111.8gb], types [hfs]
[2018-02-04T17:27:51,680][INFO ][o.e.e.NodeEnvironment ] [HcAbRrt] heap size [990.7mb], compressed ordinary object pointers [true]
[2018-02-04T17:27:51,684][INFO ][o.e.n.Node ] node name [HcAbRrt] derived from node ID [HcAbRrt4RVqvazgkI-W18Q]; set [node.name] to override
[2018-02-04T17:27:51,684][INFO ][o.e.n.Node ] version[6.1.0], pid[39966], build[c0c1ba0/2017-12-12T12:32:54.550Z], OS[Mac OS X/10.12.6/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_91/25.91-b14]
[2018-02-04T17:27:51,685][INFO ][o.e.n.Node ] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/usr/local/elasticsearch-6.1.0, -Des.path.conf=/usr/local/elasticsearch-6.1.0/config]
[2018-02-04T17:27:54,536][INFO ][o.e.p.PluginsService ] [HcAbRrt] loaded module [aggs-matrix-stats]
[2018-02-04T17:27:54,536][INFO ][o.e.p.PluginsService ] [HcAbRrt] loaded module [analysis-common]
[2018-02-04T17:27:54,537][INFO ][o.e.p.PluginsService ] [HcAbRrt] loaded module [ingest-common]
[2018-02-04T17:27:54,537][INFO ][o.e.p.PluginsService ] [HcAbRrt] loaded module [lang-expression]
[2018-02-04T17:27:54,537][INFO ][o.e.p.PluginsService ] [HcAbRrt] loaded module [lang-mustache]
[2018-02-04T17:27:54,538][INFO ][o.e.p.PluginsService ] [HcAbRrt] loaded module [lang-painless]
[2018-02-04T17:27:54,538][INFO ][o.e.p.PluginsService ] [HcAbRrt] loaded module [mapper-extras]
[2018-02-04T17:27:54,539][INFO ][o.e.p.PluginsService ] [HcAbRrt] loaded module [parent-join]
[2018-02-04T17:27:54,539][INFO ][o.e.p.PluginsService ] [HcAbRrt] loaded module [percolator]
[2018-02-04T17:27:54,539][INFO ][o.e.p.PluginsService ] [HcAbRrt] loaded module [reindex]
[2018-02-04T17:27:54,539][INFO ][o.e.p.PluginsService ] [HcAbRrt] loaded module [repository-url]
[2018-02-04T17:27:54,539][INFO ][o.e.p.PluginsService ] [HcAbRrt] loaded module [transport-netty4]
[2018-02-04T17:27:54,539][INFO ][o.e.p.PluginsService ] [HcAbRrt] loaded module [tribe]
[2018-02-04T17:27:54,540][INFO ][o.e.p.PluginsService ] [HcAbRrt] no plugins loaded
[2018-02-04T17:27:59,914][INFO ][o.e.d.DiscoveryModule ] [HcAbRrt] using discovery type [zen]
[2018-02-04T17:28:01,155][INFO ][o.e.n.Node ] initialized
[2018-02-04T17:28:01,155][INFO ][o.e.n.Node ] [HcAbRrt] starting ...
[2018-02-04T17:28:02,013][INFO ][o.e.t.TransportService ] [HcAbRrt] publish_address {127.0.0.1:9300}, bound_addresses {[fe80::1]:9300}, {[::1]:9300}, {127.0.0.1:9300}
[2018-02-04T17:28:05,130][INFO ][o.e.c.s.MasterService ] [HcAbRrt] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {HcAbRrt}{HcAbRrt4RVqvazgkI-W18Q}{sLMjeORSTb-oR3nm1ZFjNQ}{127.0.0.1}{127.0.0.1:9300}
[2018-02-04T17:28:05,144][INFO ][o.e.c.s.ClusterApplierService] [HcAbRrt] new_master {HcAbRrt}{HcAbRrt4RVqvazgkI-W18Q}{sLMjeORSTb-oR3nm1ZFjNQ}{127.0.0.1}{127.0.0.1:9300}, reason: apply cluster state (from master [master {HcAbRrt}{HcAbRrt4RVqvazgkI-W18Q}{sLMjeORSTb-oR3nm1ZFjNQ}{127.0.0.1}{127.0.0.1:9300} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2018-02-04T17:28:05,203][INFO ][o.e.h.n.Netty4HttpServerTransport] [HcAbRrt] publish_address {127.0.0.1:9200}, bound_addresses {[fe80::1]:9200}, {[::1]:9200}, {127.0.0.1:9200}
[2018-02-04T17:28:05,203][INFO ][o.e.n.Node ] [HcAbRrt] started
[2018-02-04T17:28:05,207][INFO ][o.e.g.GatewayService ] [HcAbRrt] recovered [0] indices into cluster_state

启动成功!

4、在浏览器请求  127.0.0.1:9200

{
"name" : "HcAbRrt",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "saU-coKOQpW20NJKg_zzfA",
"version" : {
"number" : "6.1.0",
"build_hash" : "c0c1ba0",
"build_date" : "2017-12-12T12:32:54.550Z",
"build_snapshot" : false,
"lucene_version" : "7.1.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}

elasticsearch: can not run elasticsearch as root的更多相关文章

  1. java.lang.RuntimeException: can not run elasticsearch as root

    忘写了一个错误: [o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main] org.el ...

  2. docker run elasticsearch

    docker run -d --name=esNode1 -p 9200:9200 -p 9300:9300 elasticsearch:2.3 -Des.network.publish_host=& ...

  3. 【linux】【elasticsearch】docker部署elasticsearch及elasticsearch-head

    前言 Elasticsearch是一个基于Apache Lucene(TM)的开源搜索引擎.无论在开源还是专有领域,Lucene可以被认为是迄今为止最先进.性能最好的.功能最全的搜索引擎库.但是,Lu ...

  4. ElasticSearch实战系列一: ElasticSearch集群+Kinaba安装教程

    前言 本文主要介绍的是ElasticSearch集群和kinaba的安装教程. ElasticSearch介绍 ElasticSearch是一个基于Lucene的搜索服务器,其实就是对Lucene进行 ...

  5. vsftpd:500 OOPS: vsftpd: refusing to run with writable root inside chroot ()错误的解决方法

    ---恢复内容开始--- 最近在安装了vsftpd后 添加了虚拟账户后 新建用户 为新用户创立独立的工作目录 因为虚拟用户在工作目录需要上传文件 所以必须拥有此目录的W权限,但每当给此目录加上W权限后 ...

  6. 解决vsftpd的refusing to run with writable root inside chroot错误

    参考 http://www.cnblogs.com/CSGrandeur/p/3754126.html 在Ubuntu下用 vsftpd 配置FTP服务器,配置 “ sudo chmod a-w /h ...

  7. 500 OOPS: vsftpd: refusing to run with writable root inside chroot()

    Ubuntu 12.04 64bit系统下安装的vsftpd,在登陆时提示500 OOPS: vsftpd: refusing to run with writable root inside chr ...

  8. ubuntu 14.04 下FTP服务器的搭建--锁定用户目录,解决vsftpd: refusing to run with writable root inside chroot()

    FTP服务器的搭建,我要实现的需求是: 不允许匿名访问,因为我的机器不想让谁都能登录上来,随便获取文件, 需要锁定一个目录,因为在家里,我需要给媳妇下载一些电影 韩剧之类的东西,媳妇会来我机器下载,但 ...

  9. 500 OOPS: vsftpd: refusing to run with writable root inside chroot()解决方法

    vsftpd.conf配置文件如下: [root@rusky ~]# cat /etc/vsftpd/vsftpd.conf | grep -v "#" anonymous_ena ...

随机推荐

  1. python入门基础 02

    目录 1.while 2.字符串格式化 3.运算符 4.编码初始 总结 1.while # while -- 关键字 (死循环) # # if 条件: # 结果 # # while 条件: # 循环体 ...

  2. python预习day1

    计算机基础 cpu 大脑 内存 临时记忆 硬盘 永久记忆 输入设备 眼睛 耳朵 输出设备 嘴巴 操作系统 控制计算机硬件工作流程的 应用程序 安装在操作系统之上的软件 python简介 python是 ...

  3. 基于xilinx Zynq UltraScale MPSoC平台的核心板及开发板介绍-米尔科技

    近日,米尔科技推出国内首款基于xilinx Zynq UltraScale+MPSoC 平台的核心板及开发板.其优势主要有:采用16纳米制程,相比Znyq7000系列每瓦性能提升5倍,且单芯片融合4核 ...

  4. log4j使用指北

    背景 工作一直使用日志组件,但是配置却一直看的糊里糊涂的,只记得个日志级别,其他的都不太理解,例如,一个页面日志太多,怎么样能单独打印?所以就找机会整理了一下. 本文参考:https://www.cn ...

  5. 使用 shell 脚本配置 iOS 工程

      APP开发过程中,往往需要在多个网络环境或配置中进行切换,以获取不同配置的APP,甚至有时需要用一套代码经过简单的配置生成不同的APP.而手动配置费时费力,且容易出错.这里介绍用脚本工具,去生成不 ...

  6. unity 用LineRender画四边形并测面积

    作为一个菜鸡,这个高中数学题差不多废了我两个上午...好了,废话不多说,直接上代码... using System.Collections.Generic; using UnityEngine; pu ...

  7. Eclipse上Maven环境配置使用

    1. 安装配置Maven: 1.1 从Apache网站 http://maven.apache.org/ 下载并且解压缩安装Apache Maven. Maven下载地址: http://maven. ...

  8. Django设置应用名与模型名为中文

    修改polls包里面的apps.py: from django.apps import AppConfig class PollsConfig(AppConfig): name = 'polls' v ...

  9. CentOS7安装Postman

    1. 进入官网:https://www.getpostman.com/downloads/2. 点击下载3. 直接安装:tar zxvf ***.tar.gz4. 确认当前目录: pwd /home/ ...

  10. Multi-Task Feature Learning for Knowledge Graph Enhanced Recommendation(知识图谱)

    知识图谱(Knowledge Graph,KG)可以理解成一个知识库,用来存储实体与实体之间的关系.知识图谱可以为机器学习算法提供更多的信息,帮助模型更好地完成任务. 在推荐算法中融入电影的知识图谱, ...