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 ...
随机推荐
- 五 查询数据SELECT 一、单表查询
一 单表查询的语法 二 关键字的执行优先级 三 简单查询 四 WHERE约束 五 分组查询:GROUP BY 六 HAVING过滤 七 查询排序:ORDER BY 八 限制查询的记录数:LIMIT 九 ...
- if __name__ == '__main__' 该如何理解
Python 中的 if __name__ == '__main__' 该如何理解 程序入口 对于很多编程语言来说,程序都必须要有一个入口,比如 C,C++,以及完全面向对象的编程语言 Java,C# ...
- JavaWeb 之 BeanUtils 工具类
在上一个用户登录案例中,当从浏览器接收参数后,还需要创建 JavaBean 类,对其的属性每一项赋值,如果属性少,可以手动完成,但是当属性非常多,这时就发现非常不方便,在这里提供一个可以封装 Java ...
- jmeter的简单使用0723
一.添加http请求 1.右击线程组---添加---取样器---http请求,具体内容如下图所示.如果请求带参数,则要点击下方的添加按钮来添加参数 2.查看请求结果,同样右击线程组-添加---监听器- ...
- Linux 服务控制与运行级别
如何控制服务的运行状态?如何切换不同的运行级别? 服务控制 ntsysv 仿图形交互界面,集中配置各种服务启动状态 --level 35:同时对指定运行级别中的服务进行管理,不加仅管理当前运行级别中的 ...
- 【异常(待解决)】org.apache.http.NoHttpResponseException: api.weixin.qq.com:443 failed to respond
一.记录下异常堆栈信息 -- ::-exec-] ERROR weixin.popular.client.LocalHttpClient - execute error org.apache.http ...
- Linux命令——basename、dirname
简介 这2个命令多用于shell脚本 用法 basename filename_will_full_path dirname filename_will_full_path 对于但后缀的情况,base ...
- 利用ViewStub实现布局懒惰加载
这个问题也是头条面试官问的,本身没什么难度,但以前确实没仔细研究过. 1.使用介绍 ViewStub是一种不可见的尺寸为0的View,用来实现布局资源的懒加载.当ViewStub被设置为用户可见或其 ...
- X509IncludeOption 枚举
X509IncludeOption 枚举 指定 X.509 数据应包括 X.509 证书链的哪些内容. EndCertOnly 2 X.509 链信息中仅包括最终证书. ExcludeRoot 1 包 ...
- 【Selenium-WebDriver实战篇】基于java的selenium之验证码识别内容
==================================================================================================== ...