# Installing elasticsearch & running for the first time

**URL:** <https://discuss.elastic.co/t/installing-elasticsearch-running-for-the-first-time/40537>\
**Category:** Elasticsearch\
**Created:** [January 30, 2016, 2:53am UTC](https://discuss.elastic.co/t/installing-elasticsearch-running-for-the-first-time/40537 "2016-01-30T02:53:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![w0lverine](https://avatars.discourse-cdn.com/v4/letter/w/90db22/32.png) [@w0lverine](https://discuss.elastic.co/u/w0lverine)\
**Post date:** [January 30, 2016, 2:53am UTC](https://discuss.elastic.co/t/installing-elasticsearch-running-for-the-first-time/40537/1 "2016-01-30T02:53:16Z")

</div>

When I first run ./elasticsearch I get the following errors. I know I am running as root which is the cause of running elasticsearch but when I do not I get access denied to the jdk files.

When I do not run as root. I get the following output:

> Failed to configure logging...  
> ElasticsearchException[Failed to load logging configuration]; nested: NoSuchFileException[/usr/share/elasticsearch/config];  
> at org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:158)  
> at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:103)  
> at org.elasticsearch.bootstrap.Bootstrap.setupLogging(Bootstrap.java:204)  
> at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:258)  
> at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)  
> Caused by: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/config  
> at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)  
> at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)  
> at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)  
> at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)  
> at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)  
> at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:97)  
> at java.nio.file.Files.readAttributes(Files.java:1686)  
> at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:109)  
> at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:69)  
> at java.nio.file.Files.walkFileTree(Files.java:2602)  
> at org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:142)  
> ... 4 more  
> log4j:WARN No appenders could be found for logger (bootstrap).  
> log4j:WARN Please initialize the log4j system properly.  
> log4j:WARN See [Apache log4j 1.2 - Frequently Asked Technical Questions](http://logging.apache.org/log4j/1.2/faq.html#noconfig) for more info.  
> Exception in thread "main" java.lang.IllegalStateException: Unable to access 'path.conf' (/usr/share/elasticsearch/config)
> 
> > Likely root cause: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/config  
> > 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:383)  
> > at java.nio.file.Files.createDirectory(Files.java:630)  
> > at java.nio.file.Files.createAndCheckIsDirectory(Files.java:734)  
> > at java.nio.file.Files.createDirectories(Files.java:720)  
> > at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:250)  
> > at org.elasticsearch.bootstrap.Security.addPath(Security.java:227)  
> > at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:194)  
> > at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:184)  
> > at org.elasticsearch.bootstrap.Security.configure(Security.java:105)  
> > at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:196)  
> > at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167)  
> > at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)  
> > at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)  
> > Refer to the log for complete error details.

Here is my log node log:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/6/61aef0b4167bf663c6785b02522cfdc43c744261.png)

I can not install openjdk without being root and I think elasticsearch can not access openjdk because it is not running as root. Any suggestions?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 30, 2016, 3:07am UTC](https://discuss.elastic.co/t/installing-elasticsearch-running-for-the-first-time/40537/2 "2016-01-30T03:07:21Z")

</div>

Please don't post images of text like that, they are not always readable.

> [@w0lverine](#):
>
> I can not install openjdk without being root and I think elasticsearch can not access openjdk because it is not running as root.

Nope, **you should never run ES as root!**

You should really start ES using `service elasticsearch start`.

---

<div class="post-metadata">

**Author:** ![w0lverine](https://avatars.discourse-cdn.com/v4/letter/w/90db22/32.png) [@w0lverine](https://discuss.elastic.co/u/w0lverine)\
**Post date:** [January 30, 2016, 3:24am UTC](https://discuss.elastic.co/t/installing-elasticsearch-running-for-the-first-time/40537/3 "2016-01-30T03:24:38Z")

</div>

When I run the script I am told:  
"You need root privileges to run this script"

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 30, 2016, 3:41am UTC](https://discuss.elastic.co/t/installing-elasticsearch-running-for-the-first-time/40537/4 "2016-01-30T03:41:27Z")

</div>

Then use `sudo service elasticsearch start`

---

<div class="post-metadata">

**Author:** ![w0lverine](https://avatars.discourse-cdn.com/v4/letter/w/90db22/32.png) [@w0lverine](https://discuss.elastic.co/u/w0lverine)\
**Post date:** [January 30, 2016, 3:47am UTC](https://discuss.elastic.co/t/installing-elasticsearch-running-for-the-first-time/40537/5 "2016-01-30T03:47:19Z")

</div>

I did and I got the same log as I 1st posted. I was using openjdk so I reconfigured everything and installed java 8 as recommended and has fixed the issue! Thanks for your help. Many more to come for sure.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:20pm UTC](https://discuss.elastic.co/t/installing-elasticsearch-running-for-the-first-time/40537/6 "2017-07-05T23:20:12Z")

</div>


