MongoDB Charts 安装和使用
SegmentFault
共 4630字,需浏览 10分钟
· 2020-08-07
1.什么是MongoDB Charts
2.安装和运行MongoDB Charts
2.1 准备环境
Mac/Linux 系统 Docker version 18.09.1 MongoDB shell version v4.2.0
2.2 创建一个目录存储图表配置
mkdir mongodb-charts
cd mongodb-charts
2.3 下载MongoDB Charts Docker Compose file
version: '3.3'
services:
charts:
image: quay.io/mongodb/charts:19.12.1
hostname: charts
ports:
# host:container port mapping. If you want MongoDB Charts to be
# reachable on a different port on the docker host, change this
# to
:80, e.g. 8888:80. - 80:80
- 443:443
volumes:
- keys:/mongodb-charts/volumes/keys
- logs:/mongodb-charts/volumes/logs
- db-certs:/mongodb-charts/volumes/db-certs
- web-certs:/mongodb-charts/volumes/web-certs
environment:
# The presence of following 2 environment variables will enable HTTPS on Charts server.
# All HTTP requests will be redirected to HTTPS as well.
# To enable HTTPS, upload your certificate and key file to the web-certs volume,
# uncomment the following lines and replace with the names of your certificate and key file.
# CHARTS_HTTPS_CERTIFICATE_FILE: charts-https.crt
# CHARTS_HTTPS_CERTIFICATE_KEY_FILE: charts-https.key
# This environment variable controls the built-in support widget and
# metrics collection in MongoDB Charts. To disable both, set the value
# to "off". The default is "on".
CHARTS_SUPPORT_WIDGET_AND_METRICS: 'on'
# Directory where you can upload SSL certificates (.pem format) which
# should be considered trusted self-signed or root certificates when
# Charts is accessing MongoDB servers with ?ssl=true
SSL_CERT_DIR: /mongodb-charts/volumes/db-certs
networks:
- backend
secrets:
- charts-mongodb-uri
networks:
backend:
volumes:
keys:
logs:
db-certs:
web-certs:
secrets:
charts-mongodb-uri:
external: true
2.4 Enable Docker Swarm mode
docker swarm init
2.5 拉取MongoDB Charts image 镜像
docker pull quay.io/mongodb/charts:19.12.1
2.6 测试连接到 MongoDB 数据库
docker run --rm quay.io/mongodb/charts:19.12.1 charts-cli test-connection 'mongodb://:@host.docker.internal'
docker run --rm quay.io/mongodb/charts:19.12.1 charts-cli test-connection 'mongodb://host.docker.internal'
2.7 创建一个Docker secret 为MongoDB Charts
echo "" | docker secret create charts-mongodb-uri -
我的输入:
echo "mongodb://host.docker,internal" | docker secret create charts-mongodb-uri -
2.8 运行MongoDB Charts 容器
docker stack deploy -c charts-docker-swarm-19.12.1.yml mongodb-charts
2.9 查看运行状态
docker service ls
2.10 创建 MongoDB Charts 访问 Users账号
docker exec -it \
$(docker container ls --filter name=_charts -q) \
charts-cli add-user --first-name "
" --last-name " " \ --email "
" --password " " \ --role "
"
docker exec -it `
$(docker container ls --filter name=_charts -q) `
charts-cli add-user --first-name "
" --last-name " " ` --email "
" --password " " ` --role "
"
2.11 直接访问 Compose file 里配置的端口
3. MongoDB Charts 使用
3.1 首先先关联一个 MongoDB 数据源
3.2 选择一个MongoDB数据库
3.3 在Dashboard 一栏New Dashboard
3.4 新增一个Chart
3.4.1 选择一个Collections
3.4.2 选择Chart Type
3.4.3 需求:根据订单状态 去统计图表
4. Embed Chart 导出你的图表 嵌入到自己的Web环境
4.1 保存你设置好的图表后
4.2 开启匿名访问图表 并且复制 Embed Code
4.3 创建HTML 文件
mongo-charts
Mongodb-Charts
5. 总结
评论
金融研究 | 使用Python测量关键审计事项的「信息含量」
Tips: 公众号推送后内容只能更改一次,且只能改20字符。如果内容出问题,或者想更新内容, 只能重复推送。为了更好的阅读体验,建议阅读本文博客版, 链接地址https://textdata.cn/blog/2023-01-13-information-content-of-critical-aud
大邓和他的Python
0
金融研究(更新) | 使用Python构建关键审计事项的「信息含量」
Tips: 公众号推送后内容只能更改一次,且只能改20字符。如果内容出问题,或者想更新内容, 只能重复推送。为了更好的阅读体验,建议阅读本文博客版, 链接地址https://textdata.cn/blog/2023-01-13-information-content-of-critical-aud
大邓和他的Python
0
词向量(更新) | 使用MD&A2001-2022语料训练Word2Vec模型
buTips: 公众号推送后内容只能更改一次,且只能改20字符。 如果内容出问题,或者想更新内容, 只能重复推送。 为了更好的阅读体验,建议阅读本文博客版, 链接地址https://textdata.cn/blog/2023-03-24-load-w2v-and-expand-your-concpe
大邓和他的Python
0
管理世界2024 | 使用管理层讨论与分析测量「企业人工智能指标」
Tips: 公众号推送后内容只能更改一次,且只能改20字符。如果内容出问题,或者想更新内容, 只能重复推送。为了更好的阅读体验,建议阅读本文博客版, 链接地址 https://textdata.cn/blog/2024-04-19-ai-improve-firm-productivity/
大邓和他的Python
0
Open-Sora全面开源升级:支持16s视频生成和720p分辨率
机器之心发布 机器之心编辑部Open-Sora 在开源社区悄悄更新了,现在单镜头支持长达16秒的视频生成,分辨率最高可达720p,并且可以处理任何宽高比的文本到图像、文本到视频、图像到视频、视频到视频和无限长视频的生成需求。我们来试试效果。生成个横屏圣诞雪景,发b站再生成个竖屏,发抖音还能
机器学习算法与Python实战
0
文本嵌入、文本分类和语义搜索
在实践中使用大型语言模型(LLM)中,RAG 的一个关键部分是使用文本嵌入从知识库中自动检索相关信息。在这里,我将更深入地讨论文本嵌入,并分享两个简单(但功能强大)的应用:文本分类和语义搜索。ChatGPT 吸引了全世界对人工智能及其潜力的想象。ChatGPT 的聊天界面是这一影响的关键因素,它使人
大邓和他的Python
0
一站式解决方案:基于 Arthas 实现服务发现和权限控制
来源:juejin.cn/post/7281849496983994383👉 欢迎加入小哈的星球 ,你将获得: 专属的项目实战 / Java 学习路线 / 一对一提问 / 学习打卡 / 赠书福利全栈前后端分离博客项目 2.0 版本完结啦, 演示链接
小哈学Java
0
GPT的风也吹到了CV,详解自回归视觉模型的先驱! ImageGPT:使用图像序列训练图像 GPT模型
作者丨科技猛兽编辑丨极市平台导读 在 CIFAR-10 上,iGPT 使用 linear probing 实现了 96.3% 的精度,优于有监督的 Wide ResNet,并通过完全微调实现了 99.0% 的精度,匹配顶级监督预训练模型。本文目录1 自回归视觉模型的先驱 ImageGPT:
机器学习初学者
0