cancel
Showing results for 
Search instead for 
Did you mean: 

WebSocket/Docker issue | Settings for Neo4j Docker Compose with Causal Cluster?

tsjota
Node

Hi, I just need a pointer on what settings avoid this error, so I can use Neo4j browser in a cluster.

"ServiceUnavailable: WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket readyState is: 3"

Here is my docker-compose.yml;

version: '3'

networks:
lan:

services:

core1:
image: neo4j:4.3.6-enterprise
volumes:
- ./core1/conf:/conf
- ./core1/data:/data
- ./core1/import:/import
- ./core1/logs:/logs
- ./core1/plugins:/plugins
networks:
- lan
ports:
- 1474:7474
- 1687:7687
- 7473:7473
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_memory_pagecache_size=10M
- NEO4J_dbms_memory_heap_initial__size=10M
- NEO4J_AUTH=neo4j/neo
- NEO4J_dbms_mode=CORE
- NEO4J_dbms_connector_bolt_enabled=true
- NEO4J_dbms_connector_bolt_tls_level=REQUIRED
- NEO4J_dbms_connector_bolt_listen_address=0.0.0.0:7687
- NEO4J_dbms_connector_http_enabled=true
- NEO4J_dbms_connector_http_listen_address=0.0.0.0:7474
- NEO4J_dbms_connector_https_enabled=true
- NEO4J_dbms_connector_https_listen_address=0.0.0.0:7473
- NEO4J_causalClustering_discoveryAdvertisedAddress=core1:5000
- NEO4J_causalClustering_transactionAdvertisedAddress=core1:6000
- NEO4J_causalClustering_raftAdvertisedAddress=core1:7000
- NEO4J_causalClustering_expectedCoreClusterSize=3
- NEO4J_causalClustering_initialDiscoveryMembers=core1:5000,core2:5000,core3:5000
- NEO4J_causal__clustering_disable__middleware__logging=false

core2:
image: neo4j:4.3.6-enterprise
volumes:
- ./core2/conf:/conf
- ./core2/data:/data
- ./core2/import:/import
- ./core2/logs:/logs
- ./core2/plugins:/plugins
networks:
- lan
ports:
- 2474:7474
- 2687:7687
- 7473:7473
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_memory_pagecache_size=10M
- NEO4J_dbms_memory_heap_initial__size=10M
- NEO4J_AUTH=neo4j/neo
- NEO4J_dbms_mode=CORE
- NEO4J_dbms_connector_bolt_enabled=true
- NEO4J_dbms_connector_bolt_tls_level=REQUIRED
- NEO4J_dbms_connector_bolt_listen_address=0.0.0.0:7687
- NEO4J_dbms_connector_http_enabled=true
- NEO4J_dbms_connector_http_listen_address=0.0.0.0:7474
- NEO4J_dbms_connector_https_enabled=true
- NEO4J_dbms_connector_https_listen_address=0.0.0.0:7473
- NEO4J_causalClustering_discoveryAdvertisedAddress=core2:5000
- NEO4J_causalClustering_transactionAdvertisedAddress=core2:6000
- NEO4J_causalClustering_raftAdvertisedAddress=core2:7000
- NEO4J_causalClustering_expectedCoreClusterSize=3
- NEO4J_causalClustering_initialDiscoveryMembers=core1:5000,core2:5000,core3:5000
- NEO4J_causalClustering_refuseToBeLeader=true

core3:
image: neo4j:4.3.6-enterprise
volumes:
- ./core3/conf:/conf
- ./core3/data:/data
- ./core3/import:/import
- ./core3/logs:/logs
- ./core3/plugins:/plugins
networks:
- lan
ports:
- 3474:7474
- 3687:7687
- 7473:7473
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_memory_pagecache_size=10M
- NEO4J_dbms_memory_heap_initial__size=10M
- NEO4J_AUTH=neo4j/neo
- NEO4J_dbms_mode=CORE
- NEO4J_dbms_connector_bolt_enabled=true
- NEO4J_dbms_connector_bolt_tls_level=REQUIRED
- NEO4J_dbms_connector_bolt_listen_address=0.0.0.0:7687
- NEO4J_dbms_connector_http_enabled=true
- NEO4J_dbms_connector_http_listen_address=0.0.0.0:7474
- NEO4J_dbms_connector_https_enabled=true
- NEO4J_dbms_connector_https_listen_address=0.0.0.0:7473
- NEO4J_causalClustering_discoveryAdvertisedAddress=core3:5000
- NEO4J_causalClustering_transactionAdvertisedAddress=core3:6000
- NEO4J_causalClustering_raftAdvertisedAddress=core3:7000
- NEO4J_causalClustering_expectedCoreClusterSize=3
- NEO4J_causalClustering_initialDiscoveryMembers=core1:5000,core2:5000,core3:5000
- NEO4J_causalClustering_refuseToBeLeader=true
- NEO4J_dbms_backup_enabled=true
- NEO4J_dbms_backup_address=0.0.0.0:6362

