简体   繁体   English

Neo4j Azure托管和数据库位置

[英]Neo4j Azure hosting and Database location

I know that we can use the VM Depot to get started with the Neo4J in Azur but one thing that is not clear is where should we physically store the DB files. 我知道我们可以使用VM Depot来开始使用Azur中的Neo4J,但尚不清楚的一件事是,我们应该在哪里实际存储数据库文件。 I tried to look around in the net if there are any recommendations on where the physical files would be stored so that then a VM crashes or restarts, the data is not lost. 我尝试在网上四处看看是否有关于物理文件存储位置的任何建议,以免VM崩溃或重新启动,数据也不会丢失。

can someone share their thoughts or point me to a address where some more details can be found on do and don'ts of Neo4j on Azure for a production environment. 有人可以分享他们的想法还是将我指向一个地址,在该地址上可以找到有关生产环境在Azure上执行和不执行Neo4j的更多详细信息。

Regards Kiran 问候基兰

When you set up a Neo4j VM via VM Depot, that image, by default, configures the database files to reside within the same VM as the server itself. 通过VM Depot设置Neo4j VM时,默认情况下,该映像会将数据库文件配置为与服务器本身位于同一VM中。 The location is specified in neo4j-server.properties. 该位置在neo4j-server.properties.指定neo4j-server.properties. This lets you simply spin up the VM and start using Neo4j immediately. 这使您可以简单地启动VM并立即开始使用Neo4j。

However: You'll soon discover that your storage space is limited (I believe the VM instances are set up with a 127GB disk). 但是:您很快就会发现存储空间有限(我相信VM实例设置了127GB磁盘)。 To work with larger databases, you'll need to attach an additional disk (or disks), each disk up to 1TB in size. 要使用更大的数据库,您需要附加一个或多个磁盘,每个磁盘的大小最大为1TB。 These disks, as well as the main VM disk, are backed by blob storage, meaning they're durable - persistent disks. 这些磁盘以及主VM磁盘均由blob存储支持,这意味着它们是持久的 -永久磁盘。

How you ultimately configure this is up to you, depending on the size of the database and its purpose. 最终配置方式的选择取决于您,具体取决于数据库的大小及其用途。 The only storage to avoid, if you need persistence, is the scratch disk provided (which is a locally-attached drive with no durability). 如果需要持久性,唯一可以避免的存储是提供的暂存磁盘(这是本地连接的驱动器,没有持久性)。

The documentation announcing that VM doesn't say. 宣布VM未说明的文档。 But when you install neo4j as a package on to other similar linux systems (the VM in question is a linux VM) then the data usually goes into /var/lib/neo4j/data . 但是,当您将neo4j作为软件包安装到其他类似的linux系统(问题虚拟机是linux虚拟机)上时,数据通常进入/var/lib/neo4j/data Here's an example: 这是一个例子:

user@host:/var/lib/neo4j/data$ pwd
/var/lib/neo4j/data
user@host:/var/lib/neo4j/data$ ls
graph.db  keystore  log  neo4j-service.pid  README.txt  rrd
user@host:/var/lib/neo4j/data$ cat README.txt 
Neo4j Data
=======================================

This directory contains all live data managed by this server, including
database files, logs, and other "live" files.

The main directory you really have to have is the "graph.db" directory. 您真正必须拥有的主目录是“ graph.db”目录。 That's going to contain the bulk of the data. 这将包含大量数据。 May as well back up the entirety of this directory. 也可以备份此目录的全部。 Some of the files (like the .pid file and the README.txt ) of course aren't needed. 当然,不需要某些文件(例如.pid文件和README.txt )。

Now, there's no guarantee that in the VM that it's going to be /var/lib/neo4j/data but it's going to be something very similar. 现在,不能保证在VM中它将是/var/lib/neo4j/data但是它将非常相似。 And what you're going to want is going to be a directory whose name ends in .db since that's the default for new neo4j databases. 而且您想要的是一个名称以.db结尾的目录,因为这是新neo4j数据库的默认目录。

To narrow down further, once you get that VM running, just run updatedb then locate *.db | grep neo4j 为了进一步缩小范围,一旦使该VM运行,只需运行updatedb然后locate *.db | grep neo4j locate *.db | grep neo4j and that's almost certain to find it quickly. locate *.db | grep neo4j ,几乎可以肯定会很快找到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM