# Neo4j Development and Deployment Guideline --- [TOC] ## 0. Environment - OS: Window, Ubuntu, Centos - IDE: Eclipe [Download](https://www.eclipse.org/downloads/), Intellij [Download](https://www.jetbrains.com/idea/download/) - Java SDK 11 - [Download](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html) - Maven 3.8.1 - [Download](https://maven.apache.org/download.cgi), [Setup Guideline](https://linuxize.com/post/how-to-install-apache-maven-on-ubuntu-20-04/) - Neo4j 4.3.2 Enterprise - [Download](https://neo4j.com/download/) - Docker, Docker compose - [Download](https://www.docker.com/products/docker-desktop), [Setup Guideline](https://docs.docker.com/engine/install/ubuntu/) ## 1. Settup & Environment ### Setup develop environment 1.1 Setup Environment for system. > Select the operating system you want to use 1.2 Install Docker, Docker compose - Follow step by step in setup guide - Add permisson for Docker on Ubuntu/linux ```command sudo groupadd docker sudo usermod -aG docker $USER ``` - Run Docker with administrator on Windows 3.2 Install Java SDK 4.3 Install Maven 5.4 Install IDE ### Setup environment Neo4j #### 1. Install Portainer (Docker compose) 1.1 Run commandline ```command docker volume create portainer_data docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce ```  1.2 Open browser with url: http://localhost:9000/ 1.3 Create new user for portainer system  1.4 Conenct portainer to docker environment  Select Docker (Manager the local Docker environment) Click Conenct button 1.5 Portainer Dashboard  **Notes:** > The Portainer will be auto start with docker when the system startup. #### 2. Setup Neo4j with docker compose 2.1 Add new stack for Neo4j container - Open dashboard: http://localhost:9000/ - Select Endpoint:  Click to local endpoint - Open Stacks  - New stack Enter name stack: Neo4j Database Enter script stack: > docker-compose.yml for 1 instance ```dockerfile= version: '3' services: neo4j-instance-1: image: neo4j:enterprise hostname: instance1 container_name: neo4j-i1 ports: - "7474:7474" - "7687:7687" volumes: - ./db_neo4j_logs_instance_1:/logs environment: - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes networks: cluster: driver: bridge ``` > docker-compose.yml for 3 instances ```dockerfile= ``` - Click deploy the stack - Open Neo4j Console http://localhost:7474/browser/http://localhost:7474/browser/  > Default user: neo4j/neo4j - Create new password for system account (user neo4j)  - Neo4j Console dashboard  ## 2. Development 2.1 Clone repository and build - Clone repository with ssh or https ```cmd= git clone url_reposiroty.git ``` - Build repository ```cmd= cd repository_folder mvn clean install ``` 2.2 Development guideline - Dependencies library: ```xml= <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j-ogm-core</artifactId> <version>3.2</version> <scope>compile</scope> </dependency> <!-- Only add if you're using the Bolt driver --> <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j-ogm-bolt-driver</artifactId> <version>3.2</version> <scope>runtime</scope> </dependency> <!-- Only add if you're using the HTTP driver --> <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j-ogm-http-driver</artifactId> <version>3.2</version> <scope>runtime</scope> </dependency> <!-- Only add if you're using the Embedded driver --> <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j-ogm-embedded-driver</artifactId> <version>3.2</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j</artifactId> <version>4.1</version> <scope>runtime</scope> </dependency> ``` - Code guide: > Basic Bolt Driver Configuration ```java= Configuration configuration = new Configuration.Builder() .uri("bolt://neo4j:password@localhost") .setConnectionPoolSize(150) .build() ``` > Permanent Data Store Embedded Driver Configuration ```java= Configuration configuration = new Configuration.Builder() .uri("file:///var/tmp/neo4j.db") .build() ``` ## 3. Refer - [Neo4j Wifi features] http://www.vi.w3ki.com/neo4j/neo4j_features_advantages.html - [CQL Example] https://www.tutorialspoint.com/neo4j/neo4j_where_clause.htm - [Neo4j OGM] https://github.com/neo4j/neo4j-ogm - [Repository ]
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up