DockerGS
DockerGS copied to clipboard
MongoSocketOpenException
Exception in thread "main" com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=192.168.1.106:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.SocketTimeoutException: Connect timed out}}]
at com.mongodb.internal.connection.BaseCluster.getDescription(BaseCluster.java:177)
at com.mongodb.internal.connection.SingleServerCluster.getDescription(SingleServerCluster.java:41)
at com.mongodb.client.internal.MongoClientDelegate.getConnectedClusterDescription(MongoClientDelegate.java:127)
at com.mongodb.client.internal.MongoClientDelegate.createClientSession(MongoClientDelegate.java:87)
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.getClientSession(MongoClientDelegate.java:258)
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:182)
at com.mongodb.client.internal.MongoCollectionImpl.executeCreateIndexes(MongoCollectionImpl.java:847)
at com.mongodb.client.internal.MongoCollectionImpl.createIndexes(MongoCollectionImpl.java:830)
at com.mongodb.client.internal.MongoCollectionImpl.createIndexes(MongoCollectionImpl.java:825)
at com.mongodb.client.internal.MongoCollectionImpl.createIndex(MongoCollectionImpl.java:810)
at dev.morphia.annotations.builders.IndexHelper.createIndex(IndexHelper.java:220)
at dev.morphia.annotations.builders.IndexHelper.createIndex(IndexHelper.java:210)
at dev.morphia.DatastoreImpl.ensureIndexes(DatastoreImpl.java:186)
at emu.grasscutter.database.DatabaseManager.ensureIndexes(DatabaseManager.java:80)
at emu.grasscutter.database.DatabaseManager.initialize(DatabaseManager.java:63)
at emu.grasscutter.Grasscutter.main(Grasscutter.java:134)
Command to start:
docker run --rm -it \
--name dockergs \
-v resources:/home/dockergs/resources \
-p 22102:22102/udp \
-p 80:80/tcp \
siakbary/dockergs:alpine-gc-3.1 \
--database 'mongodb://192.168.1.106:27017' \
--web_ip '172.20.48.1' \
--web_port '80' \
--game_ip '172.20.48.1' \
--game_port '22102' \
--download_resource 'yes' \
--ssl 'false' \
--web_url_ssl "false"
I'm trying to run dockerGS on wsl, and I've set up MongoDB on my windows before so I want to use the installed mongo db. “192.168.1.106” is the host to my windows machine, but when I try to start server there will be an exception thrown
Sorry for my poor English
run mongodb first then run dockergs and keep in the same network segment 必须先运行mongodb 然后再运行dockergs 然后两个要在同一个网段才能联通 你上面的都不在一个网段能用才怪
I closed this because it looks like it's just a database problem that is not connected because the ip is not recognized in docker