Kibana plugin develop problem


(張皓翔) #1

Hi, I refer the instruction(https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#setting-up-your-development-environment) to try to develop a kibana plugin, but there are some problems.

at this step: yarn es snapshot
I can't run es snapshot as user mode because I install yarn at root.
I know ES can't run as root, so how can I do?
when I run as root:
[root@localhost kibana]# yarn es snapshot yarn run v1.9.0-20180614.1132 $ node scripts/es snapshot info Installing from snapshot │ info version: 7.0.0-alpha1 │ info install path: /run/media/es3/80967063-20eb-4c15-82d1-56e01f888254/kibana/.es/7.0.0-alpha1 │ info license: basic │ info downloading from https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-7.0.0-alpha1-SNAPSHOT.tar.gz │ info etags match, using cache from 2018-06-19T14:11:24.808Z │ info install directory already exists, removing │ info extracting /run/media/es3/80967063-20eb-4c15-82d1-56e01f888254/kibana/.es/cache/elasticsearch-7.0.0-alpha1-SNAPSHOT.tar.gz │ info extracted to /run/media/es3/80967063-20eb-4c15-82d1-56e01f888254/kibana/.es/7.0.0-alpha1 │ info setting bootstrap password to changeme info Starting │ debg bin/elasticsearch │ info [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:140) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ Caused by: java.lang.RuntimeException: can not run elasticsearch as root │ at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:103) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ ... 6 more │ERROR ES exited with code 1 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

thank you in advance!


(Larry Gregory) #2

Hi @f26227279,

Are you able to reinstall yarn as a user instead of root?

Otherwise, you could not use yarn for starting Elasticsearch and instead build it from source by cloning the repository and executing ./gradlew


(張皓翔) #3

Thanks for your reply!
Now I install yarn as a user, and when I go to this step yarn start, there are some problems.
this is the log:

 [wlogger@localhost kibana]$ yarn start
yarn run v1.9.0-20180614.1132
$ node scripts/kibana --dev
(node:10539) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
 failed to watch files!  Error: watch /home/wlogger/Downloads/kibana/x-pack/plugins/index_management/__jest__ ENOSPC
    at _errnoException (util.js:992:11)
    at FSWatcher.start (fs.js:1382:19)
    at Object.fs.watch (fs.js:1408:11)
    at createFsWatchInstance (/home/wlogger/Downloads/kibana/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/home/wlogger/Downloads/kibana/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/wlogger/Downloads/kibana/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/wlogger/Downloads/kibana/node_modules/chokidar/lib/nodefs-handler.js:407:19)
    at FSWatcher.<anonymous> (/home/wlogger/Downloads/kibana/node_modules/chokidar/lib/nodefs-handler.js:455:19)
    at FSWatcher.<anonymous> (/home/wlogger/Downloads/kibana/node_modules/chokidar/lib/nodefs-handler.js:460:16)
    at FSReqWrap.oncomplete (fs.js:153:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

thanks a lot!


(張皓翔) #4

change to root mode then it can run!


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.