# Initialization elastricsearch fail

**URL:** <https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282>\
**Category:** Elasticsearch\
**Created:** [July 25, 2015, 7:49am UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282 "2015-07-25T07:49:45Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![satimis](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@satimis](https://discuss.elastic.co/u/satimis)\
**Post date:** [July 25, 2015, 7:49am UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/1 "2015-07-25T07:49:45Z")

</div>

Hi all,

I followed;  
How To Install Elasticsearch on an Ubuntu VPS

> **[How To Install Elasticsearch on an Ubuntu VPS | DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-on-an-ubuntu-vps)**
>
> In this tutorial, we will download, install, and start using Elasticsearch on Ubuntu. The steps provided have currently been tested on: Ubuntu 12.04.3 x64 and Ubuntu 13.10 x64.

Coming to;  
Test your Elasticsearch install

Performed;  
⟫ cd /usr/share/elasticsearch/

⟫ sudo chmod u+x ./bin/elasticsearch

⟫ ./bin/elasticsearch  
./bin/elasticsearchsatimis@ub1404dkpc1a03:/usr/share/elasticsearch⟫ log4j:WARN No appenders could be found for logger (node).  
log4j:WARN Please initialize the log4j system properly.  
log4j:WARN See [http://logging.apache.org/log4j/1.2/faq.html#noconfig](http://logging.apache.org/log4j/1.2/faq.html#noconfig) for more info.  
{0.90.7}: Initialization Failed ...

- ElasticSearchIllegalStateException[Failed to obtain node lock, is the following location writable?: [/usr/share/elasticsearch/data/elasticsearch]]  
IOException[failed to obtain lock on /usr/share/elasticsearch/data/elasticsearch/nodes/49]  
IOException[Cannot create directory: /usr/share/elasticsearch/data/elasticsearch/nodes/49]

Please help. Thanks

satimis

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 25, 2015, 8:42am UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/2 "2015-07-25T08:42:28Z")

</div>

First of all, that tutorial tells you to download ES 0.90.7. That's a _really_ old release. Pick a more recent one instead. IIRC the latest is 1.7.

The error message says that /usr/share/elasticsearch/data/elasticsearch isn't writable to the current user. You can fix that by e.g. running ES as root (not recommended) or changing ownership and/or permissions for the directory in question so that the user you want to run ES as has sufficient permissions.

I wonder how you ended up in this situation in the first place though. Did you unpack the archive as root and attempt to run ES as yourself? If you unpack the archive as yourself that files will automatically have sane permissions.

---

<div class="post-metadata">

**Author:** ![satimis](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@satimis](https://discuss.elastic.co/u/satimis)\
**Post date:** [July 25, 2015, 10:23am UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/3 "2015-07-25T10:23:11Z")

</div>

Hi,

Thanks for your advice.

I'll start another round. I installed Elastricsearch on a VM of VirtualBox. I just clone another VM for the new test.

I ran;  
⟫ sudo dpkg -i elasticsearch-0.90.7.deb  
to install the package.

Regards  
satimis

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 25, 2015, 10:35am UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/4 "2015-07-25T10:35:13Z")

</div>

Again, don't use ES 0.90.7. It's old. Use 1.7.

---

<div class="post-metadata">

**Author:** ![satimis](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@satimis](https://discuss.elastic.co/u/satimis)\
**Post date:** [July 25, 2015, 10:59am UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/5 "2015-07-25T10:59:41Z")

</div>

Yes, I'll download;  
⟫ wget [https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.7.0.deb](https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.7.0.deb)

satimis

---

<div class="post-metadata">

**Author:** ![satimis](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@satimis](https://discuss.elastic.co/u/satimis)\
**Post date:** [July 25, 2015, 3:35pm UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/6 "2015-07-25T15:35:37Z")

</div>

Have another round on a newly cloned VM. Install elasticsearch-1.7.0.deb

It went through without problem except;

⟫ cd /usr/share/elasticsearch/  
⟫ ./bin/elasticsearch  
Failed to configure logging...  
org.elasticsearch.ElasticsearchException: Failed to load logging configuration  
at org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:142)  
at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:92)  
at org.elasticsearch.bootstrap.Bootstrap.setupLogging(Bootstrap.java:131)  
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:216)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)  
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:126)  
at org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:126)  
... 4 more  
log4j:WARN No appenders could be found for logger (node).  
log4j:WARN Please initialize the log4j system properly.  
log4j:WARN See [http://logging.apache.org/log4j/1.2/faq.html#noconfig](http://logging.apache.org/log4j/1.2/faq.html#noconfig) for more info.  
{1.7.0}: Initialization Failed ...

- ElasticsearchIllegalStateException[Failed to created node environment]  
AccessDeniedException[/usr/share/elasticsearch/data]  
org.elasticsearch.ElasticsearchIllegalStateException: Failed to created node environment  
at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:167)  
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:77)  
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:245)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)  
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data  
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.env.NodeEnvironment.(NodeEnvironment.java:132)  
at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:165)  
... 4 more

Other steps went through without problem same as described on that article

Regards  
satimis

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 25, 2015, 4:38pm UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/7 "2015-07-25T16:38:27Z")

</div>

When using the Debian package, start and stop the service with the init script.

