forked from byzer-org/byzer-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
807b1ac
commit b5f1d8e
Showing
2 changed files
with
64 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,15 @@ | ||
## 使用Docker安装体验 | ||
|
||
> 因为自己的电脑支撑不起docker的空间开销,docker版本不在更新。优先推荐大家使用[下载预编译的安装包](https://docs.mlsql.tech/zh/installation/downloa_prebuild_package.html) | ||
【文档更新日志:2020-04-19】 | ||
|
||
在终端执行如下指令: | ||
> Note: 本文档适用于MLSQL Engine 1.6.0-SNAPSHOT/1.6.0 及以上版本。 | ||
> 对应的Spark版本可支持2.4.5 | ||
> | ||
```shell | ||
bash <(curl http://download.mlsql.tech/scripts/run-all.sh) | ||
``` | ||
|
||
如果上述运行方式有问题的话,您还可以尝试如下方式: | ||
|
||
``` | ||
wget http://download.mlsql.tech/scripts/run-all.sh | ||
chmod u+x run-all.sh | ||
./run-all.sh | ||
``` | ||
|
||
注意事项: | ||
|
||
0. Linux/MacOS,需要有Docker环境 | ||
1. 系统会检测 9002,9003,8080,3306四个端口是否被占用 | ||
2. 如果看到MySQL连接错误。这是脚本在检测MySQL启动后何时可用。不是错误,请放心。 | ||
|
||
## 注意 | ||
|
||
因为我们将镜像发布在了Docker Hub,不同网络情况下不是很稳定。 | ||
如果docker镜像拉去缓慢,可以设置阿里云镜像。首先去阿里云开通镜像服务,然后进入 | ||
https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors 页面,里面会教你做镜像加速。 | ||
|
||
|
@@ -43,77 +30,59 @@ systemctl daemon-reload | |
systemctl restart docker | ||
``` | ||
|
||
执行时间取决于你的下载速度。安装完毕后,你可以通过docker ps 常看运行的Docker容器。 | ||
|
||
![image.png](http://docs.mlsql.tech/upload_images/1063603-004da41021835b54.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) | ||
|
||
|
||
## 快速配置向导 | ||
|
||
在能够进入控制台使用前,你需要进行一些配置,请按照如下方式进行配置。 | ||
|
||
|
||
访问 http://127.0.0.1:9002 进行注册。只支持Gmail邮箱。 | ||
|
||
![image.png](http://docs.mlsql.tech/upload_images/1063603-5dbdcd1e735e9681.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) | ||
|
||
进入后看到如下界面,点击Team: | ||
|
||
![image.png](http://docs.mlsql.tech/upload_images/WX20190807-095256.png) | ||
执行时间取决于你的下载速度。 | ||
|
||
可以见到一个快速设置页: | ||
## 最快方式 | ||
|
||
![image.png](http://docs.mlsql.tech/upload_images/WX20190807-095357.png) | ||
|
||
随便填入一个team名称,点击下一步: | ||
|
||
|
||
![image.png](http://docs.mlsql.tech/upload_images/WX20190807-095440.png) | ||
``` | ||
bash <(curl http://download.mlsql.tech/scripts/run-all.sh) | ||
``` | ||
|
||
选中刚才建立的team,然后设置一个角色,下一步 | ||
## 手动搭建 | ||
|
||
![image.png](http://docs.mlsql.tech/upload_images/WX20190807-095542.png) | ||
创建网络: | ||
|
||
把自己邀请到team1/admin里,下一步: | ||
``` | ||
docker network rm mlsql-network | ||
docker network create mlsql-network | ||
``` | ||
|
||
![image.png](http://docs.mlsql.tech/upload_images/WX20190807-095644.png) | ||
启动MySQL容器: | ||
|
||
开始给team和role添加后端engine,这里url 一定要 填写: mlsql-server:9003. 因为我使用了docker网络。点击下一步: | ||
``` | ||
docker run --name mlsql-db -p 3306:3306 \ | ||
--network mlsql-network \ | ||
-e MYSQL_ROOT_PASSWORD=mlsql \ | ||
-d techmlsql/mlsql-db:1.6.0-SNAPSHOT | ||
``` | ||
|
||
![image.png](http://docs.mlsql.tech/upload_images/WX20190807-095834.png) | ||
启动MLSQL Engine: | ||
|
||
将刚才的添加的engine设置为默认的engine,点击下一步: | ||
``` | ||
docker run --name mlsql-server -d \ | ||
--network mlsql-network \ | ||
-p 9003:9003 \ | ||
techmlsql/mlsql:spark_2.4-1.6.0-SNAPSHOT | ||
``` | ||
|
||
![image.png](http://docs.mlsql.tech/upload_images/WX20190807-095955.png) | ||
启动 MLSQL Console: | ||
|
||
完成。 | ||
``` | ||
docker run --name mlsql-console \ | ||
--network mlsql-network \ | ||
-p 9002:9002 \ | ||
-e MLSQL_ENGINE_URL=http://mlsql-server:9003 \ | ||
-e MY_URL=http://mlsql-console:9002 \ | ||
-e USER_HOME=/tmp/users \ | ||
-e MYSQL_HOST=mlsql-db \ | ||
-d \ | ||
techmlsql/mlsql-console:1.6.0-SNAPSHOT | ||
``` | ||
|
||
![image.png](http://docs.mlsql.tech/upload_images/WX20190807-100026.png) | ||
|
||
这个时候返回主界面,然后执行一个命令看是否都联通了(第一次运行会比较久): | ||
|
||
![image.png](http://docs.mlsql.tech/upload_images/WX20190807-100144.png) | ||
|
||
大工告成。如果你想要看更多示例,请登录 try.mlsql.tech,然后用一下用户名登录查看: | ||
|
||
``` | ||
account: [email protected] | ||
password: 123456 | ||
``` | ||
|
||
|
||
## 结束语 | ||
在docker里我们默认关闭了表权限校验,否则使用时,使用jdbc等各种数据的时候,都需要添加权限,比较繁琐。 | ||
用户也可以修改run-all.sh脚本。 | ||
在启动MLSQL Console的时候,加上-e ENABLE_AUTH_CENTER=true 即可。 | ||
|
||
```shell | ||
#!/usr/bin/env bash | ||
|
||
java -cp .:${MLSQL_CONSOLE_JAR} tech.mlsql.MLSQLConsole \ | ||
-mlsql_cluster_url ${MLSQL_CLUSTER_URL} \ | ||
-my_url ${MY_URL} \ | ||
-user_home ${USER_HOME} \ | ||
-enable_auth_center ${ENABLE_AUTH_CENTER:-false} \ | ||
-config ${MLSQL_CONSOLE_CONFIG_FILE} | ||
``` |