centos7 安装 archery1.9 基于docker-compose

软件下载

wget https://github.com/hhyo/Archery/archive/refs/tags/v1.9.1.tar.gz -O Archery-1.9.1.tar.gz
tar -zxvf Archery-1.9.1.tar.gz

需要开启防火墙 

systemctl start firewalld 

安装docker

yum install docker-ce -y

启动docker

systemctl start docker

安装docker-compose 

yum -y install docker-compose

启动archery 初始化配置

# 进入目录
cd Archery-1.9.1/src/docker-compose

# 修改配置文件
vim  docker-compose.yaml

version: '3'

services:
  redis:
    image: redis:5
    container_name: redis
    restart: always
    command: redis-server --requirepass 123456
    expose:
      - "6379"

  mysql:
    image: mysql:5.7
    container_name: mysql
    restart: always
    ports:
      - "3306:3306"
    volumes:
      - "./mysql/my.cnf:/etc/mysql/my.cnf"
      - "./mysql/datadir:/var/lib/mysql"
    environment:
      MYSQL_DATABASE: archery
      MYSQL_ROOT_PASSWORD: 123456   # 修改archery 数据库密码

  goinception:
    image: hanchuanchuan/goinception
    container_name: goinception
    restart: always
    ports:
      - "4000:4000"
    volumes:
      - "./inception/config.toml:/etc/config.toml"

  archery:
    image: hhyo/archery:v1.9.1
    container_name: archery
    restart: always
    ports:
      - "9123:9123"
    volumes:
      - "./archery/settings.py:/opt/archery/local_settings.py"
      - "./archery/soar.yaml:/etc/soar.yaml"
      - "./archery/docs.md:/opt/archery/docs/docs.md"
      - "./archery/downloads:/opt/archery/downloads"
      - "./archery/sql/migrations:/opt/archery/sql/migrations"
      - "./archery/logs:/opt/archery/logs"
      - "./archery/keys:/opt/archery/keys"
    entrypoint: "dockerize -wait tcp://mysql:3306 -wait tcp://redis:6379 -timeout 60s /opt/archery/src/docker/startup.sh"
    env_file:
      - .env

修改mysql 配置信息

vim /root/archery-1.9.1/src/docker-compose/archery/settings.py
# -*- coding: UTF-8 -*-


DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'archery',
        'USER': 'root',
        'PASSWORD': '123456',    # 修改密码
        'HOST': '192.168.217.145',    # 修改mysql 镜像的权限 
        'PORT': '3306',
        'OPTIONS': {
            'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
            'charset': 'utf8mb4'
        },
        'TEST': {
            'NAME': 'test_archery',
            'CHARSET': 'utf8mb4',
        },
    }
}

修改docker mysql5.7的root 权限 

#登录mysql 容器 
docker exec -it mysql /bin/bash
#查询权限
select  User,authentication_string,Host from user;
# 给root赋予权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456'  ;
flush privileges;

表初始化

docker exec -ti archery /bin/bash
cd /opt/archery
source /opt/venv4archery/bin/activate
python3 manage.py makemigrations sql
python3 manage.py migrate

数据初始化

python3 manage.py dbshell<sql/fixtures/auth_group.sql
python3 manage.py dbshell<src/init_sql/mysql_slow_query_review.sql

创建管理用户

python3 manage.py createsuperuser  #admin/adminadmin

交互信息

admin 
admin@qq.com
123456
123456     再次确认密码

重启服务 

docker restart archery

网页访问

配置sql上线 

必须配置 goInception配置工单审核流配置

添加实例

增加对应的组 在实例列表里面选择实例名称 选择对应的 组 

测试实例的连通性

增加资源组

提交sql 上线之后 执行报错 

修改goinception 的配置  

vim  /root/archery-1.9.1/src/docker-compose/inception/config.toml

重启goception 服务

docker restart goception 

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

村长在路上

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值