fly翔
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    [12屆 鐵人賽] [Day5] 你可能不會用到的 Neo4j Server === ###### tags: `iT鐵人賽` `Neo4j` ## 前情提要 前兩篇介紹了應用端的程式 這篇會來介紹 Neo4j Server 的架設,以及一些相關的細節 會分成 Windows 版跟 Linux 版 如果沒有架設 Server 的需求 這篇可以直接略過 ## Linux 安裝 首先先說說相對比較麻煩的 Linux 版 先準備一台新的 VM ( 為了 Demo 方便 ) 這裡開的是 ubuntu 18.04 基本上就是按照[官方安裝步驟](https://debian.neo4j.com/?_ga=2.131133384.636924486.1589170866-1884466348.1587716682) ```bash= wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add - echo 'deb https://debian.neo4j.com stable latest' | sudo tee /etc/apt/sources.list.d/neo4j.list sudo apt-get update ``` > 我的 "wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -" > 會噴錯,~~懶得修~~,所以我改用 > ```bash= > apt-key adv --fetch-keys https://debian.neo4j.com/neotechnology.gpg.key > ``` > 然後他需要套件 gunpg > ```bash= > apt install gnupg > ``` 上面三條執行好就可安裝了 ```bash= sudo apt-get install neo4j ``` 檢查一下裝好沒 ```bash= sudo systemctl status neo4j ``` ![](https://i.imgur.com/eFYO5jk.png) 看來是行了 再來就是[開啟外部IP連接](https://neo4j.com/developer/kb/how-do-i-enable-remote-https-access-with-neo4j-30x/) 我沒有給他預設的安裝路徑 所以要看一下他自動裝去哪了 直接進服務看 ```bash= cat /lib/systemd/system/neo4j.service ``` ![](https://i.imgur.com/1nKX1MX.png) ``` Environment="NEO4J_CONF=/etc/neo4j" "NEO4J_HOME=/var/lib/neo4j" ``` 嗯 ... 看來要改的 conf 在 "/etc/neo4j" 底下 ```bash= vi /etc/neo4j/neo4j.conf ``` 找到 Network connector configuration 的區塊 ![](https://i.imgur.com/J7WJg03.png) * dbms.default_listen_address=0.0.0.0 * 要開啟外部連接這條一定要開,不然他只會跑 localhost * Bolt connector * Graph Database 在用的,要開 * 改成這樣 ```shell= dbms.connector.bolt.tls_level=DISABLED dbms.connector.bolt.listen_address=0.0.0.0:7687 ``` * HTTP Connector * Web 連線用 * 如果你打算用 Neo4j Desktop 連,可以不開 * 改成這樣 ```shell= dbms.connector.http.listen_address=0.0.0.0:7474 ``` * HTTPs Connector * 這個就看你,測試走 HTTP 就夠了 * 改法跟 HTTP 一樣 ![](https://i.imgur.com/wuNVoSD.png) ~改好後~ 改好重啟服務才會生效 ```bash= sudo systemctl restart neo4j ``` 連進去看看吧 ``` http://IP:7474/ ``` ![](https://i.imgur.com/ruyY0Bi.png) 他會要你先連到 Database 記得要先把 Connect URL 改成 " **bolt://** " Username 和 Password 預設都是 "**neo4j**" 第一次連線他會要你改密碼 ![](https://i.imgur.com/28dfCfn.png) 看到這個就連線成功了喔 ## Windows 安裝 老樣子先給[官網連結](https://neo4j.com/download-center/) ![](https://i.imgur.com/pSWXIT3.png) 你可以看到 Server 有兩個版本 * Enterprise * 要 $$ * 不過官方有為開發人員提供許多免費的方案 * 企業版,更多的節點關係的數量上限,一些備份還原之類的功能 >沒有很仔細研究,歡迎知道的底下補充 * Community 這邊就用 Community Demo,一樣記錄一下版本 4.1.1 下載下來會是一個 .zip 檔,放到一個你爽的地方解壓縮 > 我是丟這裡 ==> D:\Neo4j ![](https://i.imgur.com/Z7nCsyq.png) 解壓完後會看到這樣的目錄,重要的如下w * bin * 等等安裝程式的目錄 * conf * Linux 那邊用到的 conf 檔在這裡 * 改對外的內容跟剛剛 Linux 那邊一樣,就不再做一次 * plugins * 套件 Library 要丟的地方,以後會講 接下來我們進到 bin 的資料夾下吧 你會看到有一個檔叫 " **neo4j.bat** " 用 CMD 開他吧 ![](https://i.imgur.com/trI95pb.png) 你會看到可以用的功能 安裝吧 ```bash= neo4j.bat install-service neo4j.bat start neo4j.bat status ``` ![](https://i.imgur.com/tLGo6aM.png) 看的 " **Neo4j is running** " 就沒有問題了喔 接下 開啟外部IP連接 跟 測試 流程就跟 linux 版一模一樣 所以就不重複講了~ --- 今天的內容感覺有點騙 (゚∀゚) 原本還在想 Server 的部分要不要挪到後面一點在講 畢竟不是每個人都用的到 最後想說算了,都是安裝類的就排在一起了 然後這篇實在是找不到地方塞 meme 圖_(:3 」∠ )_ 明天 ***該來教教 Neo4j 介面怎麼用了吧 ( 上篇 )*** 期待明日的降臨吧 Ciao! ## 紀錄 撰寫日期:2020/09/09 耗時:1.5 小時 撰寫日期:2020/09/10 耗時:差不多 1 小時 total 耗時:2.5 小時左右 可能不只

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully