# How to build an embedded node in 5.x

**URL:** <https://discuss.elastic.co/t/how-to-build-an-embedded-node-in-5-x/63925>\
**Category:** Elasticsearch\
**Created:** [October 25, 2016, 7:13pm UTC](https://discuss.elastic.co/t/how-to-build-an-embedded-node-in-5-x/63925 "2016-10-25T19:13:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dminkovsky](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dminkovsky/32/12725_2.png) [@dminkovsky](https://discuss.elastic.co/u/dminkovsky)\
**Post date:** [October 25, 2016, 7:13pm UTC](https://discuss.elastic.co/t/how-to-build-an-embedded-node-in-5-x/63925/1 "2016-10-25T19:13:09Z")

</div>

I've used embedded Nodes for integration testing. Prior to 5.x, I could build a Node using the NodeBuilder. Now that builder is gone. How do I build an embedded node for testing?

Looking at [Boostrap.java](https://github.com/elastic/elasticsearch/blob/v5.0.0-rc1/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java#L191), I am seeing:

```auto
        node = new Node(environment) {
            @Override
            protected void validateNodeBeforeAcceptingRequests(
                final Settings settings,
                final BoundTransportAddress boundTransportAddress) throws NodeValidationException {
                BootstrapCheck.check(settings, boundTransportAddress);
            }
        };

```

Is this the way?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [October 25, 2016, 7:54pm UTC](https://discuss.elastic.co/t/how-to-build-an-embedded-node-in-5-x/63925/2 "2016-10-25T19:54:37Z")

</div>

Running an embedded node isn't supported for anything, testing or otherwise. So you might be able to get it working now but it could fail on any release in the future. I suggest starting Elasticsearch before running integration tests in your build somehow.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 25, 2016, 8:04pm UTC](https://discuss.elastic.co/t/how-to-build-an-embedded-node-in-5-x/63925/3 "2016-10-25T20:04:05Z")

</div>

Yes. Read this: [https://www.elastic.co/blog/elasticsearch-the-server](https://www.elastic.co/blog/elasticsearch-the-server)

Here is how I solved that basically using some Maven/Ant vodoo:

- [http://david.pilato.fr/blog/2016/07/29/elasticsearch-real-integration-tests/](http://david.pilato.fr/blog/2016/07/29/elasticsearch-real-integration-tests/)
- [http://david.pilato.fr/blog/2016/08/03/elasticsearch-real-integration-tests-with-security-enabled/](http://david.pilato.fr/blog/2016/08/03/elasticsearch-real-integration-tests-with-security-enabled/)

You can also extend `ESIntegTestCase` as I described here: [http://david.pilato.fr/blog/2016/07/27/creating-a-plugin-for-elasticsearch-5-dot-0-using-maven/](http://david.pilato.fr/blog/2016/07/27/creating-a-plugin-for-elasticsearch-5-dot-0-using-maven/) (see Add test infrastructure).

HTH

---

<div class="post-metadata">

**Author:** ![dminkovsky](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dminkovsky/32/12725_2.png) [@dminkovsky](https://discuss.elastic.co/u/dminkovsky)\
**Post date:** [October 25, 2016, 8:59pm UTC](https://discuss.elastic.co/t/how-to-build-an-embedded-node-in-5-x/63925/4 "2016-10-25T20:59:08Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![pnowy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pnowy/32/19868_2.png) [@pnowy](https://discuss.elastic.co/u/pnowy)\
**Post date:** [June 19, 2017, 7:34pm UTC](https://discuss.elastic.co/t/how-to-build-an-embedded-node-in-5-x/63925/5 "2017-06-19T19:34:14Z")

</div>

You could also consider the embedded node for integration tests:

> **[allegro/embedded-elasticsearch](https://github.com/allegro/embedded-elasticsearch)**
>
> embedded-elasticsearch - Tool that ease up creation of integration tests with Elasticsearch

Hope it helps!

---

<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:** [November 4, 2022, 4:30am UTC](https://discuss.elastic.co/t/how-to-build-an-embedded-node-in-5-x/63925/6 "2022-11-04T04:30:48Z")

</div>


