# Pre and Prod instances

**URL:** <https://discuss.elastic.co/t/pre-and-prod-instances/91522>\
**Category:** Elasticsearch\
**Created:** [July 1, 2017, 4:44pm UTC](https://discuss.elastic.co/t/pre-and-prod-instances/91522 "2017-07-01T16:44:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xavi\_Montero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavi_montero/32/16964_2.png) [@Xavi\_Montero](https://discuss.elastic.co/u/Xavi_Montero)\
**Post date:** [July 1, 2017, 4:44pm UTC](https://discuss.elastic.co/t/pre-and-prod-instances/91522/1 "2017-07-01T16:44:22Z")

</div>

Hello, for a very small project, in MySQL I use just two separate DBs in the same server, like for example my-nice-project-prod and my-nice-project-pre.

What's up with ElasticSearch supporting several instances of the project in the same machine? I just want ElasticSearch as a storage of a few thousands of JSON documents. It's not a big data processing project now.

Do I have to run 2 instances listening to different ports? If under the same port... The only thing I can imagine now is like prefixing the indexes, but sound like ugly and weird. What solutions are usual to hold several project-instances under the same 9200 port?

Instead, opening new ports is like weird if I want to dynamically create project instances to make tests, other than pre and prod; like for example having: pre, prod, test1, test2, test3... till testn. It seems weird to have to "launch" a new server process for each test-instance; while playing with index names also sound weird.

What's the practice you are doing?

---

<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:** [July 1, 2017, 5:32pm UTC](https://discuss.elastic.co/t/pre-and-prod-instances/91522/2 "2017-07-01T17:32:02Z")

</div>

Elasticsearch is multi tenant so just name your indices accordingly as you would name 2 schemas in MySQL.

---

<div class="post-metadata">

**Author:** ![Xavi\_Montero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavi_montero/32/16964_2.png) [@Xavi\_Montero](https://discuss.elastic.co/u/Xavi_Montero)\
**Post date:** [July 1, 2017, 6:22pm UTC](https://discuss.elastic.co/t/pre-and-prod-instances/91522/3 "2017-07-01T18:22:48Z")

</div>

Thanks David.

I see there a risk of data-loss if pre-production has any bug and accidentally deletes production data.

Is there a way to set user permissions in a wildcard manner saying:

- This user `pre_user` can only read and write `pre_*` indexes
- this other user `prod_user`can only read and write `prod_*`indexes,
- none of the above can change system settings, only `PUT`, `POST`, `GET` on exactly those data indices.
- this other user `admin_guy` will be able to configure the global settings of the nodes and so...

so the system takes care and I'm sure that it is impossible that a bug in preproduction deletes real-production data?

---

<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:** [July 1, 2017, 7:44pm UTC](https://discuss.elastic.co/t/pre-and-prod-instances/91522/4 "2017-07-01T19:44:06Z")

</div>

Using x-pack (commercial) would surely help to secure your indices.

But seriously are you using the same MySQL database in both production and preproduction?

---

<div class="post-metadata">

**Author:** ![Xavi\_Montero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavi_montero/32/16964_2.png) [@Xavi\_Montero](https://discuss.elastic.co/u/Xavi_Montero)\
**Post date:** [July 2, 2017, 9:18am UTC](https://discuss.elastic.co/t/pre-and-prod-instances/91522/5 "2017-07-02T09:18:25Z")

</div>

x-pack/commercial =\> isn't there a user-security over indexes in the free version of x-pack?

mysql/pre/prod =\> For "normal" projects no, of course I place different machines for prod and pre. "normal" projects start when the owners don't mind spending $100 extra per month to have things well done for example.

Instead, for very-super-tiny-startups that need to spend as low as possible, and $50/month for a new server is critical, yes, until the startup makes about $1000 in excess per month or so.

So this question, translated to the elasticsearch thing, is needed as a "temporal" solution until the company can affort to pay "a set of servers" for prod and "another set" for pre. It's not intended to leave this as a permanent solution. I know it is ugly and dirty. It's for bootstrapping the company only.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 2, 2017, 9:23am UTC](https://discuss.elastic.co/t/pre-and-prod-instances/91522/6 "2017-07-02T09:23:36Z")

</div>

Security is not included in the basic X-Pack license. If a hosted service however is an option, you get role-based access controls included in all [Elastic Cloud](https://www.elastic.co/cloud) plans.

---

<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 30, 2017, 9:24am UTC](https://discuss.elastic.co/t/pre-and-prod-instances/91522/7 "2017-07-30T09:24:23Z")

</div>

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