# Unable to connect the AGENT with the Server

**URL:** <https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536>\
**Category:** APM\
**Created:** [August 29, 2018, 1:27pm UTC](https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536 "2018-08-29T13:27:51Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![kranthi\_851](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@kranthi\_851](https://discuss.elastic.co/u/kranthi_851)\
**Post date:** [August 29, 2018, 1:27pm UTC](https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536/1 "2018-08-29T13:27:51Z")

</div>

Hi All,  
This is my server output after starting the api-server:

 ![Screenshot%20from%202018-08-29%2017-50-41](https://us1.discourse-cdn.com/elastic/original/3X/f/a/fa442c9a780fa977f406fc737e64ba2662a631f0.png)

apm-server:  
host: "192.168.0.95:8200"  
rum:  
# To enable real user monitoring (RUM) support set this to true.  
enabled: true  
#==================== Elasticsearch template setting ==========================  
setup.template.settings:  
index:  
number\_of\_shards: 1  
codec: best\_compression  
#number\_of\_routing\_shards: 30  
#============================== Template =====================================  
setup.template.enabled: true  
setup.template.name: "apm-%{[beat.version]}"  
default index settings.  
setup.template.pattern: "apm-%{[beat.version]}-\*"  
setup.template.fields: "${path.config}/fields.yml"  
setup.dashboards.enabled: true  
setup.dashboards.directory: ${path.home}/kibana  
setup.kibana:  
host: "192.168.0.95:5601"  
output.logstash:  
enabled: true  
hosts: ["192.168.0.95:5044"]

This are the things which I have enabled inn the apm-server.yml  
Curl output of agent showing 404 but in case of server end its showing remote client 200...🙄  
[root@TCHK1 logs]# curl -v 192.168.0.95:8200

- About to connect() to 192.168.0.95 port 8200 (#0)
- Trying 192.168.0.95... connected
- Connected to 192.168.0.95 (192.168.0.95) port 8200 (#0)

> GET / HTTP/1.1  
> User-Agent: curl/7.19.7 (x86\_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2  
> Host: 192.168.0.95:8200  
> Accept: _/_

\< HTTP/1.1 404 Not Found  
\< Content-Type: text/plain; charset=utf-8  
\< X-Content-Type-Options: nosniff  
\< Date: Wed, 29 Aug 2018 13:26:32 GMT  
\< Content-Length: 19  
\<  
404 page not found

- Connection #0 to host 192.168.0.95 left intact
- Closing connection #0  
Please check this error & let me known! Thanks in Advance.

---

<div class="post-metadata">

**Author:** ![gil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gil/32/41911_2.png) [@gil](https://discuss.elastic.co/u/gil)\
**Post date:** [August 29, 2018, 5:36pm UTC](https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536/2 "2018-08-29T17:36:21Z")

</div>

@kranthi_851 You're actually in good shape here. The curl output is showing that apm-server responded to a `GET /` with a `404 Not Found`, so the connection is established successfully. apm-server does not log 404s - the logs you're seeing are actually an agent requesting `GET /healthcheck`, which is returning `200` as expected.

In an upcoming release, `GET /` will return a `200` with some basic server information to help avoid this confusing situation.

---

<div class="post-metadata">

**Author:** ![kranthi\_851](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@kranthi\_851](https://discuss.elastic.co/u/kranthi_851)\
**Post date:** [August 30, 2018, 5:05am UTC](https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536/3 "2018-08-30T05:05:28Z")

</div>

Thanks for your reply, but i am unable to view those logs in the apm-server may I know reason for that!1

---

<div class="post-metadata">

**Author:** ![kranthi\_851](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@kranthi\_851](https://discuss.elastic.co/u/kranthi_851)\
**Post date:** [August 30, 2018, 5:28am UTC](https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536/5 "2018-08-30T05:28:03Z")

</div>

And if run the apm-agnet jar file I am getting this error:  
[root@TCHK1 apm-agent]# java -jar elastic-apm-agent-0.6.2-sources.jar  
no main manifest attribute, in elastic-apm-agent-0.6.2-sources.jar

Please check it.

---

<div class="post-metadata">

**Author:** ![kranthi\_851](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@kranthi\_851](https://discuss.elastic.co/u/kranthi_851)\
**Post date:** [August 30, 2018, 5:51am UTC](https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536/6 "2018-08-30T05:51:15Z")

</div>

Hey I have enabled out out as Elastic search, it looks fine but I am unable to see any thing on Kibana..🙄  
2018-08-30T11:15:26.270+0530 INFO instance/beat.go:273 Setup Beat: apm-server; Version: 6.4.0  
2018-08-30T11:15:26.270+0530 INFO elasticsearch/client.go:163 Elasticsearch url: [http://192.168.0.95:9200](http://192.168.0.95:9200)  
2018-08-30T11:15:26.270+0530 INFO pipeline/module.go:98 Beat name: [elk-stack.girmiti.com](http://elk-stack.girmiti.com)  
2018-08-30T11:15:26.270+0530 INFO [beater] beater/beater.go:67 Falling back to elasticsearch output for sourcemap storage  
2018-08-30T11:15:26.270+0530 INFO elasticsearch/client.go:163 Elasticsearch url: [http://192.168.0.95:9200](http://192.168.0.95:9200)  
2018-08-30T11:15:26.272+0530 INFO elasticsearch/client.go:708 Connected to Elasticsearch version 6.4.0  
2018-08-30T11:15:26.272+0530 INFO kibana/client.go:113 Kibana url: [http://192.168.0.95:5601](http://192.168.0.95:5601)  
2018-08-30T11:15:27.745+0530 INFO instance/beat.go:659 Kibana dashboards successfully loaded.  
2018-08-30T11:15:27.745+0530 INFO instance/beat.go:367 apm-server start running.  
2018-08-30T11:15:27.745+0530 INFO [beater] beater/beater.go:172 self instrumentation is disabled  
2018-08-30T11:15:27.746+0530 INFO [handler] beater/handlers.go:161 Path /v1/client-side/transactions added to request handler  
2018-08-30T11:15:27.746+0530 INFO elasticsearch/client.go:163 Elasticsearch url: [http://192.168.0.95:9200](http://192.168.0.95:9200)  
2018-08-30T11:15:27.746+0530 INFO [handler] beater/handlers.go:161 Path /v1/errors added to request handler  
2018-08-30T11:15:27.746+0530 INFO [handler] beater/handlers.go:161 Path /v1/client-side/errors added to request handler  
2018-08-30T11:15:27.746+0530 INFO [handler] beater/handlers.go:161 Path /v1/rum/errors added to request handler  
2018-08-30T11:15:27.746+0530 INFO [handler] beater/handlers.go:161 Path /v1/metrics added to request handler  
2018-08-30T11:15:27.746+0530 INFO [handler] beater/handlers.go:161 Path /v1/client-side/sourcemaps added to request handler  
2018-08-30T11:15:27.746+0530 INFO [handler] beater/handlers.go:161 Path /v1/rum/sourcemaps added to request handler  
2018-08-30T11:15:27.746+0530 INFO [handler] beater/handlers.go:161 Path /v1/transactions added to request handler  
2018-08-30T11:15:27.746+0530 INFO [handler] beater/handlers.go:161 Path /v1/rum/transactions added to request handler  
2018-08-30T11:15:27.746+0530 INFO [server] beater/server.go:69 Starting apm-server [59fbf0b6146ca5c50a94d1c435d0cf704e5b2a3f built 2018-08-17 22:13:22 +0000 UTC]. Hit CTRL-C to stop it.  
2018-08-30T11:15:27.746+0530 INFO [server] beater/server.go:70 Listening on: 192.168.0.95:8200  
2018-08-30T11:15:27.746+0530 INFO [server] beater/server.go:73 RUM endpoints enabled!  
2018-08-30T11:15:27.746+0530 INFO [request] beater/handlers.go:282 handled request {"request\_id": "8d604f48-714f-478a-b38c-3239314ab9c3", "method": "GET", "URL": "/healthcheck", "content\_length": 0, "remote\_address": "192.168.0.95", "user-agent": "Go-http-client/1.1", "response\_code": 200}  
2018-08-30T11:15:27.746+0530 INFO [http\_client] beater/client.go:49 HTTP Server ready  
2018-08-30T11:15:27.762+0530 INFO [onboarding] beater/onboarding.go:36 Publishing onboarding document  
2018-08-30T11:15:28.780+0530 INFO elasticsearch/client.go:708 Connected to Elasticsearch version 6.4.0  
2018-08-30T11:15:28.796+0530 INFO template/load.go:129 Template already exists and will not be overwritten.  
2018-08-30T11:15:32.092+0530 INFO [request] beater/handlers.go:282 handled request {"request\_id": "6cdeb457-ee00-410f-a015-262b4c966576", "method": "GET", "URL": "/healthcheck", "content\_length": 0, "remote\_address": "192.168.1.215", "user-agent": "co/elastic/apm/shaded/okhttp/3.9.1", "response\_code": 200}  
2018-08-30T11:15:42.093+0530 INFO [request] beater/handlers.go:282 handled request {"request\_id": "653aadb6-9515-4ed1-8665-87b270128890", "method": "GET", "URL": "/healthcheck", "content\_length": 0, "remote\_address": "192.168.1.215", "user-agent": "co/elastic/apm/shaded/okhttp/3.9.1", "response\_code": 200}  
Currently getting on the apm-server end.

 ![Screenshot%20from%202018-08-30%2011-17-54](https://us1.discourse-cdn.com/elastic/original/3X/8/c/8c6284c23b0917f2c2db6540297e7a6dda4f449d.png)

---

<div class="post-metadata">

**Author:** ![gil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gil/32/41911_2.png) [@gil](https://discuss.elastic.co/u/gil)\
**Post date:** [August 30, 2018, 1:52pm UTC](https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536/7 "2018-08-30T13:52:53Z")

</div>

@kranthi_851 Almost there! You're running into a change introduced in the 6.4.0 UI, detailed in the [release notes](https://www.elastic.co/guide/en/apm/get-started/master/apm-release-notes.html#_apm_version_6_4_0). You need to update either apm-server.yml or kibana.yml to ensure the index patterns match between where apm-server will store documents and where kibana will try to retrieve them.

---

<div class="post-metadata">

**Author:** ![Senz79](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/senz79/32/42874_2.png) [@Senz79](https://discuss.elastic.co/u/Senz79)\
**Post date:** [August 30, 2018, 1:56pm UTC](https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536/8 "2018-08-30T13:56:16Z")

</div>

Put the below setting in Kibana.yml

apm\_oss.errorIndices: apm-\*  
apm\_oss.spanIndices: apm-\*  
apm\_oss.transactionIndices: apm-\*  
apm\_oss.onboardingIndices: apm-\*

---

<div class="post-metadata">

**Author:** ![kranthi\_851](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@kranthi\_851](https://discuss.elastic.co/u/kranthi_851)\
**Post date:** [August 31, 2018, 5:29am UTC](https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536/9 "2018-08-31T05:29:54Z")

</div>

Thanks Again gil, its working fine.  
Could you please suggest me to run the ./apm-server -e script continuously, since If I press ctrl+c apm-server getting stopped. I need continuous monitoring so how can we do that?

---

<div class="post-metadata">

**Author:** ![kranthi\_851](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@kranthi\_851](https://discuss.elastic.co/u/kranthi_851)\
**Post date:** [August 31, 2018, 5:30am UTC](https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536/10 "2018-08-31T05:30:21Z")

</div>

Thanks for you valuable response, its working fine now.

---

<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:** [August 31, 2018, 5:46am UTC](https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536/11 "2018-08-31T05:46:57Z")

</div>

> [@kranthi\_851](#):
>
> Could you please suggest me to run the ./apm-server -e script continuously, since If I press ctrl+c apm-server getting stopped. I need continuous monitoring so how can we do that?

How have you installed the APM Server? If you installed via APT or YUM, you can follow the instructions in the docs to start the server when your machine boots: [Quick start with Elastic Cloud | APM User Guide [8.11] | Elastic](https://www.elastic.co/guide/en/apm/server/current/setup-repositories.html).

---

<div class="post-metadata">

**Author:** ![kranthi\_851](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@kranthi\_851](https://discuss.elastic.co/u/kranthi_851)\
**Post date:** [August 31, 2018, 6:05am UTC](https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536/13 "2018-08-31T06:05:43Z")

</div>

Thanks for the response it looks fine now.

---

<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:** [September 21, 2018, 2:05am UTC](https://discuss.elastic.co/t/unable-to-connect-the-agent-with-the-server/146536/14 "2018-09-21T02:05:57Z")

</div>

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