elasticsearch: can not run elasticsearch as root
进入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的更多相关文章
- java.lang.RuntimeException: can not run elasticsearch as root
		
忘写了一个错误: [o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main] org.el ...
 - docker run  elasticsearch
		
docker run -d --name=esNode1 -p 9200:9200 -p 9300:9300 elasticsearch:2.3 -Des.network.publish_host=& ...
 - 【linux】【elasticsearch】docker部署elasticsearch及elasticsearch-head
		
前言 Elasticsearch是一个基于Apache Lucene(TM)的开源搜索引擎.无论在开源还是专有领域,Lucene可以被认为是迄今为止最先进.性能最好的.功能最全的搜索引擎库.但是,Lu ...
 - ElasticSearch实战系列一:  ElasticSearch集群+Kinaba安装教程
		
前言 本文主要介绍的是ElasticSearch集群和kinaba的安装教程. ElasticSearch介绍 ElasticSearch是一个基于Lucene的搜索服务器,其实就是对Lucene进行 ...
 - vsftpd:500 OOPS: vsftpd: refusing to run with writable root inside chroot ()错误的解决方法
		
---恢复内容开始--- 最近在安装了vsftpd后 添加了虚拟账户后 新建用户 为新用户创立独立的工作目录 因为虚拟用户在工作目录需要上传文件 所以必须拥有此目录的W权限,但每当给此目录加上W权限后 ...
 - 解决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 ...
 - 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 ...
 - ubuntu 14.04 下FTP服务器的搭建--锁定用户目录,解决vsftpd: refusing to run with writable root inside chroot()
		
FTP服务器的搭建,我要实现的需求是: 不允许匿名访问,因为我的机器不想让谁都能登录上来,随便获取文件, 需要锁定一个目录,因为在家里,我需要给媳妇下载一些电影 韩剧之类的东西,媳妇会来我机器下载,但 ...
 - 500 OOPS: vsftpd: refusing to run with writable root inside chroot()解决方法
		
vsftpd.conf配置文件如下: [root@rusky ~]# cat /etc/vsftpd/vsftpd.conf | grep -v "#" anonymous_ena ...
 
随机推荐
- 2019 同程旅游java面试笔试题 (含面试题解析)
			
本人5年开发经验.18年年底开始跑路找工作,在互联网寒冬下成功拿到阿里巴巴.今日头条.同程等公司offer,岗位是Java后端开发,因为发展原因最终选择去了同程,入职一年时间了,之前面试了很多家公 ...
 - Python进阶----类的结构(公有成员 , 私有成员(私有属性,私有方法),类方法,静态方法,属性) ,isinstance 和issubcalss ,元类(type())
			
Python进阶----类的结构(公有成员 , 私有成员(私有属性,私有方法),类方法,静态方法,属性) ,isinstance 和issubcalss ,元类(type()) 一丶类的结构细分 ...
 - shell编程必须要掌握的命令-xargs
			
一,说xargs命令前,说一下什么是shell编程 什么是shell编程呢,说白了就是按一定的规则把各种命令组织起来,完成一定的事情.纯属个人理解,哈哈.不管是交互式的shell,还是非交互的shel ...
 - 通过创建一个简单的骰子游戏来探究 Python
			
在我的这系列的第一篇文章 中, 我已经讲解如何使用 Python 创建一个简单的.基于文本的骰子游戏.这次,我将展示如何使用 Python 模块 Pygame 来创建一个图形化游戏.它将需要几篇文章才 ...
 - 一个简单实现的string类
			
为了复习c++知识,简单的实现一个string类,类名为CMyString 环境说明:windows 7 64位 和 CentOS Linux release 7.6.1810 (Core) 开发工具 ...
 - 手写DAO框架(七)-如何保证连接可用
			
版权声明:本文为博客园博主「水木桶」的原创文章,遵循CC 4.0 by-sa版权协议,转载请附上原文出处链接及本声明.原文链接:https://www.cnblogs.com/shuimutong/p ...
 - JavaWeb 之 Filter 验证用户登录案例
			
需求: 1. 访问一个网站的资源.验证其是否登录 2. 如果登录了,则直接放行. 3. 如果没有登录,则跳转到登录页面,提示"您尚未登录,请先登录". 代码实现: import j ...
 - security Alternative forms secuerity
			
security Alternative forms secuerity (mostly obsolete) English Alternative forms secuerity Pronuncia ...
 - Pytorch 张量维度
			
Tensor类的成员函数dim()可以返回张量的维度,shape属性与成员函数size()返回张量的具体维度分量,如下代码定义了一个两行三列的张量: f = torch.randn(2, 3) pri ...
 - Spring  实例化Bean的3种方式
			
要使用Spring中的Bean,需要先创建这个Bean的实例. 实例化Bean有3种方式: 构造器方式 静态工厂方式 实例工厂方式 构造器方式 构造器方式是最常用的.在Bean中写构造函数,然后在配置 ...