```
/etc/init.d/elasticsearch start
/etc/init.d/elasticsearch stop
```

---

<div class="post-metadata">

**Author:** ![satimis](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@satimis](https://discuss.elastic.co/u/satimis)\
**Post date:** [July 26, 2015, 1:07am UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/8 "2015-07-26T01:07:19Z")

</div>

Thanks.

Previously running;  
⟫ cd /usr/share/elasticsearch/  
⟫ ./bin/elasticsearch  
Failed to configure logging...  
org.elasticsearch.ElasticsearchException: Failed to load logging configuration  
at org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:142)  
at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:92)  
at org.elasticsearch.bootstrap.Bootstrap.setupLogging(Bootstrap.java:131)  
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:216)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)  
Caused by: java.nio.file.NoSuchFileException: /usr/share  
.....  
....

What does the error indicate?

Where can I find tutorial and examples on using "Elasticsearch"?

Thanks

Regards  
satimis

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 26, 2015, 8:33am UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/9 "2015-07-26T08:33:21Z")

</div>

> What does the error indicate?

The Debian package is installed with a directory layout that isn't compatible with the way of starting ES that you've tried. Use the init script as I described earlier.

> Where can I find tutorial and examples on using "Elasticsearch"?

Have you read the documentation available at [elastic.co](http://elastic.co)?

---

<div class="post-metadata">

**Author:** ![satimis](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@satimis](https://discuss.elastic.co/u/satimis)\
**Post date:** [July 26, 2015, 12:18pm UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/10 "2015-07-26T12:18:14Z")

</div>

Thanks for your advice and link. I found them before but haven't gone through them in detail. Also before posting I have been searching a while on Internet and found many documentations, such as;

- 10 Minute Walk Through
- ElasticSearch in 5 minutes
- Discover the ElasticSearch search engine - First-time Visitors
- Uses of Elasticsearch, and Things to Learn  
etc. including many video on Youtube

As a beginner I hesitate where shall I start first after installing Elasticsearch? avoiding going to the wrong direction. What will be the typical application of ES?

Regards  
satimis

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 26, 2015, 12:49pm UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/11 "2015-07-26T12:49:48Z")

</div>

ES is used for a lot of things, including full-text search of blog, newspaper articles, source code, and logs. Presumably you had some kind of idea of what you wanted to do with ES when you started looking into it.

---

<div class="post-metadata">

**Author:** ![satimis](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@satimis](https://discuss.elastic.co/u/satimis)\
**Post date:** [July 26, 2015, 2:14pm UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/12 "2015-07-26T14:14:33Z")

</div>

Hi,

Yes, I have data in my computer built in past years and they are continue to increase daily. The data are documentation which I used for building websites, new computers, use on applications/software which I leant and used previously etc. How can I use ES to search those data to find out what I need? Rather than screening directory to directory reading the tiles on files retained in each directory etc. This will be my first start using ES.

Thanks

Regards  
satimis

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 26, 2015, 2:43pm UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/13 "2015-07-26T14:43:12Z")

</div>

There are of course already lots of programs for indexing and searching data in local files so I'm assuming you want to use ES as a learning exercise and/or have something to hack on.

You'd have to write a program that scans your local disk, extracts text and other relevant information from the files you find ([Apache Tika](https://tika.apache.org/) can help you with that), and posts the text to ES together with information about the path to the file from which the text was extracted.

---

<div class="post-metadata">

**Author:** ![satimis](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@satimis](https://discuss.elastic.co/u/satimis)\
**Post date:** [July 27, 2015, 8:09am UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/14 "2015-07-27T08:09:45Z")

</div>

Hi,

Could you please throw me some light how to start?

On my database, for example:  
$ ls Satimis\_Data\_PC1A\_20150606/Satimis\_Document\_20150606

```auto
Bill_n_Conference_20150422 Misc_HepB_HepC_n_Others_20120531_20150423
Cloud_Open_Source_20120902_20131224 Music_Photo_Video_20120531_20150422
ISO_n_Sofware_20100613_20150724 Old_n_New_Documents_20121228_20150606
Linux_Unix_BSD_20100614_20150606 Virtual_Mail_Boxes_Perdition_20120531cp
Misc_Document_20120531_20131220 Windows
Misc_Foods_20120531_20150606
```

$ ls Satimis\_Data\_PC1A\_20150606/Web\_Documents\_n\_ISP\_20130114\_20150606/

```auto
Finance_20121228_20130831 HKBN_broadband_20150606
Godaddy_20121228_20141231 Hostgator_20130831_20140620
GoPublic_20120531_20131220 Webpage_Design_20160606
```

etc.

Under above directories there are subdirectories. Most the files under them are .txt files and some .pdf files. Besides I couldn't forecast what will be searched in future.

Thanks

Regards  
satimis

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 27, 2015, 8:23pm UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/15 "2015-07-27T20:23:24Z")

</div>

So... write a program that traverses these directories and locates files, collects the text content of them (using e.g. Apache Tika to process the PDFs) and post each file as a document to ES. I don't know what else to describe without writing the code for you.

I wouldn't be terribly surprised if someone has already done something very similar.

---

<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:58pm UTC](https://discuss.elastic.co/t/initialization-elastricsearch-fail/26282/16 "2017-07-05T23:58:48Z")

</div>


