Instalación de Oracle NoSQL Database en Linux Mint (Ubuntu)
NOTA: Primeramente, serciorarse que tengamos la versión oficial de Java de #ORACLE. Si no la tenemos entonces
descargar el JDK... y posteriormente procedemos a settear la ruta del
java y
javac.
$ sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk1.7.0_51/jre/bin/java" 0
$ sudo /usr/sbin/update-alternatives --config java
$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/opt/java/jdk1.7.0_51/bin/javac" 1
$ sudo /usr/sbin/update-alternatives --config javac
Paso 1.- Se crea el directorio principal donde se instalará la BD de Oracle NoSQL y se descomprime el archivo (
kv-ce-2.1.57.zip) en éste mismo directorio.
$ sudo mkdir /var/kv/
$ cd /var/kv/
$ sudo unzip kv-ce-2.1.57.zip
Paso 2.- Se crean los directorios donde se almacenarán los datos.
$ sudo mkdir -p /var/kv/stores/root1
$ sudo mkdir -p /var/kv/stores/root2
$ sudo mkdir -p /var/kv/stores/root3
Paso 3.- Se crea el archivo "
boot config"
$ cd /var/kv/kv-2.1.57/
$ sudo java -Xmx256m -Xms256m -jar lib/kvstore.jar makebootconfig -root /var/kv/stores/root1 -host localhost -port 5000 -admin 5001 -harange 5005,5010 -capacity 1
$ sudo java -Xmx256m -Xms256m -jar lib/kvstore.jar makebootconfig -root /var/kv/stores/root2 -host localhost -port 5020 -harange 5025,5030 -capacity 1
$ sudo java -Xmx256m -Xms256m -jar lib/kvstore.jar makebootconfig -root /var/kv/stores/root3 -host localhost -port 5040 -harange 5045,5050 -capacity 1
Paso 4.- Se ejecuta el Oracle NoSQL Database Storage Node Agent (SNA) de cada uno de los nodos de la BD Oracle NoSQL. Los SNA permiten administrar los procesos de la BD Oracle NoSQL de cada nodo.
$ cd /var/kv/kv-2.1.57/
$ sudo nohup java -Xmx256m -Xms256m -jar lib/kvstore.jar start -root /var/kv/stores/root1 &
$ sudo nohup java -Xmx256m -Xms256m -jar lib/kvstore.jar start -root /var/kv/stores/root2 &
$ sudo nohup java -Xmx256m -Xms256m -jar lib/kvstore.jar start -root /var/kv/stores/root3 &
Paso 5.- Se ejecuta la consola de administración para la configuración del store
$ sudo java -Xmx256m -Xms256m -jar lib/kvstore.jar runadmin -host localhost -port 5000
... y a continuación se abre la consola de
kv y procedemos a hacer lo siguiente
a) Nombrar el
KVStore
kv-> configure -name mystore
Store configured: mystore
b) Crear un
Data Center
kv-> plan deploy-datacenter -name IECISA -rf 3 -wait
Executed plan 1, waiting for completion...
Plan 1 ended successfully
kv-> show plans
1 Deploy Datacenter (1) SUCCEEDED
c) Crear los procesos de administración para cada host
kv-> show topology
store=mystore numPartitions=0 sequence=1
dc: id=1 name=IECISA repFactor=3
kv-> plan deploy-sn -dcname IECISA -host localhost -port 5000 -wait
Executed plan 2, waiting for completion...
Plan 2 ended successfully
kv-> plan deploy-admin -sn sn1 -port 5001 -wait
Executed plan 3, waiting for completion...
Plan 3 ended successfully
d) Crear el nodo de almacenamiento (
Storage Node Pool)
kv-> pool create -name IECISAPool
kv-> pool join -name IECISAPool -sn sn1
Added Storage Node(s) [sn1] to pool IECISAPool
e) Crear el resto de los nodos de almacenamiento
kv-> plan deploy-sn -dcname IECISA -host localhost -port 5020 -wait
Executed plan 4, waiting for completion...
Plan 4 ended successfully
kv-> pool join -name IECISAPool -sn sn2
Added Storage Node(s) [sn2] to pool IECISAPool
kv-> plan deploy-sn -dcname IECISA -host localhost -port 5040 -wait
Executed plan 5, waiting for completion...
Plan 5 ended successfully
kv-> pool join -name IECISAPool -sn sn3
Added Storage Node(s) [sn3] to pool IECISAPool
f) Crear y desplegar los nodos de replicación
kv-> topology create -name MyStoreLayout -pool IECISAPool -partitions 100
Created: MyStoreLayout
kv-> topology preview -name MyStoreLayout
Topology transformation from current deployed topology to MyStoreLayout:
Create 1 shard
Create 3 RNs
Create 100 partitions
shard rg1
3 new RNs : rg1-rn1 rg1-rn2 rg1-rn3
100 new partitions
kv-> plan deploy-topology -name MyStoreLayout -wait
Executed plan 6, waiting for completion...
Plan 6 ended successfully
kv-> show plans
1 Deploy Datacenter (1) SUCCEEDED
2 Deploy Storage Node (2) SUCCEEDED
3 Deploy Admin Service (3) SUCCEEDED
4 Deploy Storage Node (4) SUCCEEDED
5 Deploy Storage Node (5) SUCCEEDED
6 Deploy Topo (6) SUCCEEDED
kv-> show topology
store=mystore numPartitions=100 sequence=108
dc: id=1 name=IECISA repFactor=3
sn=[sn1] dc:[id=1 name=IECISA] localhost:5000 capacity=1 RUNNING
[rg1-rn1] RUNNING
No performance info available
sn=[sn2] dc:[id=1 name=IECISA] localhost:5020 capacity=1 RUNNING
[rg1-rn2] RUNNING
No performance info available
sn=[sn3] dc:[id=1 name=IECISA] localhost:5040 capacity=1 RUNNING
[rg1-rn3] RUNNING
No performance info available
shard=[rg1] num partitions=100
[rg1-rn1] sn=sn1
[rg1-rn2] sn=sn2
[rg1-rn3] sn=sn3
g) Verificamos que la configuración es correcta
kv-> verify configuration
Verify: starting verification of mystore based upon topology sequence #108
100 partitions and 3 storage nodes. Version: 12.1.2.1.57 Time: 2014-02-06 22:32:43 UTC
See localhost:/var/kv/stores/root1/mystore/log/mystore_{0..N}.log for progress messages
Verify: == checking storage node sn1 ==
Verify: Storage Node [sn1] on localhost:5000 Datacenter: IECISA [1] Status: RUNNING Ver: 12cR1.2.1.57 2014-01-10 06:20:10 UTC Build id: 4d323d1b5495
Verify: Admin [admin1] Status: RUNNING
Verify: Rep Node [rg1-rn1] Status: RUNNING,MASTER at sequence number: 221 haPort: 5006
Verify: == checking storage node sn2 ==
Verify: Storage Node [sn2] on localhost:5020 Datacenter: IECISA [1] Status: RUNNING Ver: 12cR1.2.1.57 2014-01-10 06:20:10 UTC Build id: 4d323d1b5495
Verify: Rep Node [rg1-rn2] Status: RUNNING,REPLICA at sequence number: 221 haPort: 5025
Verify: == checking storage node sn3 ==
Verify: Storage Node [sn3] on localhost:5040 Datacenter: IECISA [1] Status: RUNNING Ver: 12cR1.2.1.57 2014-01-10 06:20:10 UTC Build id: 4d323d1b5495
Verify: Rep Node [rg1-rn3] Status: RUNNING,REPLICA at sequence number: 221 haPort: 5045
Verification complete, no violations.
Paso 6.- Verificamos la instalación con otras pruebas
Prueba (a) Entramos al explorador (yo uso Google Chrome) y escribimos http://localhost:5001/ y aparecerá el administrador gráfico como se muestra en la imagen.
Prueba (b) Ejecutamos el comando
$ java -Xmx256m -Xms256m -jar /var/kv/kv-2.1.57/lib/kvclient.jar
... y debe mandar algo así como:
12cR1.2.1.57 2014-01-10 06:20:10 UTC Build id: 4d323d1b5495
... y ahora vamos hacer nuestro primer "
Hello Big Data World!" en
java para empezar a poblar nuestra BD NoSQL.
Autores:
@mauricioaranda,
@luisgosher
>>>
Aquí otra referencia rápida de instalación de Oracle NoSQL