readreplica1:
image: neo4j:4.3.6-enterprise
volumes:
- ./readreplica1/conf:/conf
- ./readreplica1/data:/data
- ./readreplica1/import:/import
- ./readreplica1/logs:/logs
- ./readreplica1/plugins:/plugins
networks:
- lan
ports:
- 4474:7474
- 4687:7687
- 7473:7473
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_memory_pagecache_size=10M
- NEO4J_dbms_memory_heap_initial__size=10M
- NEO4J_AUTH=neo4j/neo
- NEO4J_dbms_mode=READ_REPLICA
- NEO4J_dbms_connector_bolt_enabled=true
- NEO4J_dbms_connector_bolt_tls_level=REQUIRED
- NEO4J_dbms_connector_bolt_listen_address=0.0.0.0:7687
- NEO4J_dbms_connector_http_enabled=true
- NEO4J_dbms_connector_http_listen_address=0.0.0.0:7474
- NEO4J_dbms_connector_https_enabled=true
- NEO4J_dbms_connector_https_listen_address=0.0.0.0:7473
- NEO4J_causalClustering_discoveryAdvertisedAddress=readreplica1:5000
- NEO4J_causalClustering_transactionAdvertisedAddress=readreplica1:6000
- NEO4J_causalClustering_raftAdvertisedAddress=readreplica1:7000
- NEO4J_causalClustering_initialDiscoveryMembers=core1:5000,core2:5000,core3:5000

1 ACCEPTED SOLUTION

tsjota
Node

I finally got this Docker Neo4j cluster up and running.

After lots of trial and error , this is what I found to work:

(1) docker-compose.yml

version: '3'

networks:
lan:

services:

core1:
image: neo4j:4.3.6-enterprise
volumes:
- ./core1/conf:/conf
- ./core1/data:/data
- ./core1/import:/import
- ./core1/logs:/logs
- ./core1/plugins:/plugins
networks:
- lan
ports:
- 1474:7474
- 1687:7687
- 7473:7473
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_memory_pagecache_size=10M
- NEO4J_dbms_memory_heap_initial__size=10M
- NEO4J_AUTH=neo4j/neo
- NEO4J_dbms_mode=CORE
- NEO4J_dbms_connector_bolt_advertised__address="localhost:7687"
- NEO4J_dbms_connector_http_advertised__address="localhost:7474"
- NEO4J_dbms_connector_https_advertised__address="localhost:7473"
- NEO4J_causalClustering_discoveryAdvertisedAddress=core1:5000
- NEO4J_causalClustering_transactionAdvertisedAddress=core1:6000
- NEO4J_causalClustering_raftAdvertisedAddress=core1:7000
- NEO4J_causalClustering_expectedCoreClusterSize=3
- NEO4J_causalClustering_initialDiscoveryMembers=core1:5000,core2:5000,core3:5000
- NEO4J_causal__clustering_disable__middleware__logging=false

