
Recientemente se ha publicado la versión 4.1 de Couchbase. Los aspectos más destacados de esta versión son:
- N1QL: Soporte completo de SQL CRUD con N1QL para aplicaciones Batch y OLTP
- Índices de cobertura
- Declaraciones preparadas
- Otras plataformas compatibles
Puede leerlo todo en Presentación de Couchbase Server 4.1 y también ver una repetición de Introducción práctica a las novedades de Couchbase 4.1:
Primeros pasos con Couchbase 4.1 y Docker
Utilice el siguiente archivo Docker Compose:
|
1 2 3 4 5 6 7 |
mycouchbase: image: arungupta/couchbase ports: - 8091:8091 - 8092:8092 - 8093:8093 - 11210:11210 |
para iniciar un Contenedor Docker Couchbase 4.1:
|
1 2 |
docker-compose up -d Creating couchbase_mycouchbase_1 |
Esto lo hará:
- Inicie el servidor Couchbase 4.1 (Dockerfile)
- Configúrelo mediante API REST de Couchbase como se explica en Configurar Couchbase Docker Container usando REST API
- Establece cuotas de memoria e índice
- Configura el servicio de consultas, datos e índices
- Configura las credenciales de nombre de usuario y contraseña
- Instale
viaje-muestracubo
Los registros pueden verse como:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
docker-compose logs Attaching to couchbase_mycouchbase_1 mycouchbase_1 | Starting Couchbase Server -- Web UI available at https://:8091 mycouchbase_1 | * Trying 127.0.0.1... mycouchbase_1 | % Total % Received % Xferd Average Speed Time Time Time Current mycouchbase_1 | Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 127.0.0.1 (127.0.0.1) port 8091 (#0) mycouchbase_1 | > POST /pools/default HTTP/1.1 mycouchbase_1 | > User-Agent: curl/7.40.0-DEV mycouchbase_1 | > Host: 127.0.0.1:8091 mycouchbase_1 | > Accept: */* mycouchbase_1 | > Content-Length: 36 mycouchbase_1 | > Content-Type: application/x-www-form-urlencoded mycouchbase_1 | > mycouchbase_1 | } [36 bytes data] mycouchbase_1 | * upload completely sent off: 36 out of 36 bytes mycouchbase_1 | < HTTP/1.1 200 OK mycouchbase_1 | < Server: Couchbase Server mycouchbase_1 | < Pragma: no-cache mycouchbase_1 | < Date: Thu, 17 Dec 2015 05:30:16 GMT mycouchbase_1 | < Content-Length: 0 mycouchbase_1 | < Cache-Control: no-cache mycouchbase_1 | < 100 36 0 0 100 36 0 1820 --:--:-- --:--:-- --:--:-- 2000 mycouchbase_1 | * Connection #0 to host 127.0.0.1 left intact mycouchbase_1 | * Trying 127.0.0.1... mycouchbase_1 | % Total % Received % Xferd Average Speed Time Time Time Current mycouchbase_1 | Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 127.0.0.1 (127.0.0.1) port 8091 (#0) mycouchbase_1 | > POST /node/controller/setupServices HTTP/1.1 mycouchbase_1 | > User-Agent: curl/7.40.0-DEV mycouchbase_1 | > Host: 127.0.0.1:8091 mycouchbase_1 | > Accept: */* mycouchbase_1 | > Content-Length: 26 mycouchbase_1 | > Content-Type: application/x-www-form-urlencoded mycouchbase_1 | > mycouchbase_1 | } [26 bytes data] mycouchbase_1 | * upload completely sent off: 26 out of 26 bytes mycouchbase_1 | < HTTP/1.1 200 OK mycouchbase_1 | < Server: Couchbase Server mycouchbase_1 | < Pragma: no-cache mycouchbase_1 | < Date: Thu, 17 Dec 2015 05:30:16 GMT mycouchbase_1 | < Content-Length: 0 mycouchbase_1 | < Cache-Control: no-cache mycouchbase_1 | < 100 26 0 0 100 26 0 2670 --:--:-- --:--:-- --:--:-- 2888 mycouchbase_1 | * Connection #0 to host 127.0.0.1 left intact mycouchbase_1 | * Trying 127.0.0.1... mycouchbase_1 | % Total % Received % Xferd Average Speed Time Time Time Current mycouchbase_1 | Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 127.0.0.1 (127.0.0.1) port 8091 (#0) mycouchbase_1 | > POST /settings/web HTTP/1.1 mycouchbase_1 | > User-Agent: curl/7.40.0-DEV mycouchbase_1 | > Host: 127.0.0.1:8091 mycouchbase_1 | > Accept: */* mycouchbase_1 | > Content-Length: 50 mycouchbase_1 | > Content-Type: application/x-www-form-urlencoded mycouchbase_1 | > mycouchbase_1 | } [50 bytes data] mycouchbase_1 | * upload completely sent off: 50 out of 50 bytes mycouchbase_1 | < HTTP/1.1 200 OK mycouchbase_1 | < Server: Couchbase Server mycouchbase_1 | < Pragma: no-cache mycouchbase_1 | < Date: Thu, 17 Dec 2015 05:30:16 GMT mycouchbase_1 | {"newBaseUri":"https://127.0.0.1:8091/"}< Content-Type: application/json mycouchbase_1 | < Content-Length: 39 mycouchbase_1 | < Cache-Control: no-cache mycouchbase_1 | < mycouchbase_1 | { [39 bytes data] 100 89 100 39 100 50 3544 4543 --:--:-- --:--:-- --:--:-- 5000 mycouchbase_1 | * Connection #0 to host 127.0.0.1 left intact mycouchbase_1 | * Trying 127.0.0.1... mycouchbase_1 | % Total % Received % Xferd Average Speed Time Time Time Current mycouchbase_1 | Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 127.0.0.1 (127.0.0.1) port 8091 (#0) mycouchbase_1 | * Server auth using Basic with user 'Administrator' mycouchbase_1 | > POST /sampleBuckets/install HTTP/1.1 mycouchbase_1 | > Authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA== mycouchbase_1 | > User-Agent: curl/7.40.0-DEV mycouchbase_1 | > Host: 127.0.0.1:8091 mycouchbase_1 | > Accept: */* mycouchbase_1 | > Content-Length: 17 mycouchbase_1 | > Content-Type: application/x-www-form-urlencoded mycouchbase_1 | > mycouchbase_1 | } [17 bytes data] mycouchbase_1 | * upload completely sent off: 17 out of 17 bytes mycouchbase_1 | < HTTP/1.1 202 Accepted mycouchbase_1 | < Server: Couchbase Server mycouchbase_1 | < Pragma: no-cache mycouchbase_1 | < Date: Thu, 17 Dec 2015 05:30:16 GMT mycouchbase_1 | < []Content-Type: application/json mycouchbase_1 | < Content-Length: 2 mycouchbase_1 | < Cache-Control: no-cache mycouchbase_1 | < mycouchbase_1 | { [2 bytes data] 100 19 100 2 100 17 29 251 --:--:-- --:--:-- --:--:-- 253 mycouchbase_1 | * Connection #0 to host 127.0.0.1 left intact mycouchbase_1 | /entrypoint.sh couchbase-server |
Conectarse a CBQ (Couchbase Query tool):
|
1 2 3 |
docker run -it couchbase /opt/couchbase/bin/cbq -engine=https://$(docker-machine ip couchbase):8093 Couchbase query shell connected to https://192.168.99.102:8093/ . Type Ctrl-D to exit. cbq> |
Más información Ejecutar consultas N1QL desde la línea de comandos. Detenga el servidor:
|
1 2 |
docker-compose stop Stopping couchbase_mycouchbase_1 ... done |
Retire el recipiente:
|
1 2 3 |
docker-compose rm -f Going to remove couchbase_mycouchbase_1 Removing couchbase_mycouchbase_1 ... done |
Más información sobre Couchbase 4.1:
- Novedades en la documentación de Couchbase Server 4.1
- Descargar Couchbase Server 4.1
- Documentación de Couchbase Server
- Notas de la versión 4.1
- Controladores ODBC y JDBC de Couchbase con SQL Connector
Comparta sus comentarios con nosotros en couchbase.com/foros o Stackoverflow. Que aproveche.