# When we edit apm-server.yml for giving ip and restart, service wont start

**URL:** <https://discuss.elastic.co/t/when-we-edit-apm-server-yml-for-giving-ip-and-restart-service-wont-start/199668>\
**Category:** APM\
**Tags:** server\
**Created:** [September 16, 2019, 1:17pm UTC](https://discuss.elastic.co/t/when-we-edit-apm-server-yml-for-giving-ip-and-restart-service-wont-start/199668 "2019-09-16T13:17:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph\_John](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_john/32/53907_2.png) [@Joseph\_John](https://discuss.elastic.co/u/Joseph_John)\
**Post date:** [September 16, 2019, 1:17pm UTC](https://discuss.elastic.co/t/when-we-edit-apm-server-yml-for-giving-ip-and-restart-service-wont-start/199668/1 "2019-09-16T13:17:30Z")

</div>

Hi All,  
I am trying out with APM,  
In have two test instance of the same versions, OS and mode of installation  
one in my virtualbox  
one in my aws account

In virtualbox for making apm-service available to all, I edited the  
/etc/apm-server/apm-server.yml

> ```
> host: "192.168.10.104:8200"
> 
> ```

I restart it works fine, I am able to restart the service, status shows the apm-server running and I am able to telnet to the service 192.168.10.104:8200, Good

But for a demo I preparing at my aws account (I am aware of the security group and had done the necessary settings)  
in my  
“/etc/apm-server/apm-server.yml”  
I edit

> host: "1X.1X.1x.1xx:8200"

then I stop the service and start, check the service, then service status shows it is down

when I check the logs I see  
**Sep 16 13:02:43 ip-1XX-1X-1x-1xx apm-server[3348]: 2019-09-16T13:02:43.018Z#011ERROR#011[beater]#011beater/beater.go:191#011failed to listen:listen tcp 1X.1X.x.x:8200: bind: cannot assign requested address**

This IP “ 1X.1X.1x.1xx” is the elasticIP address given to the instance

* * *

**Kibana version** :  
7.3.1  
**Elasticsearch version** :  
7.3.1  
**APM Server version** :  
7.3.1  
**APM Agent language and version** :  
elastic-apm-agent-1.9.0.jar  
**Browser version** :  
Firefox 69  
**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:  
deb  
**Fresh install or upgraded from other version?**  
Fresh  
**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.  
No  
**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

**Steps to reproduce** :

1. install in AWS ec2 instance
2. assign elastic IP
3. edit the

> /etc/apm-server/apm-server.yml and give the "host: "elaticIP:8200"

1. restart it and check the status

Note:- from morning on wards I am only doing this, it is not related with the aws security group or acl or anything, because I am checking for the service running or not with localhost:8200 it works, but wont work with the assigned elasticIP address assigned to the instance

---

<div class="post-metadata">

**Author:** ![Joseph\_John](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_john/32/53907_2.png) [@Joseph\_John](https://discuss.elastic.co/u/Joseph_John)\
**Post date:** [September 16, 2019, 2:10pm UTC](https://discuss.elastic.co/t/when-we-edit-apm-server-yml-for-giving-ip-and-restart-service-wont-start/199668/2 "2019-09-16T14:10:23Z")

</div>

Just a small update, the error message which we are getting at the AWS is

> ```
> Sep 16 13:59:33 apm apm-server[2321]: 2019-09-16T13:59:33.585Z#011ERROR#011[beater]#011beater/beater.go:191#011failed to listen:listen tcp X.X.X.X:8200: bind: cannot assign requested address
> 
> ```

Seeing this error, what this is my assumtion the IP address cannot be bind by the application, ie when we restart the apm-server it is UN-success, the same error message will be thrown when we are giving a wrong IP

**So my assumption is that AWS is restricting to bind the IP address with the application somehow.**

I may be wrong, correct me if I am wrong.  
At least 5-6 virtual box installation I did, every time it worked, but in AWS spend more than 8 hours troubleshooting was not able to work.  
thanks  
Joseph John

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [September 17, 2019, 2:10am UTC](https://discuss.elastic.co/t/when-we-edit-apm-server-yml-for-giving-ip-and-restart-service-wont-start/199668/3 "2019-09-17T02:10:54Z")

</div>

You should be using the EC2 instance's private IP address for the `host` configuration. The Elastic IP will be mapped to the private IP using NAT.

You can use the output of `ifconfig` to identify the private IP address. Alternatively you can set `host: ":8200"`, which will configure apm-server to listen on all network interfaces.

---

<div class="post-metadata">

**Author:** ![Joseph\_John](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_john/32/53907_2.png) [@Joseph\_John](https://discuss.elastic.co/u/Joseph_John)\
**Post date:** [September 17, 2019, 4:39am UTC](https://discuss.elastic.co/t/when-we-edit-apm-server-yml-for-giving-ip-and-restart-service-wont-start/199668/4 "2019-09-17T04:39:49Z")

</div>

Thanks Andrew, I will check it and update the results  
thanks a lot for the post

---

<div class="post-metadata">

**Author:** ![Joseph\_John](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_john/32/53907_2.png) [@Joseph\_John](https://discuss.elastic.co/u/Joseph_John)\
**Post date:** [September 17, 2019, 9:10am UTC](https://discuss.elastic.co/t/when-we-edit-apm-server-yml-for-giving-ip-and-restart-service-wont-start/199668/5 "2019-09-17T09:10:11Z")

</div>

Thanks it is working  
I gave the private IP address, for me the

> `host: ":8200"`

Did not work  
it worked with private IP  
thanks  
Joseph John

---

<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:** [October 8, 2019, 5:10am UTC](https://discuss.elastic.co/t/when-we-edit-apm-server-yml-for-giving-ip-and-restart-service-wont-start/199668/6 "2019-10-08T05:10:16Z")

</div>

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