# Will Index Alias solve my issue?

**URL:** <https://discuss.elastic.co/t/will-index-alias-solve-my-issue/36834>\
**Category:** Logstash\
**Created:** [December 10, 2015, 6:25am UTC](https://discuss.elastic.co/t/will-index-alias-solve-my-issue/36834 "2015-12-10T06:25:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aravinthan\_Asokan](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Aravinthan\_Asokan](https://discuss.elastic.co/u/Aravinthan_Asokan)\
**Post date:** [December 10, 2015, 6:25am UTC](https://discuss.elastic.co/t/will-index-alias-solve-my-issue/36834/1 "2015-12-10T06:25:46Z")

</div>

Currently I am using Ubuntu 14.04 with 4GB RAM.

My Data size is more than 5GB to index. I am getting below error  
Settings: Default filter workers: 1  
Logstash startup completed  
java.lang.OutOfMemoryError: Java heap space  
Dumping heap to /opt/logstash/heapdump.hprof ...  
Unable to create /opt/logstash/heapdump.hprof: File exists  
Exception when executing JDBC query {:exception=\>#\<Sequel::DatabaseError: Java::JavaLang::OutOfMemoryError: Java heap space\>, :level=\>:warn}  
Logstash shutdown completed

Even I tried to increase the HEAP SIZE to 2 or 3GB it would work. I thought of doing Alias for same Index Multiple db select query and create 2 or there Index with Alias to single Index Name .

As I am new how to do it in logstash jdbc input/output ? setting Alias in output , my codes below  
input {  
jdbc {  
jdbc\_driver\_library =\>"/usr/share/java/mysql-connector-java.jar"  
jdbc\_driver\_class =\>"com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://xxxxx.rds.amazonaws.com:3306/dbname"  
jdbc\_user =\> "username"  
jdbc\_password =\> "password"  
jdbc\_validate\_connection =\> true  
statement =\> "SELECT \* from table "  
}  
}  
output {  
elasticsearch {  
index =\>"my\_index"  
document\_type =\> "xyz"  
document\_id =\> "%{id}"  
hosts =\> "xx.xxx.xxx.xx"  
}  
}

Please suggest how to use Alias or other way to fix my issue

---

<div class="post-metadata">

**Author:** ![bleskes](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bleskes](https://discuss.elastic.co/u/bleskes)\
**Post date:** [December 10, 2015, 2:43pm UTC](https://discuss.elastic.co/t/will-index-alias-solve-my-issue/36834/2 "2015-12-10T14:43:57Z")

</div>

The big question is why logstash went OOM. I suggest you ask this question in the logstash topic. You are likely to get a more targeted answer 🙂

---

<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 6, 2017, 5:19am UTC](https://discuss.elastic.co/t/will-index-alias-solve-my-issue/36834/3 "2017-07-06T05:19:03Z")

</div>

Closed on July 6, 2017, 5:19am UTC


