首頁>技術>

本文詳細講述了如何在Mac電腦上快速搭建螞蟻筆記服務和登入使用Mac客戶端進行筆記創作。


mongo服務

Mac環境下安裝MongoDB,根據官方文件進行安裝,使用brew install。

文件地址:https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/

$ brew tap mongodb/brew

$ brew install mongodb-community@4.2

$ brew services start mongodb-community@4.2

$ ps aux | grep -v grep | grep mongod

mymacbookpro 391 0.0 0.2 5115464 16740 ?? S 9:51下午 0:58.76 /usr/local/opt/mongodb-community@3.6/bin/mongod --config /usr/local/etc/mongod.conf

安裝完後可以修改配置檔案,指定日誌和資料目錄:

$ vi /usr/local/etc/mongod.conf

systemLog:

destination: file

path: /Users/mymacbookpro/Development/pseudo/mongodb/mongo.log

logAppend: true

storage:

dbPath: /Users/mymacbookpro/Development/pseudo/mongodb

net:

bindIp: 127.0.0.1

leanote服務端

下載解壓:

$ wget /file/2020/01/05/20200105113033_23021.jpg tar zxvf leanote-darwin-amd64-v2.6.1.bin.tar.gz

leanote服務端目錄結構:

$ ls

appconfmongodb_backup

binmessagespublic

初始化mongo資料

$ cd leanote

$ mongorestore -h localhost -d leanote --dir mongodb_backup/leanote_install_data/

初始化之後的的使用者名稱密碼:

user1 username: admin, password: abc123 (administrator who can manage Leanote)

user2 username: demo@leanote.com, password: demo@leanote.com (just for demonstration)

檢視mongo資料:

$ mongo

MongoDB shell version v4.2.2

connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb

......

> show dbs

admin 0.000GB

config 0.000GB

leanote 0.001GB

local 0.000GB

> use leanote

switched to db leanote

> show collections

albums

attachs

blog_comments

blog_likes

blog_singles

configs

email_logs

files

find_pwds

group_users

groups

has_share_notes

leanote.ShareNotes

leanote.has_share_notes

note_content_histories

note_contents

note_images

note_tags

notebooks

notes

reports

sessions

share_notebooks

share_notes

suggestions

tag_count

tags

themes

tokens

traffics

user_blogs

users

執行leanote服務

$ nohup bash bin/run.sh &

檢視日誌

$ tail -f nohup.out

......

Listening on.. 0.0.0.0:9000

預設埠號9000

leanote Mac客戶端

下載解壓後把對應的app移到Mac應用程式列表中,啟動時注意在系統偏好設定-安全性與隱私裡面 設定允許繼續執行。

$ wget /file/2020/01/05/20200105113036_23022.jpg

最新評論
  • BSA-TRITC(10mg/ml) TRITC-BSA 牛血清白蛋白改性標記羅丹明
  • Nginx 實現靜態資源