Skip to content

Running two or more Rails apps using Anycable in the same server #230

Answered by palkan
Roko131 asked this question in Q&A
Discussion options

You must be logged in to vote

How should I go about running anycable-go --host=localhost --port=8080, Can I achieve it by using a single process call?

AnyCable server can connect only to a single backend application (the gRPC one you run via bundle exec anycable). So, you need to launch two anycable-go commands listening on different ports. Similarly, you must run bundle exec anycable with different --rpc-host. To sum up:

# app1
bundle exec anycable --rpc-host=localhost:50051
anycable-go --port=8080 --rpc-host=localhost:50051

# app2
bundle exec anycable --rpc-host=localhost:50052
anycable-go --port=8081 --rpc-host=localhost:50052

Can I use the same redis_url inside anycable.yml for both app1 and app2?

Yes, same R…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Roko131
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants