Linux 部署Neo4j 并且创建自定义Service

最近需要在linux vm上部署neo4j,写了了个安装文档 直接copy过来了 

  1. download the community sever.
    Neo4j Download Center - Neo4j Graph Data Platform
  2. upload the tar.gz to Linux VM, then use [tar -xf [file path]] to decompress.
  3. modify the file <neo4j_home>/conf/neo4j.conf
    1. uncomment those lines:
        1. first line's port use to connect neo4j sever, such as : some application yml will config this port
        2. second line use to config the port that neo4j management center browser 

  4. Place the extracted files in a permanent home on your server. The top level directory is referred to as NEO4J_HOME.

    1. To run Neo4j as a console application, use: <NEO4J_HOME>/bin/neo4j console.

    2. To run Neo4j in a background process, use: <NEO4J_HOME>/bin/neo4j start.

  5. Visit http://<VM_IP>:7474 in your web browser.

  6. Connect using the username 'neo4j' with default password 'neo4j'. You’ll then be prompted to change the password.

Create as service

  1. create neo4j.service where in /usr/lib/systemd/system

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    [Unit]

    Description=Neo4j-instanceA

    [Service]

    Type=forking

    User=root

    LimitNOFILE=60000

    ExecStart=/usr/bin/env <NEO4J_HOME>/bin/neo4j start

    ExecReload=/usr/bin/env <NEO4J_HOME>/bin/neo4j restart

    ExecStop=/usr/bin/env <NEO4J_HOME>/bin/neo4j stop

    [Install]

    WantedBy=multi-user.target

  2. run [sudo vi /etc/systemd/user.conf]
    1. Uncomment and define the value of DefaultLimitNOFILE, found in the [Manager] section
    2. put DefaultLimitNOFILE value as 60000

      [Manager]

      ...

      DefaultLimitNOFILE=60000


  3. run [sudo vi /etc/security/limits.conf]
    1. Define the following values

      neo4j soft nofile 60000

      neo4j hard nofile 60000

  4. run [sudo systemctl daemon-reload]
  5. run [sudo systemctl enable neo4j]
    1. START: sudo systemctl start neo4j
    2. STOP: sudo systemctl stop neo4j
    3. RESTART: sudo systemctl restart neo4j

Refer:https://neo4j.com/docs/operations-manual/current/installation/linux/tarball/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值