Introduction to Experience Lab
Ali Cloud developer Laboratory, providing free Ali cloud resources, rich cloud computing application scenarios, Step by Step to complete the experience of cloud products
Address: ali cloud experience laboratory developer.aliyun.com/adc/labs/
tutorial
This tutorial will show you how to build a personal Leanote Cloud Notebook.
Experience the scene
Ali Cloud Experience Lab will provide an ECS instance (cloud server) configured with CentOS 7.7. You can follow the instructions in this tutorial to build a Leanote cloud laptop based on your existing environment.
Ali cloud experience scene resources: developer.aliyun.com/adc/scenari…
Background knowledge
Leanote is an online cloud note-taking application with the following features:
- Support web page, PC, mobile APP client and wechat version, record at any time, easy to share, support voice, picture input.
- Code highlight, code highlight for all major languages, write code in Leanote as much as you want, and remember the knowledge.
- Markdown editor, real-time sync preview.
- Professional mathematical formula editing, such as Word and Latex.
- Supports the creation of mind maps, which display scattered ideas in a hierarchical tree of information.
- Detailed history records, every time save back-end backup, easy to find, one key recovery.
- Real-time cloud synchronization.
Step 1: Install MongoDB
MongoDB is a high performance database based on distributed file storage, which is between relational database and non-relational database. It supports very loose data structure similar to JSON and BSON format, so it can store complex data types. The biggest feature of Mongo is that it supports a very powerful query language, its syntax is somewhat similar to object-oriented query language, almost can achieve the majority of functions similar to relational database single table query, but also supports the establishment of indexes to data.
Leanote Cloud Note uses MongoDB as the back-end database. Perform the following steps to install the MongoDB database.
1. Run the following command to install MongoDB: sh install.
yum -y install mongodb mongodb-server.x86_64 mariadb-devel.i686
Copy the code
2. Run the following command to start the MongoDB service.
systemctl start mongod
Copy the code
3. Run the following command to check the MongoDB running status. If the status of active is Active (Running), the MongoDB service is running.
systemctl status mongod
Copy the code
Step 4: Install Leanote
1. Download the binary Leanote installation package.
Wget HTTP: / / https://nchc.dl.sourceforge.net/project/leanote-bin/2.6.1/leanote-linux-amd64-v2.6.1.bin.tar.gzCopy the code
2. Decompress the installation package.
The tar - ZXVF leanote - Linux - amd64 - v2.6.1. Bin. Tar. GzCopy the code
3. Edit the leanote/conf/app.conf file, find app.secret in the file, and change the value to any string.
Note: According to the official Leanote document, if you do not change the value of app.secret, there will be security risks. A. Use the Vim editor to open the leanote/conf/app.conf file.
vim leanote/conf/app.conf
Copy the code
B. In the Vim editor, enter /app.secret= and press Enter to find the app.secret location.
C. Press I to enter the editing mode and change the value of the item to any character string.
D. Press Esc to exit the editing mode and enter :wq to save the configuration and exit the vim editor.
After modification, the following figure is shown.
4. Initialize the database.
mongorestore -h localhost -d leanote --dir /root/leanote/mongodb_backup/leanote_install_data/
Copy the code
5. Start the service.
nohup bash /root/leanote/bin/run.sh > /root/leanote/run.log 2>&1 &
Copy the code
6. Access cloud Notes.
Open a browser and visit http://<ECS public IP address >:9000. Replace <ECS public IP address > with the ECS public IP address in the resource bar on the left. The default user name and password are admin and abc123 respectively. The following figure shows the successful login.