neo4j-devtools / neo4j-bloom

A public repository for informal docs, problem reporting and content sharing related to Neo4j Bloom.
Apache License 2.0
18 stars 0 forks source link

Problem using Bloom in docker #42

Open fanavarro opened 2 years ago

fanavarro commented 2 years ago

Hi, I am trying to use docker (concretely docker-compose) to deploy a neo4j database including the bloom plugin. I'm using the concerning environment variable to do this as follows: NEO4JLABS_PLUGINS: '["apoc", "graph-data-science", "bloom"]' In theory, the graph database will contain the three plugins listed above. I am also using the enterprise docker image 'neo4j:4.4.4-enterprise', and it seems to be working. However, when I try to access the bloom interface at http://localhost:7474/browser/bloom/, I get the following error after I write the user and password: imagen

I have found this post commenting this issue, but no solution is provided there.

Are you aware of this problem? Is there any workaround for this?

Thanks in advance, Francisco Abad.

GlacialBoy commented 2 years ago

Hello Francisco, probably there is some misconfiguration in the docker compose file, it seems that the Bloom plugin is not installed properly.

I tried to run it with this docker compose file and it is working fine

version: '3.3'
services:
  neo4j:
    image: neo4j:4.4.4-enterprise
    container_name: neo4j
    ports:
        - '7474:7474'
        - '7687:7687'
    volumes:
        - '$HOME/bloom.license:/licenses/bloom.license'
    environment:
        - NEO4J_AUTH=neo4j/password
        - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
        - NEO4JLABS_PLUGINS=["apoc", "graph-data-science", "bloom"]
        - NEO4J_dbms_allow__upgrade=${NEO4J_ALLOW_UPGRADE:-false}

Notice that you need to provide a license file for this feature, hope this example helps to solve your problem!

fanavarro commented 2 years ago

Hi @GlacialBoy, thanks for your answer! I am trying to pass the bloom license as an argument so that it is written to the /license.txt and appended to the neo4j config file in the docker container with this dockerfile:

FROM neo4j:4.4.4-enterprise

ARG NEO4J_LICENSE_KEY
ARG NEO4J_LICENSE_KEY_FILE=/license.txt

RUN if [ ! -z "$NEO4J_LICENSE_KEY" ] ; then echo $NEO4J_LICENSE_KEY > $NEO4J_LICENSE_KEY_FILE && echo gds.enterprise.license_file=$NEO4J_LICENSE_KEY_FILE >> /var/lib/neo4j/conf/neo4j.conf && echo neo4j.bloom.license_file=$NEO4J_LICENSE_KEY_FILE >> /var/lib/neo4j/conf/neo4j.conf; else echo 'Not neo4j commercial license used'; fi

EXPOSE 7474 7687 9010

Then I used this dockerfile in the compose file as follows (with the variables stored in the .env file):

version: '3'
services:
  p4q-graph:
    container_name: p4q-graph
    build:
      context: ./p4q-graph
      args:
        - NEO4J_LICENSE_KEY=${NEO4J_LICENSE_KEY}
    ports:
      - ${NEO4J_HTTP_PORT}:7474
      - ${NEO4J_BOLT_PORT}:7687
    environment:
      NEO4JLABS_PLUGINS: '["apoc", "graph-data-science", "bloom"]'
      NEO4J_AUTH: '${NEO4J_USER}/${NEO4J_PASS}'
      NEO4J_ACCEPT_LICENSE_AGREEMENT: 'yes'

With this config I am getting the java error; I will try with your docker compose file after cleaning everything. Thankis again!

fanavarro commented 1 year ago

I tried by using a volume to store the license key instead of managing env variables, but I am still having the same error.