Skip to content

Commit cfc60df

Browse files
committed
Update CouchDB documentation
1 parent 0c947c7 commit cfc60df

File tree

4 files changed

+32
-14
lines changed

4 files changed

+32
-14
lines changed

couchdb/README-short.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CouchDB is a database that uses JSON for documents, JavaScript for MapReduce and HTTP for its API.
1+
CouchDB is a database that uses JSON for documents, HTTP for its API, and offers JavaScript and declarative secondary indexing.

couchdb/content.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# What is Apache CouchDB?
22

3-
CouchDB is a database that completely embraces the web. Store your data with JSON documents. Access your documents and query your indexes with your web browser, via HTTP. Index, combine, and transform your documents with JavaScript. CouchDB works well with modern web and mobile apps. You can even serve web apps directly out of CouchDB. And you can distribute your data, or your apps, efficiently using CouchDB’s incremental replication. CouchDB supports master-master setups with automatic conflict detection.
3+
Apache CouchDB™ lets you access your data where you need it by defining the Couch Replication Protocol that is implemented by a variety of projects and products that span every imaginable computing environment from globally distributed server-clusters, over mobile phones to web browsers. Software that is compatible with the Couch Replication Protocol include: PouchDB, Buttant, and Couchbase Lite.
44

5-
CouchDB comes with a suite of features, such as on-the-fly document transformation and real-time change notifications, that makes web app development a breeze. It even comes with an easy to use web administration console. You guessed it, served up directly out of CouchDB! We care a lot about distributed scaling. CouchDB is highly available and partition tolerant, but is also eventually consistent. And we care a lot about your data. CouchDB has a fault-tolerant storage engine that puts the safety of your data first.
5+
Store your data safely, on your own servers, or with any leading cloud provider. Your web- and native applications love CouchDB, because it speaks JSON natively and supports binary for all your data storage needs. The Couch Replication Protocol lets your data flow seamlessly between server clusters to mobile phones and web browsers, enabling a compelling, offline-first user-experience while maintaining high performance and strong reliability. CouchDB comes with a developer-friendly query language, and optionally MapReduce for simple, efficient, and comprehensive data retrieval.
66

77
> [couchdb.apache.org](https://couchdb.apache.org)
88
@@ -26,7 +26,12 @@ In order to use the running instance from an application, link the container
2626
$ docker run --name my-couchdb-app --link my-couchdb:couch %%REPO%%
2727
```
2828

29-
See the [official docs](http://docs.couchdb.org/en/1.6.1/) for infomation on using and configuring CouchDB.
29+
Please note that CouchDB no longer autocreates system tables for you, so you will have to create `_global_changes`, `_metadata`, `_replicator` and `_users` manually (the admin interface has a "Setup" menu that does this for you).
30+
The node will also start in [admin party mode](http://guide.couchdb.org/draft/security.html#party)!
31+
32+
For the `2.1` image, configuration is stored at `/opt/couchdb/etc/`.
33+
34+
See the [official docs](http://docs.couchdb.org/en/2.1.0/) for infomation on using and configuring CouchDB.
3035

3136
### Exposing the port to the outside world
3237

@@ -38,21 +43,25 @@ $ docker run -p 5984:5984 -d %%REPO%%
3843

3944
CouchDB listens on port 5984 for requests and the image includes `EXPOSE 5984`. The flag `-p 5984:5984` exposes this port on the host.
4045

46+
*WARNING*: Do not do this until you have established an admin user and setup
47+
permissions correctly on any databases you have created.
48+
4149
## Persistent Data
4250

4351
There are several ways to store data used by applications that run in Docker containers. We encourage users of the `%%REPO%%` images to familiarize themselves with the options available, including:
4452

4553
- Let Docker manage the storage of your database data [by writing the database files to disk on the host system using its own internal volume management](https://docs.docker.com/engine/tutorials/dockervolumes/#adding-a-data-volume). This is the default and is easy and fairly transparent to the user. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers.
4654
- Create a data directory on the host system (outside the container) and [mount this to a directory visible from inside the container](https://docs.docker.com/engine/tutorials/dockervolumes/#mount-a-host-directory-as-a-data-volume). This places the database files in a known location on the host system, and makes it easy for tools and applications on the host system to access the files. The downside is that the user needs to make sure that the directory exists, and that e.g. directory permissions and other security mechanisms on the host system are set up correctly.
4755

48-
CouchDB uses `/usr/local/var/lib/couchdb` to store its data. This directory is marked as a docker volume.
56+
CouchDB uses `/opt/couchdb/data` to store its data, and is exposed as a volume.
57+
CouchDB uses `/opt/couchdb/etc` to store its configuration.
4958

5059
### Using host directories
5160

5261
You can map the container's volumes to a directory on the host, so that the data is kept between runs of the container. This example uses your current directory, but that is in general not the correct place to store your persistent data!
5362

5463
```console
55-
$ docker run -d -v $(pwd):/usr/local/var/lib/couchdb --name my-couchdb %%REPO%%
64+
$ docker run -d -v $(pwd):/opt/couchdb/data --name my-couchdb %%REPO%%
5665
```
5766

5867
## Specifying the admin user in the environment
@@ -63,14 +72,22 @@ You can use the two environment variables `COUCHDB_USER` and `COUCHDB_PASSWORD`
6372
$ docker run -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=password -d %%REPO%%
6473
```
6574

75+
Note that if you are setting up a clustered CouchDB, you will want to
76+
pre-hash this password and use the identical hashed text across all nodes to
77+
ensure sessions work correctly when a load balancer is placed in front of
78+
the cluster. Hashing can be accomplished by running the container with the
79+
`/opt/couchdb/etc/local.d` directory mounted as a volume, allowing CouchDB to
80+
hash the password you set, then copying out the hashed version and using this
81+
value in the future.
82+
6683
## Using your own CouchDB configuration file
6784

68-
The CouchDB configuration is specified in `.ini` files in `/usr/local/etc/couchdb`. Take a look at the [CouchDB configuration documentation](http://docs.couchdb.org/en/1.6.1/config/index.html) to learn more about CouchDBs configuration structure.
85+
The CouchDB configuration is specified in `.ini` files in `/opt/couchdb/etc`. Take a look at the [CouchDB configuration documentation](http://docs.couchdb.org/en/2.1.0/config/index.html) to learn more about CouchDB's configuration structure.
6986

70-
If you want to use a customized CouchDB configuration, you can create your configuration file in a directory on the host machine and then mount that directory as `/usr/local/etc/couchdb/local.d` inside the `%%REPO%%` container.
87+
If you want to use a customized CouchDB configuration, you can create your configuration file in a directory on the host machine and then mount that directory as `/opt/couchdb/etc/local.d` inside the `%%REPO%%` container.
7188

7289
```console
73-
$ docker run --name my-couchdb -v /my/custom-config-dir:/usr/local/etc/couchdb/local.d -d %%REPO%%
90+
$ docker run --name my-couchdb -v /my/custom-config-dir:/opt/couchdb/etc/local.d -d %%REPO%%
7491
```
7592

7693
You can also use `couchdb` as the base image for your own couchdb instance and provie your own version of the `local.ini` config file:
@@ -80,7 +97,7 @@ Example Dockerfile:
8097
```dockerfile
8198
FROM %%REPO%%
8299

83-
COPY local.ini /usr/local/etc/couchdb/
100+
COPY local.ini /opt/couchdb/etc/
84101
```
85102

86103
and then build and run
@@ -92,15 +109,16 @@ $ docker run -d -p 5984:5984 you/awesome-couchdb
92109

93110
## Logging
94111

95-
By default containers run from this image only log to `stdout`. This means that the `/_log` endpoint is not available. You can enable logging to file in the [configuration](http://docs.couchdb.org/en/1.6.1/config/logging.html).
112+
By default containers run from this image only log to `stdout`. You can enable logging to file in the [configuration](http://docs.couchdb.org/en/2.1.0/config/logging.html).
96113

97114
For example in `local.ini`:
98115

99116
```ini
100117
[log]
101-
file = /usr/local/var/log/couchdb/couch.log
118+
writer = file
119+
file = /opt/couchdb/log/couch.log
102120
```
103121

104122
## Erlang Version
105123

106-
This image uses Erlang `17.3` from Debian Jessie's repository. Debian's version patches a critical bug in Erlang `17.3` and is good to use with CouchDB ([confirmed by Jan Lehnardt](https://github.com/klaemo/docker-couchdb/issues/50#issuecomment-190832786)).
124+
This image uses Erlang `17.3` from Debian Jessie's repository. Debian's version patches a critical bug in Erlang `17.3` and is good to use with CouchDB.

couchdb/github-repo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/klaemo/docker-couchdb
1+
https://github.com/apache/couchdb-docker

couchdb/logo.png

5.28 KB
Loading

0 commit comments

Comments
 (0)