Company
Date Published
Author
Matthew Groves
Word count
1163
Language
English
Hacker News points
None

Summary

The author of the blog post uses Docker containers to simulate a Couchbase Server cluster locally, allowing them to test and demonstrate various aspects of their ASP.NET Core website. To get started, they recommend installing Docker for Windows, Visual Studio 2015 or later, .NET Core VS 2015 tooling preview 2 or higher, and Visual Studio Tools for Docker. They then run Couchbase Server containers using the `docker run` command, exposing port 8091 to use the Couchbase Console from a web browser at localhost:8091. The author creates multiple Couchbase Server containers and enables replication on one of them, adding it to the cluster by clicking "Add Server" in the Couchbase Console. Once the cluster is set up, they create an ASP.NET Core app that uses the CouchbaseNetClient dependency to interact with the Couchbase cluster. They then deploy the ASP.NET Core app in Docker and run it, noting that the aspnetcore Docker image doesn't attach to the 'bridge' Docker network by default. After running the app again, the author notes that the website appears in their browser, and they can view the Couchbase Console to see how the documents are being automatically sharded amongst the nodes and replicas stored in other nodes. They also experiment with auto-failover and shutting down one of the Couchbase nodes to test the cluster's behavior.