core2:
image: neo4j:4.3.6-enterprise
volumes:
- ./core2/conf:/conf
- ./core2/data:/data
- ./core2/import:/import
- ./core2/logs:/logs
- ./core2/plugins:/plugins
networks:
- lan
ports:
- 2474:7474
- 2687:7687
- 7473:7473
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_memory_pagecache_size=10M
- NEO4J_dbms_memory_heap_initial__size=10M
- NEO4J_AUTH=neo4j/neo
- NEO4J_dbms_mode=CORE
- NEO4J_dbms_connector_bolt_advertised__address="localhost:7687"
- NEO4J_dbms_connector_http_advertised__address="localhost:7474"
- NEO4J_dbms_connector_https_advertised__address="localhost:7473"
- NEO4J_causalClustering_discoveryAdvertisedAddress=core2:5000
- NEO4J_causalClustering_transactionAdvertisedAddress=core2:6000
- NEO4J_causalClustering_raftAdvertisedAddress=core2:7000
- NEO4J_causalClustering_expectedCoreClusterSize=3
- NEO4J_causalClustering_initialDiscoveryMembers=core1:5000,core2:5000,core3:5000
- NEO4J_causalClustering_refuseToBeLeader=true

core3:
image: neo4j:4.3.6-enterprise
volumes:
- ./core3/conf:/conf
- ./core3/data:/data
- ./core3/import:/import
- ./core3/logs:/logs
- ./core3/plugins:/plugins
networks:
- lan
ports:
- 3474:7474
- 3687:7687
- 7473:7473
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_memory_pagecache_size=10M
- NEO4J_dbms_memory_heap_initial__size=10M
- NEO4J_AUTH=neo4j/neo
- NEO4J_dbms_mode=CORE
- NEO4J_dbms_connector_bolt_advertised__address="localhost:7687"
- NEO4J_dbms_connector_http_advertised__address="localhost:7474"
- NEO4J_dbms_connector_https_advertised__address="localhost:7473"
- NEO4J_causalClustering_discoveryAdvertisedAddress=core3:5000
- NEO4J_causalClustering_transactionAdvertisedAddress=core3:6000
- NEO4J_causalClustering_raftAdvertisedAddress=core3:7000
- NEO4J_causalClustering_expectedCoreClusterSize=3
- NEO4J_causalClustering_initialDiscoveryMembers=core1:5000,core2:5000,core3:5000
- NEO4J_causalClustering_refuseToBeLeader=true

readreplica1:
image: neo4j:4.3.6-enterprise
volumes:
- ./readreplica1/conf:/conf
- ./readreplica1/data:/data
- ./readreplica1/import:/import
- ./readreplica1/logs:/logs
- ./readreplica1/plugins:/plugins
networks:
- lan
ports:
- 4474:7474
- 4687:7687
- 7473:7473
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_memory_pagecache_size=10M
- NEO4J_dbms_memory_heap_initial__size=10M
- NEO4J_AUTH=neo4j/neo
- NEO4J_dbms_mode=READ_REPLICA
- NEO4J_dbms_connector_bolt_advertised__address="localhost:7687"
- NEO4J_dbms_connector_http_advertised__address="localhost:7474"
- NEO4J_dbms_connector_https_advertised__address="localhost:7473"
- NEO4J_causalClustering_discoveryAdvertisedAddress=readreplica1:5000
- NEO4J_causalClustering_transactionAdvertisedAddress=readreplica1:6000
- NEO4J_causalClustering_raftAdvertisedAddress=readreplica1:7000
- NEO4J_causalClustering_initialDiscoveryMembers=core1:5000,core2:5000,core3:5000

Then finally:

  1. browser:
    0.0.0.0:1474

  2. log in through:
    neo4j://0.0.0.0:1687

View solution in original post

1 REPLY 1

tsjota
Node

I finally got this Docker Neo4j cluster up and running.

After lots of trial and error , this is what I found to work:

(1) docker-compose.yml

version: '3'

networks:
lan:

services:

core1:
image: neo4j:4.3.6-enterprise
volumes:
- ./core1/conf:/conf
- ./core1/data:/data
- ./core1/import:/import
- ./core1/logs:/logs
- ./core1/plugins:/plugins
networks:
- lan
ports:
- 1474:7474
- 1687:7687
- 7473:7473
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_memory_pagecache_size=10M
- NEO4J_dbms_memory_heap_initial__size=10M
- NEO4J_AUTH=neo4j/neo
- NEO4J_dbms_mode=CORE
- NEO4J_dbms_connector_bolt_advertised__address="localhost:7687"
- NEO4J_dbms_connector_http_advertised__address="localhost:7474"
- NEO4J_dbms_connector_https_advertised__address="localhost:7473"
- NEO4J_causalClustering_discoveryAdvertisedAddress=core1:5000
- NEO4J_causalClustering_transactionAdvertisedAddress=core1:6000
- NEO4J_causalClustering_raftAdvertisedAddress=core1:7000
- NEO4J_causalClustering_expectedCoreClusterSize=3
- NEO4J_causalClustering_initialDiscoveryMembers=core1:5000,core2:5000,core3:5000
- NEO4J_causal__clustering_disable__middleware__logging=false

