ECS 7天实践训练营-基于ECS搭建个人Leanote云笔记本

创建资源和连接云服务器

之前写过,这次不写。

安装MongoDB

1.安装MongoDB
yum -y install mongodb mongodb-server.x86_64 mariadb-dev! D 9 7 | d Tel.i686
代码解释:
yum -y依然是在线下载,后面接的是包名
之后代码显示如下:

Dependency Updated:
e2fsprogs.xz $ ] a o86_64 0:1.42.9-17.el7       e2fsprogs-libs.x86_64 0:1` l @ y R } y.42.9-17.el7a @ ! t o / b v   glibc.x86_64 0:2.17-307.el7.1
glibc-common.x86_64 0:2.17-307.el7.1   krb5-libs.x86_64 0:1.15.1-46.el7        libcom_err.x86_64 0:1.42.9h F N % + `-17.el7
libselinux.x86_64 0:2.5-15.el7         libselia G , 2 1 ? x knux-python.x86_64 0:2.5-15.eP + X M 7 # w Gl7   libb _ Y 2 ~ @ lselinux-utils.x86_64 0:2.5-15.el7
libss.x86_64 0:1.42.9-17.el7           mariadb-libs.x86_64 1:5.5D R J c 8.65-1.el7      nscd.x86_64 0:2.17-307.el7.1
Complete!

2.启动MongoDB服务。
systemctl start0 ! u d 4 V ) , B mongod
代码解( @ #释:
systemctl start作用是启动xx服务,这里接的是mongod,在之前的学习里有docker
3.查看MongoDB运行状态F D g y m ~ Y B k
systemctl status mongod
代码解释:
systemctl status用来查询服务运行状态
之后代码显示如下:

● mongod.service - ps://www.fons.com.cn/tag/high" target="_blank">High-performance, schema-free document-oriented database
Loaded: loaded (/usr/lib/systemd/system/[ 5 7mongod.service; disabled; vendor preV q ~set: disabled)
Active: active (running)2 w N z O & a $ sinceF ) n J Thu 2020-09-24 20:11:03- 1 ^ - { G o L CST; 2min 27s ago
Process: 1642 ExecStart=/usr/bin/mongod $OPTIONS run (code=exi= F F V X y x )tedK % O z !, status=0/SUCCESS)
Main PID: 1644 (mongod)
CGroup: /system.slice/mongod.service
└─1644 /usr/bin/mongod -_ R # ^ v i Q {-quiet -f /etc/; { Q Y o % /mongod.conf run
Sep 24 20:11:03 iZuf6e 6 e6ogddyortq9vi8pvvZ systemd[1]: S9 7 & C u S E # 9tarting High-performance, schema-free document-oriented database...
Sep 24 20:11:03 iZufB ] 7 U % } E y66ogddyortv U L 6 ;q9vi8pvvZ mongod[1642]: about to fork child process, waiting unth 2 Q 2 #il server is ready ...ons.
Sep 24 20: ( ~ . Y + D 1 E11:03 iZuf66ogddyortq9vi8pvvZ& U % X v 2 mongod[1642]: forked process: 1644
Sep 24 20:11:03 iZuf66ogddyortq9vi8pvvZ systemd[1]: Started High-performance, schema-free document-oriented database.
Hint: Some lines werH L C X Le ellipsized, use -l to show in full.

安装Leanote

1.下载Leanotea X p Y二进制安装包。
wget https://nchc.dl.sourceforge.ne / - ,t/project/leanotew 7 L 2-bin/2.6.1/leanote-linux-amd64-v2.6.1.bin.tar.gz
之后B z % z ~ f代码显示如下:

--2020-09T 2 y , h z 2 F-24 20:16:s E Z +  E19--  https://nchc.dl.sourceforge.H . D T + ~net/project/leanote-bin/2.6.1/leanote-liv u I 9  M ! E Ynux-amd64-v2.6.1.bin.tar.gz
Resolvin0 : jg nchc.dl.sourceforge.net (nchc.dl.sourceforge.net)... 140.110.p / 6 % Q M ]96.69, 2001:e10:ffff:1f02% N L 6 8 M::17
Connecy ! X y G M ` Wting to nchc.dl.sourceforge.net (nchc.dl.sourceforge.net)|140.110.96.69|:443... connected.
HTTP requB I U [ Qest sj F ( V p A 6 Cent, awaiting response... 200 OK
Length: 21438265 (20M) [application/x-gzip]
Saving to: ‘leanote-linux-amd64{ ! W # Z 0 [-v2.6.1.bin.tar.gz’
100%[==============================================================================>] 21,43^ 6 0 h d r % t t8,265  5.28MB/s   in@ * P q ! 9 q 0 ~ 4.9s
2020-09-24 20:16:24 (4| d [ u ! z I Y.20 MB/s) - ‘leanote-linux-amd64-v2.6.1.bin.tar.gz’ saved [21438265/21438265]

2.解压安装包。
tar -zxvf leanote-linux-amd64-v2.6.1.bin.tar.gz
代码解释:
tar是Unix和类Unix系统上的压缩打包工具,可以将多个文件合并为一个文件,打包后的文件后缀亦为“tar”。
tar -zxvf file.tar.gz 用来解压 tar.gz
3Z W U A.编辑文件leanote/conf/app.conf。

  1. 使用vim编辑器打开文件leanoteT ` c |/conf/app.conf。
    vim leanote/conf/app.conf
  2. 输入:/app.secret=并按下回车查找app.secret位置w @ P c F
  3. 按下i键进入编辑模式,修改该项的值为任意4 X O , @ j字符串: ; I
  4. 修改完成后,按下esc键退出编辑模式,输入:wq保存并退出。
    4.初始化数据库

mongorestork [ H Y *e -h localhost -d leanote --dir /root/leanote/mongodb_backup/leanote_install_dU 0 W @ Eata/
代码解释:
--dir 后面为解压后的leanote中的路径,可将其改为自己对应的路径
之后代码显示如下:

2020-09-24T20:36:7 J y |34.736+0800 /root/leanote/mongodb_backup/leanote4 1 X_install_data/group_users.bson
2020-09-2! 2 n t m4T20:36:34.736! l ? } B ; %+0800    going intI X - = To namespace [leanote.group_users]
1 objects found
2020-09-24T20:36:34.737+0800    Creating index: { key: { _id: 1 }, name: "_id_", ns: ". ~ A - n d R {leanote.y  z egroup_users" }
2020-09-24T20:3/ * H z z g ; F ^6:34.737+0800    Creating inde5 ( 1 T Z /x: { key: { GroupId: 1 }, name: "GroupId_1", ns: "leanote.group_users", backT W ? $ Mground: true }

5.启动服务。
nohup bash /root/leanote/bin/run.sh >6 l 9 = Q I 6 p; /root/leanote/run.log 2>&1 &
6.访问云笔记。
在浏览器中访问http:d 6 ( $ M//公网地址>:9000
打开如下图所示:
ECS 7天实践训练营-基于ECS搭建个人Leanote云笔记本
登录成 ` s X # ?功后w g 9 /如下图所示:
ECS 7天实践训练营-基于ECS搭建个人Leanote云笔记本