当前位置:   article > 正文

阿里云neo4j安装+配置远程访问_neo4j desktop允许远程连接

neo4j desktop允许远程连接

前言

生活艰难,又需要学习neo4j 典型的图型数据库。笔者使用阿里云服务器windows server 2019进行neo4j数据库的安装配置,实现远程访问

踩坑其实不多 可能是之前配过很多东西?甚至感觉这个有点好配..

下载

neo4j有梯子的话直接去官网下载即可 注意不要下载错了 很容易下载一个neo4j desktop 是一个集成的管理环境,也包括neo4j,但是对于服务器来说

多余的管理环境是不必要的,配置好后直接可以通过自己的移动终端进行远程管理

没有梯子建议使用百度网盘:

https://pan.baidu.com/s/1hygHS6_W5rqoAc41V30sTQ

提取码: v524

安装

1. 下载好之后直接解压缩到服务器硬盘目录 记好路径

2. 配置环境变量 习惯使用小娜直接搜索 win 输入环境变量 系统变量中新建刚才的解压路径 配置变量名为NEO4J_HOME

然后在PATH变量中新增 %NEO4J_HOME%\bin

3. 检查是否安装成功 命令行窗口中输入

neo4j.bat console

然而实测会出现这样的错误

此时打开power shell 输入以下命令

  1. neo4j --powershell
  2. Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
  3. Import-Module 'C:\Program Files (x86)\neo4j-community-3.5.5\bin\Neo4j-Management.psd1'
  4. Invoke-Neo4j console
  5. # 记得切换路径为自己的安装路径

出现starting说明neo4j已经安装完毕

远程访问配置

上述过程已经把neo4j配置安装在了服务器本地上,然而并未对公网暴露端口,可以看到http端口默认为7474,bolt端口为7687(实际部署端口)

那么需要在阿里云安全组当中配置好这两个端口的入站规则

然后进入安装目录的conf文件夹当中,编辑neo4j.conf文件

可以选择自行修改,或者直接复制文章末尾已经配置完毕的neo4j.conf文件代码到你的文件当中替换

自行修改需要修改两处

 1.将此处注释替换掉 赋值0.0.0.0(全开放)

2.将此处修改为如图所示的配置

如果进行域名备案的话还需要配置https和SSL证书等配置,烦请注意

配置好后,通过ip:7474即可访问自己服务器的neo4j

初始用户名密码均为 neo4j

初次登录后会提示修改密码

over!

