Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyo authored and lihuanhuan committed Apr 12, 2018
1 parent bc313f1 commit 419fe4e
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 3 deletions.
63 changes: 61 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,71 @@ linux : 64位linux操作系统均可
### 主要配置文件:
* archer/archer/settings.py<br/>

### docker部署:
### 采取docker部署:
#### inception部署
[项目地址](https://github.com/hhyo/inception)
- 自定义配置文件,参考配置(inc.cnf)
```
[inception]
general_log=1
general_log_file=inception.log
port=6669
socket=/tmp/inc.socket
character-set-client-handshake=0
character-set-server=utf8
inception_remote_system_password=root #inception备份库配置信息
inception_remote_system_user=wzf1
inception_remote_backup_port=3306
inception_remote_backup_host=127.0.0.1
inception_support_charset=utf8mb4
inception_enable_nullable=0
inception_check_primary_key=1
inception_check_column_comment=1
inception_check_table_comment=1
inception_osc_min_table_size=1
inception_osc_bin_dir=/data/temp
inception_osc_chunk_time=0.1
inception_enable_blob_type=1
inception_check_column_default_value=1
```
- 指定配置文件和映射端口启动
```
docker run --name inception -v /etc/inc.cnf:/etc/inc.cnf -p 6669:6669 -d registry.cn-hangzhou.aliyuncs.com/lihuanhuan/inception
```
- 访问
```
mysql -hxxxx -P6669
```
#### archer部署
- 下载settings.py文件,替换相关配置项,其中docker已经包含SQLADVISOR,请将SQLADVISOR配置项修改为

```
SQLADVISOR ='/opt/SQLAdvisor/sqladvisor/sqladvisor'
```

- 指定配置文件和映射端口启动
```
docker run --name archer -v
/etc/archer/settings.py:/opt/archer/archer/settings.py -p 9123:9123 -d registry.cn-hangzhou.aliyuncs.com/lihuanhuan/arche
```
- 进入容器,初始化数据库,后续升级可走增量变动脚本
```
docker exec -ti archer /bin/bash
cd /opt/archer
source venv4archer/bin/activate
# 初始化数据库
python3 manage.py makemigrations sql
python3 manage.py migrate
# 创建管理员账号
python3 manage.py createsuperuser
```
- 访问
```
http://xxxx:9123/
```

### 手动安装步骤:
centos7一键安装脚本(可配置好除inception和SQLAdvisor之外的环境):src/script/centos7_install.sh
centos7一键安装脚本:克隆代码到本地后执行`bash src/script/centos7_install.sh`,可配置好除inception和SQLAdvisor之外的环境
1. 环境准备:<br/>
(1)克隆代码到本地: [email protected]:hhyo/archer.git 或下载zip包<br/>
(2)安装mysql集群,请注意保证mysql数据库默认字符集为utf8或utf8mb4<br/>
Expand Down
2 changes: 1 addition & 1 deletion src/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ ENV LC_ALL zh_CN.utf8
EXPOSE 9123

#start service
ENTRYPOINT source venv4archer/bin/activate && bash /opt/archer/startup.sh && bash
ENTRYPOINT source /opt/venv4archer/bin/activate && bash /opt/archer/startup.sh && bash

0 comments on commit 419fe4e

Please sign in to comment.