← すべてのガイド
CockroachDB
A distributed SQL database that speaks the PostgreSQL wire protocol — built from the ground up for automatic sharding, replication, and surviving node failures without manual failover work.
このガイドは上記リンク先にあるCockroachDB公式ドキュメントをもとに作成されています。ディストリビューションやプロジェクトのバージョンは時間とともに変わるため、本番サーバーでこれらのコマンドを実行する前に、必ず公式ドキュメントで正確なパッケージ名・バージョン名を確認してください。
1Run a single-node instance
A single node is enough to try CockroachDB locally; production deployments run 3+ nodes for real replication and fault tolerance.
docker run -d \ --name cockroachdb \ -p 26257:26257 -p 8088:8080 \ -v ./cockroach/data:/cockroach/cockroach-data \ --restart unless-stopped \ cockroachdb/cockroach:latest start-single-node --insecure2Open the built-in admin UI
http://your-server-ip:80883Connect with any PostgreSQL client
Because CockroachDB implements the PostgreSQL wire protocol, the standard `psql` client and most PostgreSQL drivers/ORMs work against it with no special adapter.
docker exec -it cockroachdb ./cockroach sql --insecureThe --insecure flag is fine for local testing only -- a real deployment should generate TLS certificates and set up proper authentication, covered in CockroachDB's production-deployment docs.