I configured
GRAYLOG_WEB_LISTEN_URI: http://0.0.0.0:9000/
GRAYLOG_REST_LISTEN_URI: http://0.0.0.0:9000/api/
GRAYLOG_REST_TRANSPORT_URI: http://${GRAYLOG2_SERVER_HOSTNAME}:9000/api/
No any errors pop up in the logs, can successfully connect to the MongoDB servers and the elastic-search servers, just cannot access the web UI, keep getting:
We are experiencing problems connecting to the Graylog server running on http://micro02.sgdev.vcube.com:9000/api/. Please verify that the server is healthy and working correctly.
You will be automatically redirected to the previous page once we can connect to the server.
Error message
Request has been terminated
Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.
Original Request
GET http://micro02.sgdev.vcube.com:9000/api/system/sessions
Status code
undefined
Full error message
Error: Request has been terminated
Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.
With docker hub image: graylog2/server:2.3.0-rc.2-2
@lnshi Please post your complete Docker configuration.
Is http://micro02.sgdev.vcube.com:9000/api/ the correct URI of the Graylog REST API which is accessible by your web browser?
@joschi Yes, it is correct.
The whole docker configuration part for the graylog2_server:
graylog2_server:
image: graylog2/server:2.3.0-rc.2-2
hostname: graylog2_server
environment:
GRAYLOG_PASSWORD_SECRET: l4dIKl7ocXp1hw2IZdBOCGFwLjdKDsILYxjlGRxlkJvjYVY3sAaSarTZ05gyo4hCuAWXuydO3LGIo3F5WIOWr5gKyeH6F0Gp
GRAYLOG_ROOT_USERNAME: leonard
GRAYLOG_ROOT_PASSWORD_SHA2: c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646
GRAYLOG_ROOT_EMAIL: [email protected]
GRAYLOG_ROOT_TIMEZONE: UTC
GRAYLOG_WEB_LISTEN_URI: http://0.0.0.0:9000/
GRAYLOG_REST_LISTEN_URI: http://0.0.0.0:9000/api/
GRAYLOG_REST_TRANSPORT_URI: http://${GRAYLOG2_SERVER_HOSTNAME}:9000/api/
GRAYLOG_MONGODB_URI: mongodb://ip_x1:27017,ip_x2:27017/microservices_graylog
GRAYLOG_ELASTICSEARCH_HOSTS: http://elasticsearch-server-0:9200,http://elasticsearch-server-1:9200,http://elasticsearch-server-2:9200
GRAYLOG_ELASTICSEARCH_MAX_TOTAL_CONNECTIONS: 9
GRAYLOG_ELASTICSEARCH_MAX_TOTAL_CONNECTIONS_PER_ROUTE: 3
GRAYLOG_ELASTICSEARCH_MAX_RETRIES: 100
GRAYLOG_ELASTICSEARCH_DISCOVERY_ENABLED: 'true'
networks:
- default
ports:
- '64999:9000'
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.hostname == ${GRAYLOG2_SERVER_HOSTNAME}
restart_policy:
condition: any
Ah, figured out the issue here, I mapped the port 9000 to 64999, then it cannot pass the same origin check....
If I just still map it to 9000, then it works.
So here how do I use the different opened port other than 9000?
@joschi
Then now I keep getting this exception:
2017-07-20 10:40:21,925 WARN : org.graylog2.shared.rest.resources.ProxiedResource - Unable to call http://micro02.sgdev.vcube.com:9000/api/system/metrics/multiple on node <5cbb5ccd-b885-4900-a1e7-ce9a494d1ae9>
java.net.UnknownHostException: micro02.sgdev.vcube.com
at java.net.InetAddress.getAllByName0(InetAddress.java:1280) ~[?:1.8.0_72-internal]
at java.net.InetAddress.getAllByName(InetAddress.java:1192) ~[?:1.8.0_72-internal]
at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[?:1.8.0_72-internal]
at okhttp3.Dns$1.lookup(Dns.java:39) ~[graylog.jar:?]
at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:171) ~[graylog.jar:?]
at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.java:137) ~[graylog.jar:?]
at okhttp3.internal.connection.RouteSelector.next(RouteSelector.java:82) ~[graylog.jar:?]
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:171) ~[graylog.jar:?]
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:121) ~[graylog.jar:?]
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:100) ~[graylog.jar:?]
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42) ~[graylog.jar:?]
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) ~[graylog.jar:?]
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) ~[graylog.jar:?]
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93) ~[graylog.jar:?]
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) ~[graylog.jar:?]
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) ~[graylog.jar:?]
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) ~[graylog.jar:?]
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) ~[graylog.jar:?]
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120) ~[graylog.jar:?]
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) ~[graylog.jar:?]
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) ~[graylog.jar:?]
at org.graylog2.rest.RemoteInterfaceProvider.lambda$get$0(RemoteInterfaceProvider.java:59) ~[graylog.jar:?]
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) ~[graylog.jar:?]
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) ~[graylog.jar:?]
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185) ~[graylog.jar:?]
at okhttp3.RealCall.execute(RealCall.java:69) ~[graylog.jar:?]
at retrofit2.OkHttpCall.execute(OkHttpCall.java:180) ~[graylog.jar:?]
at org.graylog2.shared.rest.resources.ProxiedResource.lambda$getForAllNodes$0(ProxiedResource.java:76) ~[graylog.jar:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_72-internal]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_72-internal]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_72-internal]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72-internal]
get a bit confused here, the micro02.sgdev.vcube.com is the physical machine which the graylog2_server docker container is running on, now it seems it tries to call the http://micro02.sgdev.vcube.com:9000/api/system/metrics/multiple inside the container, which it is itself, noway to use localhost here?
What is the proper configuration here...
@lnshi micro02.sgdev.vcube.com has to be resolvable inside the Docker container if you want to use it in your Graylog configuration.
now it seems it tries to call the http://micro02.sgdev.vcube.com:9000/api/system/metrics/multiple inside the container, which it is itself, noway to use localhost here?
Sure, that's what the rest_transport_uri setting is for. You also might want to check out the web_endpoint_uri setting.
We are using GitHub issues for tracking bugs in Graylog itself, but this doesn't look like one. Please post this issue to our discussion forum or join the #graylog channel on freenode IRC.
Thank you!
It seems like the questions are coming from outdated documentation which causes people to run into the same issues. I'd be happy to help update it if you let me know how to start.
@gardner Thanks for chiming in!
It would be best to improve the README.md file in the graylog-docker repository.
Most helpful comment
@gardner Thanks for chiming in!
It would be best to improve the README.md file in the graylog-docker repository.