I am trying to host elastic maps service locally with the new way to host the service on your my infrastructure. I have been following this guide Connect to Elastic Maps Service | Kibana Guide [8.11] | Elastic and have had no luck. I have tried setting up a new blank instance of elastic and still have the same errors.
The first error I cam accross was when running:
docker run --rm --name elastic-maps-server -it --hostname elastic-maps-server -p 8080:8080 -v "${PWD}/elastic-maps-server.yml:/usr/src/app/server/config/elastic-maps-server.yml" -v "${PWD}/data:/usr/src/app/data" -v "${PWD}/ems:/etc/ssl/certs" -v "${PWD}/log:/var/log/elastic-maps-server" [docker.elastic.co/elastic-maps-service/elastic-maps-server-ubi8:7.12.0](http://docker.elastic.co/elastic-maps-service/elastic-maps-server-ubi8:7.12.0)
I would get there error of this:
docker: Error response from daemon: driver failed programming external connectivity on endpoint elastic-maps-server (55fcdaeff0f19bc997850180bc9404ad1b4ca6dd124c9648fc63e31b0a1c258e): Bind for [0.0.0.0:8080](http://0.0.0.0:8080/) failed: port is already allocated.
I can get rid of this error by stopping the mapping server before running that, but then I will get the error:
events.js:291
throw er; // Unhandled 'error' event
^Error: EACCES: permission denied, open '/var/log/elastic-maps-server/elastic-maps-server.log'
Emitted 'error' event on WriteStream instance at:
at internal/fs/streams.js:361:12
at FSReqCallback.oncomplete (fs.js:156:23) {
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/var/log/elastic-maps-server/elastic-maps-server.log'
}
I can get rid of all those errors by removing lines from the docker starting command that I think are not relevant so that it looks like this:
docker run --rm --name elastic-maps-server -it --hostname elastic-maps-server -p 8080:8080 -v "${PWD}/elastic-maps-server.yml:/usr/src/app/server/config/elastic-maps-server.yml" docker.elastic.co/elastic-maps-service/elastic-maps-server-ubi8:7.12.0
Then it will run the elastic map server but elastic is still not connected. This is the output:
{"log":{"level":"info","logger":"pino"},"@timestamp":"2021-04-16T13:39:11.638Z","process":{"pid":1},"host":{"hostname":"elastic-maps-server"},"created":1618580351589,"started":1618580351635,"host":"elastic-maps-server","port":8080,"protocol":"http","id":"elastic-maps-server:1:knkcy89x","uri":"[http://elastic-maps-server:8080](http://elastic-maps-server:8080/)","address":"172.17.0.2","ecs":{"version":"1.5.0"},"message":"server started"}
{"log":{"level":"error","logger":"pino"},"@timestamp":"2021-04-16T13:39:17.662Z","process":{"pid":1},"host":{"hostname":"elastic-maps-server"},"message":"Unable to connect to the Elasticsearch cluster: [http://localhost:9200](http://localhost:9200/)","ecs":{"version":"1.5.0"}}
The password in the .yml is correct and everything because I can log into Elasticsearch with it as well as the web address. I know it is in beta, but it should still work.