core2:
image: neo4j:4.3.6-enterprise
volumes:
- ./core2/conf:/conf
- ./core2/data:/data
- ./core2/import:/import
- ./core2/logs:/logs
- ./core2/plugins:/plugins
networks:
- lan
ports:
- 2474:7474
- 2687:7687
- 7473:7473
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_memory_pagecache_size=10M
- NEO4J_dbms_memory_heap_initial__size=10M
- NEO4J_AUTH=neo4j/neo
- NEO4J_dbms_mode=CORE
- NEO4J_dbms_connector_bolt_advertised__address="localhost:7687"
- NEO4J_dbms_connector_http_advertised__address="localhost:7474"
- NEO4J_dbms_connector_https_advertised__address="localhost:7473"
- NEO4J_causalClustering_discoveryAdvertisedAddress=core2:5000
- NEO4J_causalClustering_transactionAdvertisedAddress=core2:6000
- NEO4J_causalClustering_raftAdvertisedAddress=core2:7000
- NEO4J_causalClustering_expectedCoreClusterSize=3
- NEO4J_causalClustering_initialDiscoveryMembers=core1:5000,core2:5000,core3:5000
- NEO4J_causalClustering_refuseToBeLeader=true

core3:
image: neo4j:4.3.6-enterprise
volumes:
- ./core3/conf:/conf
- ./core3/data:/data
- ./core3/import:/import
- ./core3/logs:/logs
- ./core3/plugins:/plugins
networks:
- lan
ports:
- 3474:7474
- 3687:7687
- 7473:7473
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_memory_pagecache_size=10M
- NEO4J_dbms_memory_heap_initial__size=10M
- NEO4J_AUTH=neo4j/neo
- NEO4J_dbms_mode=CORE
- NEO4J_dbms_connector_bolt_advertised__address="localhost:7687"
- NEO4J_dbms_connector_http_advertised__address="localhost:7474"
- NEO4J_dbms_connector_https_advertised__address="localhost:7473"
- NEO4J_causalClustering_discoveryAdvertisedAddress=core3:5000
- NEO4J_causalClustering_transactionAdvertisedAddress=core3:6000
- NEO4J_causalClustering_raftAdvertisedAddress=core3:7000
- NEO4J_causalClustering_expectedCoreClusterSize=3
- NEO4J_causalClustering_initialDiscoveryMembers=core1:5000,core2:5000,core3:5000
- NEO4J_causalClustering_refuseToBeLeader=true

readreplica1:
image: neo4j:4.3.6-enterprise
volumes:
- ./readreplica1/conf:/conf
- ./readreplica1/data:/data
- ./readreplica1/import:/import
- ./readreplica1/logs:/logs
- ./readreplica1/plugins:/plugins
networks:
- lan
ports:
- 4474:7474
- 4687:7687
- 7473:7473
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_dbms_memory_pagecache_size=10M
- NEO4J_dbms_memory_heap_initial__size=10M
- NEO4J_AUTH=neo4j/neo
- NEO4J_dbms_mode=READ_REPLICA
- NEO4J_dbms_connector_bolt_advertised__address="localhost:7687"
- NEO4J_dbms_connector_http_advertised__address="localhost:7474"
- NEO4J_dbms_connector_https_advertised__address="localhost:7473"
- NEO4J_causalClustering_discoveryAdvertisedAddress=readreplica1:5000
- NEO4J_causalClustering_transactionAdvertisedAddress=readreplica1:6000
- NEO4J_causalClustering_raftAdvertisedAddress=readreplica1:7000
- NEO4J_causalClustering_initialDiscoveryMembers=core1:5000,core2:5000,core3:5000

Then finally:

  1. browser:
    0.0.0.0:1474

  2. log in through:
    neo4j://0.0.0.0:1687