Commit c19fc371 authored by Mahesh Kumar Gangula's avatar Mahesh Kumar Gangula
Browse files

Issue #000 fix: updated to support all envs.

parent 30f47459
schema-updates 4.1.0_fixes AmiableAnil-patch-1 Gcloud_copy Gcloud_fix Remove_unwantedCode_Gcloud_fix actors-test bulk-upload-comptenecy-mapping bulk-upload-excelsheet bulk-upload-test_excel bulk_upload csp-migration dependabot/maven/platform-core/platform-telemetry/ch.qos.logback-logback-core-1.2.9 dependabot/maven/search-api/search-core/org.apache.httpcomponents-httpclient-4.5.13 knowlg-friday knowlg-oneclick local-setup-fix local-setup-kube m-4.2.0 master master-data patch-1 patch-2 patch-3 poc_bulk_upload qs-schema rahul_bulk_upload_postgres release-4.0.0 release-4.1.0 release-4.10.0 release-4.10.1 release-4.2.0 release-4.3.0 release-4.4.0 release-4.5.0 release-4.6.0 release-4.7.0 release-4.7.0-debug release-4.8.0 release-4.8.0-debug release-4.9.0 release-4.9.1 release-5.0.0 release-5.0.1 release-5.1.0 release-5.1.0-content release-5.2.0 release-5.3.0 revert-718-visiblity-private-api revert-719-assessment-private-read-api revert-720-visiblity-public-search-api revert-721-visiblity-private-search-api review-4.1.0 s-debug schema-update-4.0 release-5.2.0_RC2 release-5.2.0_RC1 release-5.1.0_RC1 release-5.0.0_RC2 release-5.0.0_RC1 release-4.10.0_RC2 release-4.10.0_RC1 release-4.9.1_RC1 release-4.9.0_RC8 release-4.9.0_RC7 release-4.9.0_RC6 release-4.9.0_RC5 release-4.9.0_RC4 release-4.9.0_RC3 release-4.9.0_RC2 release-4.9.0_RC1 release-4.8.0_RC5 release-4.8.0_RC4 release-4.8.0_RC3 release-4.8.0_RC2 release-4.8.0_RC1 release-4.7.0_RC6 release-4.7.0_RC5 release-4.7.0_RC4 release-4.7.0_RC3 release-4.7.0_RC2 release-4.7.0_RC1 release-4.6.0_RC2 release-4.6.0_RC1 release-4.5.0_RC2 release-4.5.0_RC1 release-4.4.0_RC6 release-4.4.0_RC5 release-4.4.0_RC4 release-4.4.0_RC3 release-4.4.0_RC2 release-4.4.0_RC1 release-4.3.0_RC10 release-4.3.0_RC9 release-4.3.0_RC8 release-4.3.0_RC7 release-4.3.0_RC6 release-4.3.0_RC5 release-4.3.0_RC4 release-4.3.0_RC3 release-4.3.0_RC2 release-4.3.0_RC1 release-4.2.0_RC13 release-4.2.0_RC12 release-4.2.0_RC11 release-4.2.0_RC10 release-4.2.0_RC9 release-4.2.0_RC8 release-4.2.0_RC7 release-4.2.0_RC6 release-4.2.0_RC5 release-4.2.0_RC4 release-4.2.0_RC3 release-4.2.0_RC2 release-4.2.0_RC1 release-4.1.0_RC13 release-4.1.0_RC12 release-4.1.0_RC11 release-4.1.0_RC10 release-4.1.0_RC9 release-4.1.0_RC8 release-4.1.0_RC7 release-4.1.0_RC6 release-4.1.0_RC5 release-4.1.0_RC4 release-4.1.0_RC3 release-4.1.0_RC2 release-4.1.0_RC1 release-4.0.0_RC9 release-4.0.0_RC8 release-4.0.0_RC7 release-4.0.0_RC6 release-4.0.0_RC5 release-4.0.0_RC4 release-4.0.0_RC3 release-4.0.0_RC2 release-4.0.0_RC1
No related merge requests found
Showing with 37 additions and 13 deletions
+37 -13
# knowledge-platform
Repository for Knowledge Platform - 2.0
## Content-Service local setup
This readme file contains the instruction to set up and run the content-service in local machine.
### Prerequisites:
* Neo4j
* Redis
* Neo4j
* Redis
* Cassandra
### Prepare folders for database data and logs
```shell
mkdir -p ~/sunbird-dbs/neo4j ~/sunbird-dbs/cassandra ~/sunbird-dbs/redis ~/sunbird-dbs/es ~/sunbird-dbs/kafka
export sunbird_dbs_path=~/sunbird-dbs
```
### Neo4j database setup in docker:
1. First, we need to get the neo4j image from docker hub using the following command.
```shell
......@@ -13,10 +23,10 @@ docker pull neo4j:3.3.0
```
2. We need to create the neo4j instance, By using the below command we can create the same and run in a container.
```shell
docker run --name local_neo4j -p7474:7474 -p7687:7687 -d \
-v C:/neo4j_database_files/data:/var/lib/neo4j/data \
-v C:/neo4j_database_files/logs:/var/lib/neo4j/logs \
-v C:/neo4j_database_files/plugins:/var/lib/neo4j/plugins \
docker run --name sunbird_neo4j -p7474:7474 -p7687:7687 -d \
-v $sunbird_dbs_path/neo4j/data:/var/lib/neo4j/data \
-v $sunbird_dbs_path/neo4j/logs:/var/lib/neo4j/logs \
-v $sunbird_dbs_path/neo4j/plugins:/var/lib/neo4j/plugins \
--env NEO4J_dbms_connector_https_advertised__address="localhost:7473" \
--env NEO4J_dbms_connector_http_advertised__address="localhost:7474" \
--env NEO4J_dbms_connector_bolt_advertised__address="localhost:7687" \
......@@ -37,10 +47,15 @@ Using the -p option with ports 7474 and 7687 allows us to expose and listen for
Using Docker on Windows will also need a couple of additional configurations because the default 0.0.0.0 address that is resolved with the above command does not translate to localhost in Windows. We need to add environment variables to our command above to set the advertised addresses.
By default, Neo4j requires authentication and requires us to first login with neo4j/neo4j and set a new password. We will skip this password reset by initializing the authentication none when we create the Docker container using the --env NEO4J_AUTH=none.
By default, Neo4j requires authentication and requires us to first login with neo4j/neo4j and set a new password. We will skip this password reset by initializing the authentication none when we create the Docker container using the --env NEO4J_AUTH=none.
3. After running the above command, neo4j instance will be created and container starts running, we can verify the same by accessing neo4j browser(http://localhost:7474/browser).
4. To SSH to neo4j docker container, run the below command.
```shell
docker exec -it sunbird_neo4j bash
```
### Redis database setup in docker:
1. we need to get the redis image from docker hub using the below command.
```shell
......@@ -48,7 +63,11 @@ docker pull redis:6.0.8
```
2. We need to create the redis instance, By using the below command we can create the same and run in a container.
```shell
docker run --name local_redis -d -p 6379:6379 redis:6.0.8
docker run --name sunbird_redis -d -p 6379:6379 redis:6.0.8
```
3. To SSH to redis docker container, run the below command
```shell
docker exec -it sunbird_redis bash
```
### cassandra database setup in docker:
1. we need to get the cassandra image and can be done using the below command.
......@@ -57,17 +76,22 @@ docker pull cassandra:3.11.8
```
2. We need to create the cassandra instance, By using the below command we can create the same and run in a container.
```shell
docker run --name local_cassandra -d -p 9042:9042 \
-v C:/databases/cassandra/datadir:/var/lib/cassandra \
docker run --name sunbird_cassandra -d -p 9042:9042 \
-v $sunbird_dbs_path/cassandra/data:/var/lib/cassandra \
-v $sunbird_dbs_path/cassandra/logs:/opt/cassandra/logs \
--network bridge cassandra:3.11.8
```
For network, we can use the existing network or create a new network using the following command and use it.
```shell
docker network create NETWORK
docker network create sunbird_db_network
```
3. To start cassandra cypher shell run the below command.
```shell
docker exec -it [container_name] cqlsh
docker exec -it sunbird_cassandra cqlsh
```
4. To ssh to cassandra docker container, run the below command.
```shell
docker exec -it sunbird_cassandra /bin/bash
```
### Running content-service:
1. Go to the path: /knowledge-platform and run the below maven command to build the application.
......@@ -96,4 +120,4 @@ CREATE TABLE IF NOT EXISTS category_store.category_definition_data (
forms map<text, text>,
objectmetadata map<text, text>
);
```
\ No newline at end of file
```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment