mirror of https://github.com/docker/docs.git
Merge pull request #6962 from trapier/dtr-rethinkcli-noninteractive
introduce rethinkcli non-interactive mode for DTR 2.2-2.5
This commit is contained in:
commit
572e5f9a76
|
@ -39,7 +39,7 @@ that has `sh` and `ping`.
|
||||||
|
|
||||||
DTR uses RethinkDB for persisting data and replicating it across replicas.
|
DTR uses RethinkDB for persisting data and replicating it across replicas.
|
||||||
It might be helpful to connect directly to the RethinkDB instance running on a
|
It might be helpful to connect directly to the RethinkDB instance running on a
|
||||||
DTR replica to check the DTR internal state.
|
DTR replica to check the DTR internal state.
|
||||||
|
|
||||||
> **Warning**: Modifying RethinkDB directly is not supported and may cause
|
> **Warning**: Modifying RethinkDB directly is not supported and may cause
|
||||||
> problems.
|
> problems.
|
||||||
|
@ -50,27 +50,44 @@ commands:
|
||||||
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
```bash
|
```bash
|
||||||
# REPLICA_ID will be the replica ID for the current node.
|
# DTR_REPLICA_ID will be the replica ID for the current node.
|
||||||
REPLICA_ID=$(docker ps -lf name='^/dtr-rethinkdb-.{12}$' --format '{{.Names}}' | cut -d- -f3)
|
DTR_REPLICA_ID=$(docker ps -lf name='^/dtr-rethinkdb-.{12}$' --format '{{.Names}}' | cut -d- -f3)
|
||||||
|
# List problems in the cluster detected by the current node.
|
||||||
|
echo 'r.db("rethinkdb").table("current_issues")' | \
|
||||||
|
docker run -i --rm \
|
||||||
|
--net dtr-ol \
|
||||||
|
-e DTR_REPLICA_ID=${DTR_REPLICA_ID} \
|
||||||
|
-v dtr-ca-$DTR_REPLICA_ID:/ca \
|
||||||
|
dockerhubenterprise/rethinkcli:v2.2.0-ni non-interactive; \
|
||||||
|
echo
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
On a healthy cluster the output will be `[]`.
|
||||||
|
|
||||||
|
RethinkDB stores data in different databases that contain multiple tables. This
|
||||||
|
container can also be used to connect to the local DTR replica and
|
||||||
|
interactively query the contents of the DB.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```bash
|
||||||
|
# DTR_REPLICA_ID will be the replica ID for the current node.
|
||||||
|
DTR_REPLICA_ID=$(docker ps -lf name='^/dtr-rethinkdb-.{12}$' --format '{{.Names}}' | cut -d- -f3)
|
||||||
# This command will start a RethinkDB client attached to the database
|
# This command will start a RethinkDB client attached to the database
|
||||||
# on the current node.
|
# on the current node.
|
||||||
docker run -it --rm \
|
docker run -it --rm \
|
||||||
--net dtr-ol \
|
--net dtr-ol \
|
||||||
-v dtr-ca-$REPLICA_ID:/ca dockerhubenterprise/rethinkcli:v2.2.0 \
|
-e DTR_REPLICA_ID=${DTR_REPLICA_ID} \
|
||||||
$REPLICA_ID
|
-v dtr-ca-$DTR_REPLICA_ID:/ca \
|
||||||
|
dockerhubenterprise/rethinkcli:v2.2.0-ni
|
||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
This container connects to the local DTR replica and launches a RethinkDB client
|
|
||||||
that can be used to inspect the contents of the DB. RethinkDB
|
|
||||||
stores data in different databases that contain multiple tables. The `rethinkcli`
|
|
||||||
tool launches an interactive prompt where you can run RethinkDB
|
|
||||||
queries such as:
|
|
||||||
|
|
||||||
```none
|
```none
|
||||||
# List problems detected within the rethinkdb cluster
|
# List problems in the cluster detected by the current node.
|
||||||
> r.db("rethinkdb").table("current_issues")
|
> r.db("rethinkdb").table("current_issues")
|
||||||
...
|
[]
|
||||||
|
|
||||||
# List all the DBs in RethinkDB
|
# List all the DBs in RethinkDB
|
||||||
> r.dbList()
|
> r.dbList()
|
||||||
|
@ -90,7 +107,7 @@ queries such as:
|
||||||
'repositories',
|
'repositories',
|
||||||
'repository_team_access',
|
'repository_team_access',
|
||||||
'tags' ]
|
'tags' ]
|
||||||
|
|
||||||
# List the entries in the repositories table
|
# List the entries in the repositories table
|
||||||
> r.db('dtr2').table('repositories')
|
> r.db('dtr2').table('repositories')
|
||||||
[ { id: '19f1240a-08d8-4979-a898-6b0b5b2338d8',
|
[ { id: '19f1240a-08d8-4979-a898-6b0b5b2338d8',
|
||||||
|
@ -101,7 +118,7 @@ queries such as:
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
Indvidual DBs and tables are a private implementation detail and may change in DTR
|
Individual DBs and tables are a private implementation detail and may change in DTR
|
||||||
from version to version, but you can always use `dbList()` and `tableList()` to explore
|
from version to version, but you can always use `dbList()` and `tableList()` to explore
|
||||||
the contents and data structure.
|
the contents and data structure.
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ that has `sh` and `ping`.
|
||||||
|
|
||||||
DTR uses RethinkDB for persisting data and replicating it across replicas.
|
DTR uses RethinkDB for persisting data and replicating it across replicas.
|
||||||
It might be helpful to connect directly to the RethinkDB instance running on a
|
It might be helpful to connect directly to the RethinkDB instance running on a
|
||||||
DTR replica to check the DTR internal state.
|
DTR replica to check the DTR internal state.
|
||||||
|
|
||||||
> **Warning**: Modifying RethinkDB directly is not supported and may cause
|
> **Warning**: Modifying RethinkDB directly is not supported and may cause
|
||||||
> problems.
|
> problems.
|
||||||
|
@ -50,27 +50,44 @@ commands:
|
||||||
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
```bash
|
```bash
|
||||||
# REPLICA_ID will be the replica ID for the current node.
|
# DTR_REPLICA_ID will be the replica ID for the current node.
|
||||||
REPLICA_ID=$(docker ps -lf name='^/dtr-rethinkdb-.{12}$' --format '{{.Names}}' | cut -d- -f3)
|
DTR_REPLICA_ID=$(docker ps -lf name='^/dtr-rethinkdb-.{12}$' --format '{{.Names}}' | cut -d- -f3)
|
||||||
|
# List problems in the cluster detected by the current node.
|
||||||
|
echo 'r.db("rethinkdb").table("current_issues")' | \
|
||||||
|
docker run -i --rm \
|
||||||
|
--net dtr-ol \
|
||||||
|
-e DTR_REPLICA_ID=${DTR_REPLICA_ID} \
|
||||||
|
-v dtr-ca-$DTR_REPLICA_ID:/ca \
|
||||||
|
dockerhubenterprise/rethinkcli:v2.2.0-ni non-interactive; \
|
||||||
|
echo
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
On a healthy cluster the output will be `[]`.
|
||||||
|
|
||||||
|
RethinkDB stores data in different databases that contain multiple tables. This
|
||||||
|
container can also be used to connect to the local DTR replica and
|
||||||
|
interactively query the contents of the DB.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```bash
|
||||||
|
# DTR_REPLICA_ID will be the replica ID for the current node.
|
||||||
|
DTR_REPLICA_ID=$(docker ps -lf name='^/dtr-rethinkdb-.{12}$' --format '{{.Names}}' | cut -d- -f3)
|
||||||
# This command will start a RethinkDB client attached to the database
|
# This command will start a RethinkDB client attached to the database
|
||||||
# on the current node.
|
# on the current node.
|
||||||
docker run -it --rm \
|
docker run -it --rm \
|
||||||
--net dtr-ol \
|
--net dtr-ol \
|
||||||
-v dtr-ca-$REPLICA_ID:/ca dockerhubenterprise/rethinkcli:v2.2.0 \
|
-e DTR_REPLICA_ID=${DTR_REPLICA_ID} \
|
||||||
$REPLICA_ID
|
-v dtr-ca-$DTR_REPLICA_ID:/ca \
|
||||||
|
dockerhubenterprise/rethinkcli:v2.2.0-ni
|
||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
This container connects to the local DTR replica and launches a RethinkDB client
|
|
||||||
that can be used to inspect the contents of the DB. RethinkDB
|
|
||||||
stores data in different databases that contain multiple tables. The `rethinkcli`
|
|
||||||
tool launches an interactive prompt where you can run RethinkDB
|
|
||||||
queries such as:
|
|
||||||
|
|
||||||
```none
|
```none
|
||||||
# List problems detected within the rethinkdb cluster
|
# List problems in the cluster detected by the current node.
|
||||||
> r.db("rethinkdb").table("current_issues")
|
> r.db("rethinkdb").table("current_issues")
|
||||||
...
|
[]
|
||||||
|
|
||||||
# List all the DBs in RethinkDB
|
# List all the DBs in RethinkDB
|
||||||
> r.dbList()
|
> r.dbList()
|
||||||
|
@ -90,7 +107,7 @@ queries such as:
|
||||||
'repositories',
|
'repositories',
|
||||||
'repository_team_access',
|
'repository_team_access',
|
||||||
'tags' ]
|
'tags' ]
|
||||||
|
|
||||||
# List the entries in the repositories table
|
# List the entries in the repositories table
|
||||||
> r.db('dtr2').table('repositories')
|
> r.db('dtr2').table('repositories')
|
||||||
[ { id: '19f1240a-08d8-4979-a898-6b0b5b2338d8',
|
[ { id: '19f1240a-08d8-4979-a898-6b0b5b2338d8',
|
||||||
|
@ -101,7 +118,7 @@ queries such as:
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
Indvidual DBs and tables are a private implementation detail and may change in DTR
|
Individual DBs and tables are a private implementation detail and may change in DTR
|
||||||
from version to version, but you can always use `dbList()` and `tableList()` to explore
|
from version to version, but you can always use `dbList()` and `tableList()` to explore
|
||||||
the contents and data structure.
|
the contents and data structure.
|
||||||
|
|
||||||
|
|
|
@ -50,20 +50,31 @@ commands:
|
||||||
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
```bash
|
```bash
|
||||||
# This command will start a RethinkDB client attached to the database
|
# List problems in the cluster detected by the current node.
|
||||||
# on the current node.
|
echo 'r.db("rethinkdb").table("current_issues")' | \
|
||||||
|
docker exec -i \
|
||||||
|
$(docker ps -q --filter name=dtr-rethinkdb) \
|
||||||
|
rethinkcli non-interactive; \
|
||||||
|
echo
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
On a healthy cluster the output will be `[]`.
|
||||||
|
|
||||||
|
RethinkDB stores data in different databases that contain multiple tables. This
|
||||||
|
container can also be used to connect to the local DTR replica and
|
||||||
|
interactively query the contents of the DB.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```bash
|
||||||
docker exec -it $(docker ps -q --filter name=dtr-rethinkdb) rethinkcli
|
docker exec -it $(docker ps -q --filter name=dtr-rethinkdb) rethinkcli
|
||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
RethinkDB stores data in different databases that contain multiple tables. The `rethinkcli`
|
|
||||||
tool launches an interactive prompt where you can run RethinkDB
|
|
||||||
queries such as:
|
|
||||||
|
|
||||||
```none
|
```none
|
||||||
# List problems detected within the rethinkdb cluster
|
# List problems in the cluster detected by the current node.
|
||||||
> r.db("rethinkdb").table("current_issues")
|
> r.db("rethinkdb").table("current_issues")
|
||||||
...
|
[]
|
||||||
|
|
||||||
# List all the DBs in RethinkDB
|
# List all the DBs in RethinkDB
|
||||||
> r.dbList()
|
> r.dbList()
|
||||||
|
@ -94,7 +105,7 @@ queries such as:
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
Indvidual DBs and tables are a private implementation detail and may change in DTR
|
Individual DBs and tables are a private implementation detail and may change in DTR
|
||||||
from version to version, but you can always use `dbList()` and `tableList()` to explore
|
from version to version, but you can always use `dbList()` and `tableList()` to explore
|
||||||
the contents and data structure.
|
the contents and data structure.
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ that has `sh` and `ping`.
|
||||||
|
|
||||||
DTR uses RethinkDB for persisting data and replicating it across replicas.
|
DTR uses RethinkDB for persisting data and replicating it across replicas.
|
||||||
It might be helpful to connect directly to the RethinkDB instance running on a
|
It might be helpful to connect directly to the RethinkDB instance running on a
|
||||||
DTR replica to check the DTR internal state.
|
DTR replica to check the DTR internal state.
|
||||||
|
|
||||||
> **Warning**: Modifying RethinkDB directly is not supported and may cause
|
> **Warning**: Modifying RethinkDB directly is not supported and may cause
|
||||||
> problems.
|
> problems.
|
||||||
|
@ -48,26 +48,34 @@ DTR replica to check the DTR internal state.
|
||||||
Use SSH to log into a node that is running a DTR replica, and run the following
|
Use SSH to log into a node that is running a DTR replica, and run the following
|
||||||
commands:
|
commands:
|
||||||
|
|
||||||
```bash
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
# REPLICA_ID will be the replica ID for the current node.
|
```bash
|
||||||
REPLICA_ID=$(docker ps -lf name='^/dtr-rethinkdb-.{12}$' --format '{{.Names}}' | cut -d- -f3)
|
# List problems in the cluster detected by the current node.
|
||||||
# This command will start a RethinkDB client attached to the database
|
echo 'r.db("rethinkdb").table("current_issues")' | \
|
||||||
# on the current node.
|
docker exec -i \
|
||||||
docker run -it --rm \
|
$(docker ps -q --filter name=dtr-rethinkdb) \
|
||||||
--net dtr-ol \
|
rethinkcli non-interactive; \
|
||||||
-v dtr-ca-$REPLICA_ID:/ca dockerhubenterprise/rethinkcli:v2.2.0 \
|
echo
|
||||||
$REPLICA_ID
|
|
||||||
{% endraw %}
|
|
||||||
```
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
This container connects to the local DTR replica and launches a RethinkDB client
|
On a healthy cluster the output will be `[]`.
|
||||||
that can be used to inspect the contents of the DB. RethinkDB
|
|
||||||
stores data in different databases that contain multiple tables. The `rethinkcli`
|
RethinkDB stores data in different databases that contain multiple tables. This
|
||||||
tool launches an interactive prompt where you can run RethinkDB
|
container can also be used to connect to the local DTR replica and
|
||||||
queries such as:
|
interactively query the contents of the DB.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```bash
|
||||||
|
docker exec -it $(docker ps -q --filter name=dtr-rethinkdb) rethinkcli
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
```none
|
```none
|
||||||
|
# List problems in the cluster detected by the current node.
|
||||||
|
> r.db("rethinkdb").table("current_issues")
|
||||||
|
[]
|
||||||
|
|
||||||
# List all the DBs in RethinkDB
|
# List all the DBs in RethinkDB
|
||||||
> r.dbList()
|
> r.dbList()
|
||||||
[ 'dtr2',
|
[ 'dtr2',
|
||||||
|
@ -86,7 +94,7 @@ queries such as:
|
||||||
'repositories',
|
'repositories',
|
||||||
'repository_team_access',
|
'repository_team_access',
|
||||||
'tags' ]
|
'tags' ]
|
||||||
|
|
||||||
# List the entries in the repositories table
|
# List the entries in the repositories table
|
||||||
> r.db('dtr2').table('repositories')
|
> r.db('dtr2').table('repositories')
|
||||||
[ { id: '19f1240a-08d8-4979-a898-6b0b5b2338d8',
|
[ { id: '19f1240a-08d8-4979-a898-6b0b5b2338d8',
|
||||||
|
@ -95,13 +103,9 @@ queries such as:
|
||||||
pk: 'cf5e8bf1197e281c747f27e203e42e22721d5c0870b06dfb1060ad0970e99ada',
|
pk: 'cf5e8bf1197e281c747f27e203e42e22721d5c0870b06dfb1060ad0970e99ada',
|
||||||
visibility: 'public' },
|
visibility: 'public' },
|
||||||
...
|
...
|
||||||
|
|
||||||
# List problems detected within the rethinkdb cluster
|
|
||||||
> r.db("rethinkdb").table("current_issues")
|
|
||||||
...
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Indvidual DBs and tables are a private implementation detail and may change in DTR
|
Individual DBs and tables are a private implementation detail and may change in DTR
|
||||||
from version to version, but you can always use `dbList()` and `tableList()` to explore
|
from version to version, but you can always use `dbList()` and `tableList()` to explore
|
||||||
the contents and data structure.
|
the contents and data structure.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue