Skip to content

Commit

Permalink
fix(dcoker): FixDocker deployment commands(stoneatom#1499)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nliver committed Mar 30, 2023
1 parent 8d055d7 commit 7a603af
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
18 changes: 12 additions & 6 deletions Docs/02-getting-started/quick-deploy-in-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ sidebar_position: 3.2

# Quick Deployment in a Docker Container
## Prerequisites
The image of StoneDB is downloaded from Docker Hub.

The image of StoneDB is downloaded from Docker Hub.You can read the Dockerhub documentation, which must be up to date.
[Docker Hub](https://hub.docker.com/r/stoneatom/stonedb)

## Procedure
The username and password for login are **root** and **stonedb123**.

Make sure your CPU supports AVX

```bash
cat /proc/cpuinfo |grep avx
```
### 1. Pull the image
Run the following command:
```bash
Expand All @@ -19,11 +24,11 @@ docker pull stoneatom/stonedb:v1.0.3
### 2. Run the image
Run the following command:
```bash
docker run -p 13306:3306 -v $stonedb_volumn_dir/data/:/stonedb57/install/data/ -it -d stoneatom/stonedb:v1.0.3 /bin/bash
docker run -p 3306:3306 -itd -v $YOU_DATA_DIR:/opt -e MYSQL_ROOT_PASSWORD='$YOU_PASSWORD' stoneatom/stonedb:v1.0.3
```
Altenatively, run the following command:
```bash
docker run -p 13306:3306 -it -d stoneatom/stonedb:v1.0.3 /bin/bash
docker run -p 3306:3306 -itd -e MYSQL_ROOT_PASSWORD='$YOU_PASSWORD' stoneatom/stonedb:v1.0.3
```
Parameter description:

Expand All @@ -38,10 +43,11 @@ Parameter description:
docker ps
# Use the "cocker ps" command to obtain the container ID and enter the Docker container.
docker exec -it <Container ID> bash
<Container ID>$ /stonedb56/install/bin/mysql -uroot -pstonedb123

<Container ID>$ /opt/stonedb57/install/bin/mysql -uroot -p$YOU_PASSWORD
```
### **4. Log in to StoneDB using a third-party tool**
You can log in to StoneDB by using third-party tools such as mysql, Navicat, and DBeaver. The following code uses mysql as an example.
```shell
mysql -h<Host IP address> -uroot -pstonedb123 -P<Mapped port of the host>
mysql -h<Host IP address> -uroot -p$YOU_PASSWORD -P<Mapped port of the host>
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@ sidebar_position: 3.2

# Docker快速部署StoneDB
## StoneDB Docker Hub地址

建议您阅读Docker hub的最新文档。
[Docker Hub](https://hub.docker.com/r/stoneatom/stonedb)

## 使用方法
默认登录账号密码为 root,stonedb123
默认登录账号密码为 root,密码会随机生成,也可以自定义。

确保你的 CPU 支持 AVX

```bash
cat /proc/cpuinfo |grep avx
```
### 1、docker pull
```bash
docker pull stoneatom/stonedb:v1.0.3
Expand All @@ -27,23 +35,24 @@ docker pull stoneatom/stonedb:v1.0.3
-d:启动不进入容器,想要进入容器需要使用指令 docker exec

```bash
docker run -p 13306:3306 -v $stonedb_volumn_dir/data/:/stonedb57/install/data/ -it -d stoneatom/stonedb:v1.0.3 /bin/bash
docker run -p 3306:3306 -itd -v $YOU_DATA_DIR:/opt -e MYSQL_ROOT_PASSWORD='$YOU_PASSWORD' stoneatom/stonedb:v1.0.3
```
or
```bash
docker run -p 13306:3306 -it -d stoneatom/stonedb:v1.0.3 /bin/bash
docker run -p 3306:3306 -itd -e MYSQL_ROOT_PASSWORD='$YOU_PASSWORD' stoneatom/stonedb:v1.0.3
```
### 3、登录容器内使用 StoneDB
```bash
#获取 docker ID
$ docker ps

#通过 docker ps 获取 docker ID,进入容器
$ docker exec -it 容器ID bash
容器ID$ /stonedb56/install/bin/mysql -uroot -pstonedb123
docker exec -it <Container ID> bash
#如果$YOU_PASSWORD不正确,请去log中查看默认生成的密码
<Container ID>$ /opt/stonedb57/install/bin/mysql -uroot -p$YOU_PASSWORD
```
### 4、容器外登录StoneDB
使用客户端登录,其他第三方工具,如 Navicat、DBeaver 登录方式类似
```shell
mysql -h宿主机IP -uroot -pstonedb123 -P宿主机映射端口
mysql -h<Host IP address> -uroot -p$YOU_PASSWORD -P<Mapped port of the host>
```

0 comments on commit 7a603af

Please sign in to comment.