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