cube store 很早就已经支持minio s3 了,以下是一个测试,以及数据查看
运行
- docker-compose
version: '3'
services:
minio:
image: minio/minio
ports:
- "9002:9000"
- "19001:19001"
environment:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
command: server --console-address :19001 --quiet /data
cubestore_router:
image: cubejs/cubestore:latest
ports:
- "3306:3306"
- "3030:3030"
- "5432:5432"
environment:
- CUBESTORE_SERVER_NAME=cubestore_router:9999
- CUBESTORE_META_PORT=9999
- CUBESTORE_WORKERS=cubestore_worker_1:9001
- CUBESTORE_MINIO_BUCKET=demoapp
- CUBESTORE_MINIO_REGION=us-east-1
- CUBESTORE_MINIO_SERVER_ENDPOINT=http://minio:9000
- CUBESTORE_MINIO_ACCESS_KEY_ID=minio
- CUBESTORE_MINIO_SECRET_ACCESS_KEY=minio123
depends_on:
- minio
cubestore_worker_1:
image: cubejs/cubestore:latest
environment:
- CUBESTORE_SERVER_NAME=cubestore_worker_1:9001
- CUBESTORE_WORKER_PORT=9001
- CUBESTORE_META_ADDR=cubestore_router:9999
- CUBESTORE_WORKERS=cubestore_worker_1:9001
- CUBESTORE_MINIO_BUCKET=demoapp
- CUBESTORE_MINIO_REGION=us-east-1
- CUBESTORE_MINIO_SERVER_ENDPOINT=http://minio:9000
- CUBESTORE_MINIO_ACCESS_KEY_ID=minio
- CUBESTORE_MINIO_SECRET_ACCESS_KEY=minio123
depends_on:
- cubestore_router
- minio
- 启动
注意启动顺序,出现异常了,多次重试
docker-compose up -d
效果
可以使用mysql cli 启动测试
- 进入服务
mysql -uroot -h127.0.0.1
- 创建表
create schema demoapp;
create table demoapp.demoapp(id varchar(100),age int);
insert into demoapp.demoapp(id,age) values('1',3);
select * from demoapp.demoapp;
效果
s3
说明
cube.js 计划使用cube store 替换redis 了,实际上这个是一个很大的变动,期待ga,redis 有些场景还是比较费事的,管理以及使用上都不是特别的好
参考资料
https://cube.dev/docs/reference/environment-variables
https://cube.dev/docs/caching/using-pre-aggregations
https://cube.dev/docs/caching/running-in-production
原创文章,作者:wure,如若转载,请注明出处:https://blog.ytso.com/277803.html