Does anyone know the secret for getting the Koa Discussion Forum to use a remote mongo service instead of the local service? The remote mongo service in question works fine with LMS and CMS and I can connect to it remotely from the command line using the cs_comments_service mongo username, and so I’ve ruled out remote connectivity errors.
Summarizing what I’ve already attempted:
Modify MONGOHQ_URL in /edx/app/forum/forum_env, changing “localhost” to the remote host (again, I have already verified that the remote host is actually reachable).
Modify /edx/app/forum/cs_comments_service/config/mongoid.yml, replacing the tag MONGOHQ_URL with the literal URI from forum_env.
I followed both modifications with a restart of the Discussion Forum using
/edx/bin/supervisorctl restart forum
I next tried a full edxapp instance reboot using sudo reboot. In each case the Discussion Forum still connects to the local mongo service instead of the remote service.
Also, a correction to the symptom that i describe above. The discussion service does not connect to the local service unless I revert to the original config, with host=localhost. What actually happens when I attempt to set the host to a remote host is the following run-time exception:
/edx/app/forum/.gem/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/server_selector/selectable.rb:110:in `select_server': No server is available matching preference: #<Mongo::ServerSelector::Primary:0x47148013197240 tag_sets=[] max_staleness=nil> using server_selection_timeout=30 and local_threshold=0.015 (Mongo::Error::NoServerAvailable)
For the avoidance of doubt, following are the forum_env settings I’m using.
Hello @lpm0073,
Have you found any solution for this?
I have installed CMS, Mongo, Elasticsearch on the same server and LMS, Forum on another.
Getting the same error.
I have checked, I can connect the mongo instance on LMS via the Private IP.
hi @billatedx, i and a couple others in this thread are trouble shooting a problem with getting the discussion forum to work with a remote mongo host. we represent a few different open edx installations all running on koa.master, each with the same problem: stopping the local mongo service breaks the discussion forum, even when the host credentials have been correctly modified in forum_env or farther downstream in /conf.
i’m reaching out to you bc last year around this time you were part of a collection of three pull requests related to upgrading the ruby gems for mongo, and then shortly after, reverting these:
@anjali while the remote connectivity problems remains, i’m curious if you’ve considered/attempted to install the discussion forum on a standalone EC2 instance along with its own local installation of mongo, and then integrate this to your LMS?
i succeeded in creating a remote discussion forum. i set the host name COMMENTS_SERVICE_URL to the internal IP address of the server, and, i modified the nginx config on the remote server to make the forum service listen on port 80 as the default_server. i’m running a local mongo service on that server.
this seems to be working for now, provided that this EC2 instance can manage the load on its own.
thanks for these suggestions. i think there have been some commits to cs_discussion_service since you launched your koa.master instance, and that one of these commits is the cause of the problems we are experiencing.