附:neo4j.conf

  1. #*****************************************************************
  2. # Neo4j configuration
  3. #
  4. # For more details and a complete list of settings, please see
  5. # https://neo4j.com/docs/operations-manual/current/reference/configuration-settings/
  6. #*****************************************************************
  7. # The name of the database to mount
  8. #dbms.active_database=graph.db
  9. # Paths of directories in the installation.
  10. #dbms.directories.data=data
  11. #dbms.directories.plugins=plugins
  12. #dbms.directories.certificates=certificates
  13. #dbms.directories.logs=logs
  14. #dbms.directories.lib=lib
  15. #dbms.directories.run=run
  16. # This setting constrains all `LOAD CSV` import files to be under the `import` directory. Remove or comment it out to
  17. # allow files to be loaded from anywhere in the filesystem; this introduces possible security problems. See the
  18. # `LOAD CSV` section of the manual for details.
  19. dbms.directories.import=import
  20. # Whether requests to Neo4j are authenticated.
  21. # To disable authentication, uncomment this line
  22. #dbms.security.auth_enabled=false
  23. # Enable this to be able to upgrade a store from an older version.
  24. #dbms.allow_upgrade=true
  25. # Java Heap Size: by default the Java heap size is dynamically
  26. # calculated based on available system resources.
  27. # Uncomment these lines to set specific initial and maximum
  28. # heap size.
  29. #dbms.memory.heap.initial_size=512m
  30. #dbms.memory.heap.max_size=512m
  31. # The amount of memory to use for mapping the store files, in bytes (or
  32. # kilobytes with the 'k' suffix, megabytes with 'm' and gigabytes with 'g').
  33. # If Neo4j is running on a dedicated server, then it is generally recommended
  34. # to leave about 2-4 gigabytes for the operating system, give the JVM enough
  35. # heap to hold all your transaction state and query context, and then leave the
  36. # rest for the page cache.
  37. # The default page cache memory assumes the machine is dedicated to running
  38. # Neo4j, and is heuristically set to 50% of RAM minus the max Java heap size.
  39. #dbms.memory.pagecache.size=10g
  40. #*****************************************************************
  41. # Network connector configuration
  42. #*****************************************************************
  43. # With default configuration Neo4j only accepts local connections.
  44. # To accept non-local connections, uncomment this line:
  45. dbms.connectors.default_listen_address=0.0.0.0
  46. # You can also choose a specific network interface, and configure a non-default
  47. # port for each connector, by setting their individual listen_address.
  48. # The address at which this server can be reached by its clients. This may be the server's IP address or DNS name, or
  49. # it may be the address of a reverse proxy which sits in front of the server. This setting may be overridden for
  50. # individual connectors below.
  51. #dbms.connectors.default_advertised_address=localhost
  52. # You can also choose a specific advertised hostname or IP address, and
  53. # configure an advertised port for each connector, by setting their
  54. # individual advertised_address.
  55. # Bolt connector
  56. dbms.connector.bolt.enabled=true
  57. #dbms.connector.bolt.tls_level=OPTIONAL
  58. dbms.connector.bolt.listen_address=0.0.0.0:7687
  59. # HTTP Connector. There can be zero or one HTTP connectors.
  60. dbms.connector.http.enabled=true
  61. dbms.connector.http.listen_address=0.0.0.0:7474
  62. # HTTPS Connector. There can be zero or one HTTPS connectors.
  63. dbms.connector.https.enabled=true
  64. #dbms.connector.https.listen_address=:7473
  65. # Number of Neo4j worker threads.
  66. #dbms.threads.worker_count=
  67. #*****************************************************************
  68. # SSL system configuration
  69. #*****************************************************************
  70. # Names of the SSL policies to be used for the respective components.
  71. # The legacy policy is a special policy which is not defined in
  72. # the policy configuration section, but rather derives from
  73. # dbms.directories.certificates and associated files
  74. # (by default: neo4j.key and neo4j.cert). Its use will be deprecated.
  75. # The policies to be used for connectors.
  76. #
  77. # N.B: Note that a connector must be configured to support/require
  78. # SSL/TLS for the policy to actually be utilized.
  79. #
  80. # see: dbms.connector.*.tls_level
  81. #bolt.ssl_policy=legacy
  82. #https.ssl_policy=legacy
  83. #*****************************************************************
  84. # SSL policy configuration
  85. #*****************************************************************
  86. # Each policy is configured under a separate namespace, e.g.
  87. # dbms.ssl.policy.<policyname>.*
  88. #
  89. # The example settings below are for a new policy named 'default'.
  90. # The base directory for cryptographic objects. Each policy will by
  91. # default look for its associated objects (keys, certificates, ...)
  92. # under the base directory.
  93. #
  94. # Every such setting can be overridden using a full path to
  95. # the respective object, but every policy will by default look
  96. # for cryptographic objects in its base location.
  97. #
  98. # Mandatory setting
  99. #dbms.ssl.policy.default.base_directory=certificates/default
  100. # Allows the generation of a fresh private key and a self-signed
  101. # certificate if none are found in the expected locations. It is
  102. # recommended to turn this off again after keys have been generated.
  103. #
  104. # Keys should in general be generated and distributed offline
  105. # by a trusted certificate authority (CA) and not by utilizing
  106. # this mode.
  107. #dbms.ssl.policy.default.allow_key_generation=false
  108. # Enabling this makes it so that this policy ignores the contents
  109. # of the trusted_dir and simply resorts to trusting everything.
  110. #
  111. # Use of this mode is discouraged. It would offer encryption but no security.
  112. #dbms.ssl.policy.default.trust_all=false
  113. # The private key for the default SSL policy. By default a file
  114. # named private.key is expected under the base directory of the policy.
  115. # It is mandatory that a key can be found or generated.
  116. #dbms.ssl.policy.default.private_key=
  117. # The private key for the default SSL policy. By default a file
  118. # named public.crt is expected under the base directory of the policy.
  119. # It is mandatory that a certificate can be found or generated.
  120. #dbms.ssl.policy.default.public_certificate=
  121. # The certificates of trusted parties. By default a directory named
  122. # 'trusted' is expected under the base directory of the policy. It is
  123. # mandatory to create the directory so that it exists, because it cannot
  124. # be auto-created (for security purposes).
  125. #
  126. # To enforce client authentication client_auth must be set to 'require'!
  127. #dbms.ssl.policy.default.trusted_dir=
  128. # Client authentication setting. Values: none, optional, require
  129. # The default is to require client authentication.
  130. #
  131. # Servers are always authenticated unless explicitly overridden
  132. # using the trust_all setting. In a mutual authentication setup this
  133. # should be kept at the default of require and trusted certificates
  134. # must be installed in the trusted_dir.
  135. #dbms.ssl.policy.default.client_auth=require
  136. # It is possible to verify the hostname that the client uses
  137. # to connect to the remote server. In order for this to work, the server public
  138. # certificate must have a valid CN and/or matching Subject Alternative Names.
  139. # Note that this is irrelevant on host side connections (sockets receiving
  140. # connections).
  141. # To enable hostname verification client side on nodes, set this to true.
  142. #dbms.ssl.policy.default.verify_hostname=false
  143. # A comma-separated list of allowed TLS versions.
  144. # By default only TLSv1.2 is allowed.
  145. #dbms.ssl.policy.default.tls_versions=
  146. # A comma-separated list of allowed ciphers.
  147. # The default ciphers are the defaults of the JVM platform.
  148. #dbms.ssl.policy.default.ciphers=
  149. #*****************************************************************
  150. # Logging configuration
  151. #*****************************************************************
  152. # To enable HTTP logging, uncomment this line
  153. #dbms.logs.http.enabled=true
  154. # Number of HTTP logs to keep.
  155. #dbms.logs.http.rotation.keep_number=5
  156. # Size of each HTTP log that is kept.
  157. #dbms.logs.http.rotation.size=20m
  158. # To enable GC Logging, uncomment this line
  159. #dbms.logs.gc.enabled=true
  160. # GC Logging Options
  161. # see http://docs.oracle.com/cd/E19957-01/819-0084-10/pt_tuningjava.html#wp57013 for more information.
  162. #dbms.logs.gc.options=-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintPromotionFailure -XX:+PrintTenuringDistribution
  163. # For Java 9 and newer GC Logging Options
  164. # see https://docs.oracle.com/javase/10/tools/java.htm#JSWOR-GUID-BE93ABDC-999C-4CB5-A88B-1994AAAC74D5
  165. #dbms.logs.gc.options=-Xlog:gc*,safepoint,age*=trace
  166. # Number of GC logs to keep.
  167. #dbms.logs.gc.rotation.keep_number=5
  168. # Size of each GC log that is kept.
  169. #dbms.logs.gc.rotation.size=20m
  170. # Log level for the debug log. One of DEBUG, INFO, WARN and ERROR. Be aware that logging at DEBUG level can be very verbose.
  171. #dbms.logs.debug.level=INFO
  172. # Size threshold for rotation of the debug log. If set to zero then no rotation will occur. Accepts a binary suffix "k",
  173. # "m" or "g".
  174. #dbms.logs.debug.rotation.size=20m
  175. # Maximum number of history files for the internal log.
  176. #dbms.logs.debug.rotation.keep_number=7
  177. #*****************************************************************
  178. # Miscellaneous configuration
  179. #*****************************************************************
  180. # Enable this to specify a parser other than the default one.
  181. #cypher.default_language_version=3.0
  182. # Determines if Cypher will allow using file URLs when loading data using
  183. # `LOAD CSV`. Setting this value to `false` will cause Neo4j to fail `LOAD CSV`
  184. # clauses that load data from the file system.
  185. #dbms.security.allow_csv_import_from_file_urls=true
  186. # Value of the Access-Control-Allow-Origin header sent over any HTTP or HTTPS
  187. # connector. This defaults to '*', which allows broadest compatibility. Note
  188. # that any URI provided here limits HTTP/HTTPS access to that URI only.
  189. #dbms.security.http_access_control_allow_origin=*
  190. # Value of the HTTP Strict-Transport-Security (HSTS) response header. This header
  191. # tells browsers that a webpage should only be accessed using HTTPS instead of HTTP.
  192. # It is attached to every HTTPS response. Setting is not set by default so
  193. # 'Strict-Transport-Security' header is not sent. Value is expected to contain
  194. # dirictives like 'max-age', 'includeSubDomains' and 'preload'.
  195. #dbms.security.http_strict_transport_security=
  196. # Retention policy for transaction logs needed to perform recovery and backups.
  197. dbms.tx_log.rotation.retention_policy=1 days
  198. # Only allow read operations from this Neo4j instance. This mode still requires
  199. # write access to the directory for lock purposes.
  200. #dbms.read_only=false
  201. # Comma separated list of JAX-RS packages containing JAX-RS resources, one
  202. # package name for each mountpoint. The listed package names will be loaded
  203. # under the mountpoints specified. Uncomment this line to mount the
  204. # org.neo4j.examples.server.unmanaged.HelloWorldResource.java from
  205. # neo4j-server-examples under /examples/unmanaged, resulting in a final URL of
  206. # http://localhost:7474/examples/unmanaged/helloworld/{nodeId}
  207. #dbms.unmanaged_extension_classes=org.neo4j.examples.server.unmanaged=/examples/unmanaged
  208. # A comma separated list of procedures and user defined functions that are allowed
  209. # full access to the database through unsupported/insecure internal APIs.
  210. #dbms.security.procedures.unrestricted=my.extensions.example,my.procedures.*
  211. # A comma separated list of procedures to be loaded by default.
  212. # Leaving this unconfigured will load all procedures found.
  213. #dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*
  214. #********************************************************************
  215. # JVM Parameters
  216. #********************************************************************
  217. # G1GC generally strikes a good balance between throughput and tail
  218. # latency, without too much tuning.
  219. dbms.jvm.additional=-XX:+UseG1GC
  220. # Have common exceptions keep producing stack traces, so they can be
  221. # debugged regardless of how often logs are rotated.
  222. dbms.jvm.additional=-XX:-OmitStackTraceInFastThrow
  223. # Make sure that `initmemory` is not only allocated, but committed to
  224. # the process, before starting the database. This reduces memory
  225. # fragmentation, increasing the effectiveness of transparent huge
  226. # pages. It also reduces the possibility of seeing performance drop
  227. # due to heap-growing GC events, where a decrease in available page
  228. # cache leads to an increase in mean IO response time.
  229. # Try reducing the heap memory, if this flag degrades performance.
  230. dbms.jvm.additional=-XX:+AlwaysPreTouch
  231. # Trust that non-static final fields are really final.
  232. # This allows more optimizations and improves overall performance.
  233. # NOTE: Disable this if you use embedded mode, or have extensions or dependencies that may use reflection or
  234. # serialization to change the value of final fields!
  235. dbms.jvm.additional=-XX:+UnlockExperimentalVMOptions
  236. dbms.jvm.additional=-XX:+TrustFinalNonStaticFields
  237. # Disable explicit garbage collection, which is occasionally invoked by the JDK itself.
  238. dbms.jvm.additional=-XX:+DisableExplicitGC
  239. # Remote JMX monitoring, uncomment and adjust the following lines as needed. Absolute paths to jmx.access and
  240. # jmx.password files are required.
  241. # Also make sure to update the jmx.access and jmx.password files with appropriate permission roles and passwords,
  242. # the shipped configuration contains only a read only role called 'monitor' with password 'Neo4j'.
  243. # For more details, see: http://download.oracle.com/javase/8/docs/technotes/guides/management/agent.html
  244. # On Unix based systems the jmx.password file needs to be owned by the user that will run the server,
  245. # and have permissions set to 0600.
  246. # For details on setting these file permissions on Windows see:
  247. # http://docs.oracle.com/javase/8/docs/technotes/guides/management/security-windows.html
  248. #dbms.jvm.additional=-Dcom.sun.management.jmxremote.port=3637
  249. #dbms.jvm.additional=-Dcom.sun.management.jmxremote.authenticate=true
  250. #dbms.jvm.additional=-Dcom.sun.management.jmxremote.ssl=false
  251. #dbms.jvm.additional=-Dcom.sun.management.jmxremote.password.file=/absolute/path/to/conf/jmx.password
  252. #dbms.jvm.additional=-Dcom.sun.management.jmxremote.access.file=/absolute/path/to/conf/jmx.access
  253. # Some systems cannot discover host name automatically, and need this line configured:
  254. #dbms.jvm.additional=-Djava.rmi.server.hostname=$THE_NEO4J_SERVER_HOSTNAME
  255. # Expand Diffie Hellman (DH) key size from default 1024 to 2048 for DH-RSA cipher suites used in server TLS handshakes.
  256. # This is to protect the server from any potential passive eavesdropping.
  257. dbms.jvm.additional=-Djdk.tls.ephemeralDHKeySize=2048
  258. # This mitigates a DDoS vector.
  259. dbms.jvm.additional=-Djdk.tls.rejectClientInitiatedRenegotiation=true
  260. #********************************************************************
  261. # Wrapper Windows NT/2000/XP Service Properties
  262. #********************************************************************
  263. # WARNING - Do not modify any of these properties when an application
  264. # using this configuration file has been installed as a service.
  265. # Please uninstall the service before modifying this section. The
  266. # service can then be reinstalled.
  267. # Name of the service
  268. dbms.windows_service_name=neo4j
  269. #********************************************************************
  270. # Other Neo4j system properties
  271. #********************************************************************
  272. dbms.jvm.additional=-Dunsupported.dbms.udc.source=zip

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/神奇cpp/article/detail/902350
推荐阅读
相关标签
  

闽ICP备14008679号