云原生之使用docker部署开源Leanote 蚂蚁笔记

举报
江湖有缘 发表于 2022/11/12 16:11:07 2022/11/12
【摘要】 云原生之使用docker部署开源Leanote 蚂蚁笔记

一、Leanote蚂蚁笔记介绍

1.Leanote简介

Leanote 蚂蚁笔记是一款云笔记工具,支持私有本地部署。

2.Leanote简功能

  • Markdown 语法支持
  • 无干扰写作模式
  • Vim和Emacs编辑模式
  • 将笔记导出为 PDF
  • 批注操作
  • 可定制的博客主题

二、检查本地docker状态

[root@node ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2022-11-06 06:02:26 CST; 6 days ago
     Docs: https://docs.docker.com
 Main PID: 9869 (dockerd)
    Tasks: 155
   Memory: 1.8G
   CGroup: /system.slice/docker.service
           ├─  9869 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
           ├─ 45650 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 3522 -container-ip 192.168.48.2 -container-port 3306
           ├─ 45656 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 3522 -container-ip 192.168.48.2 -container-port 3306
           ├─ 46338 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 9300 -container-ip 172.17.0.2 -container-port 9000
           ├─ 46344 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 9300 -container-ip 172.17.0.2 -container-port 9000
           ├─ 46357 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 443 -container-ip 172.17.0.2 -container-port 443
           ├─ 46363 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 443 -container-ip 172.17.0.2 -container-port 443
           ├─ 46376 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8011 -container-ip 172.17.0.2 -container-port 80
           ├─ 46382 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8011 -container-ip 172.17.0.2 -container-port 80
           ├─ 71708 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 3520 -container-ip 172.17.0.3 -container-port 3000
           ├─ 71714 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 3520 -container-ip 172.17.0.3 -container-port 3000
           ├─ 76830 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8080 -container-ip 172.17.0.4 -container-port 8080
           ├─ 76835 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8080 -container-ip 172.17.0.4 -container-port 8080
           ├─ 76849 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 6881 -container-ip 172.17.0.4 -container-port 6881
           ├─ 76854 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 6881 -container-ip 172.17.0.4 -container-port 6881
           ├─ 76868 /usr/bin/docker-proxy -proto udp -host-ip 0.0.0.0 -host-port 6881 -container-ip 172.17.0.4 -container-port 6881
           ├─ 76874 /usr/bin/docker-proxy -proto udp -host-ip :: -host-port 6881 -container-ip 172.17.0.4 -container-port 6881
           ├─101732 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 9200 -container-ip 192.168.32.3 -container-port 9100
           ├─101746 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 9200 -container-ip 192.168.32.3 -container-port 9100
           ├─101760 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 3010 -container-ip 192.168.32.4 -container-port 3000
           ├─101766 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 3010 -container-ip 192.168.32.4 -container-port 3000
           ├─102555 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 9122 -container-ip 192.168.32.2 -container-port 9090
           └─102561 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 9122 -container-ip 192.168.32.2 -container-port 9090

Nov 07 17:12:31 node dockerd[9869]: time="2022-11-07T17:12:31.979456972+08:00" level=info msg="ignoring event" container=4fd3f498ff0be1...skDelete"
Nov 07 17:12:38 node dockerd[9869]: time="2022-11-07T17:12:38.726985355+08:00" level=info msg="ignoring event" container=4fd3f498ff0be1...skDelete"
Nov 07 17:12:51 node dockerd[9869]: time="2022-11-07T17:12:51.865626579+08:00" level=info msg="ignoring event" container=4fd3f498ff0be1...skDelete"
Nov 07 17:13:13 node dockerd[9869]: time="2022-11-07T17:13:13.437764628+08:00" level=info msg="ignoring event" container=5c2c7245e3d7c9...skDelete"
Nov 07 17:22:59 node dockerd[9869]: time="2022-11-07T17:22:59.706854426+08:00" level=info msg="ignoring event" container=9ee6365478b1b3...skDelete"
Nov 09 17:39:21 node dockerd[9869]: time="2022-11-09T17:39:21.635764314+08:00" level=info msg="ignoring event" container=3e1008e973becd...skDelete"
Nov 09 17:48:07 node dockerd[9869]: time="2022-11-09T17:48:07.633429323+08:00" level=info msg="Pull session cancelled"
Nov 09 17:48:08 node dockerd[9869]: time="2022-11-09T17:48:08.335184004+08:00" level=error msg="Not continuing with pull after error: c...canceled"
Nov 11 00:44:36 node dockerd[9869]: time="2022-11-11T00:44:36.758834914+08:00" level=info msg="ignoring event" container=3d1d952e40c6d7...skDelete"
Nov 11 00:48:57 node dockerd[9869]: time="2022-11-11T00:48:57.472382417+08:00" level=info msg="ignoring event" container=6ae040e9643b73...skDelete"
Hint: Some lines were ellipsized, use -l to show in full.

三、下载Leanote镜像

[root@node ~]# docker pull axboy/leanote
Using default tag: latest
latest: Pulling from axboy/leanote
23884877105a: Pull complete 
bc38caa0f5b9: Pull complete 
2910811b6c42: Pull complete 
36505266dcc6: Pull complete 
a4d269900d94: Pull complete 
5e2526abb80a: Pull complete 
d3eece1f39ec: Pull complete 
358ed78d3204: Pull complete 
1a878b8604ae: Pull complete 
978c572f0440: Pull complete 
35a600ffcf6a: Pull complete 
fa9f812cdfe6: Pull complete 
7a8109e27110: Pull complete 
e7cb12a43d53: Pull complete 
98477f6eb1fd: Pull complete 
Digest: sha256:9542a462043c9d293e8eda12e1b48ada77ae411121583631c5fa94083a730ef5
Status: Downloaded newer image for axboy/leanote:latest
docker.io/axboy/leanote:latest

四、部署Leanote

1.创建数据目录

[root@node ~]# mkdir -p /data/leanote/{db,conf,files,upload}
[root@node ~]# cd /data/leanote/
[root@node leanote]# 

2.创建Leanote容器

docker run -d -p 9800:9000 \
    -e "TZ=Asia/Shanghai"\
    --restart=always\
    -v /data/leanote/db:/data/db \
    -v /data/leanote/conf/:/data/leanote/conf \
    -v /data/leanote/files:/data/leanote/files \
    -v /data/leanote/upload:/data/leanote/public/upload \
    -m 50M --oom-kill-disable --memory-swap=-1\
    --name leanote \
    axboy/leanote

image.png

3.查看Leanote容器

[root@node leanote]# docker ps
CONTAINER ID   IMAGE                                                   COMMAND                  CREATED          STATUS          PORTS                                                                                                                             NAMES
587ff7c0b1c7   axboy/leanote                                           "docker-entrypoint.s…"   18 seconds ago   Up 14 seconds   27017/tcp, 0.0.0.0:9800->9000/tcp, :::9800->9000/tcp                                                                              leanote

4.查看Leanote占用资源


[root@node leanote]# docker stats --no-stream leanote 
CONTAINER ID   NAME      CPU %     MEM USAGE / LIMIT   MEM %     NET I/O     BLOCK I/O       PIDS
587ff7c0b1c7   leanote   0.30%     31.5MiB / 50MiB     63.01%    656B / 0B   541MB / 904MB   43

五、访问Leanote首页

image.png

六、Leanote基本操作

1.设置简体中文

image.png

2.登录Leanote

user1 username: admin, password: abc123 (管理员, 只有该用户才有权管理后台, 请及时修改密码)
user2 username: demo@leanote.com, password: demo@leanote.com (仅供体验使用)

image.png

image.png

3.新建笔记

image.png

【声明】本内容来自华为云开发者社区博主,不代表华为云及华为云开发者社区的观点和立场。转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息,否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。