WSL 使用Docker-compose 进行Doris自动化编排部署
在 wsl 使用 docker-compose 命令时,提示如下
The command 'docker-compose' could not be found in this WSL 1 distro.
We recommend to convert this distro to WSL 2 and activate
the WSL integration in Docker Desktop settings.
See https://docs.docker.com/desktop/windows/wsl/ for details.
升级发行版本

安装完成之后
PowerShell中执行
wsl --set-default-version 2

启用Docker Desktop


下载docker-compose.yml
wget http://doris.freeoneplus.com/doris/docker-compose/x86_64/1.1.0/perview2/docker-compose.yml
然后同目录下执行
docker-compose up
等执行完当前脚本以后,直接关闭当前命令窗口即可
version: '3'
services:
docker-fe:
image: "freeoneplus/apache-doris:1.1.0-perview2-fe"
container_name: "doris-fe"
tty: true
hostname: "fe"
restart: always
ports:
- 8030:8030
- 9030:9030
networks:
doris_net:
ipv4_address: 172.20.80.2
docker-be:
image: "freeoneplus/apache-doris:1.1.0-perview2-be"
container_name: "doris-be"
tty: true
hostname: "fe"
restart: always
ports:
- 8040:8040
- 9000:9000
- 9050:9050
networks:
doris_net:
ipv4_address: 172.20.80.3
register:
image: "freeoneplus/apache-doris:register"
container_name: "doris-register"
hostname: "register"
privileged: true
command: ["sh","-c","/root/register.sh"]
depends_on:
- docker-fe
- docker-be
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
networks:
doris_net:
ipv4_address: 172.20.80.4
networks:
doris_net:
ipam:
config:
- subnet: 172.20.80.0/16

执行之后直接关闭界面 不要 ctrl+c
查看容器

访问界面
http://localhost:8030/login 用户root 不需要密码

命令行>mysql -h localhost -P9030 -uroot
C:\Users\Lenovo>mysql -h localhost -P9030 -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.37 Doris version 1.1.0-preview2-Unknown
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
碰到的问题
官方的是在 powershell 执行命令切换之后没有生效
wsl --set-default-version 2

解决办法
- 管理员中输入
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

输入更新的命令
wsl.exe --set-version Ubuntu 2



本文档介绍了如何在Windows Subsystem for Linux (WSL)环境下,通过Docker-compose进行Apache Doris的自动化部署。首先,由于WSL1不支持docker-compose,需要将WSL升级到WSL2并启用Docker Desktop。然后,下载docker-compose.yml文件,执行`docker-compose up`启动服务。部署完成后,可以通过http://localhost:8030访问Doris的Web界面,并使用命令行工具如mysql连接到Doris。在过程中遇到的问题是WSL版本升级未生效,解决方法是在管理员权限下运行相关命令。
1794

被折叠的 条评论
为什么被折叠?



