cratedb 4.2 发布了

cratedb 4.2 已经发布了,从changelogs 可以看到还是有比较多的更新的,比如pg 协议更好的兼容(更好的支持bi以及数据分析工具)
同时提供了更好的pg内部结构的暴露(还是方便数据分析工具的使用),同时替换nashorn 为graalvm 的js 引擎(更好的js 特性支持)
同时也提供了很多更好的内置函数,还是很不错的

一个简单docker-compose 运行说明

  • docker-compose 文件
 
version: "3"
services:
  crate1:
    image: dockerimage.yonyou.com/cratedb/crate:4.2.3
    volumes:
    - "./cratedb/data1:/data"
    - "./cratedb/1.yaml:/crate/config/crate.yml"
    ports:
    - "4200:4200"
    - "4300:4300"
    - "5432:5432"
  crate2:
    image: dockerimage.yonyou.com/cratedb/crate:4.2.3
    volumes:
    - "./cratedb/data2:/data"
    - "./cratedb/2.yaml:/crate/config/crate.yml"
    ports:
    - "4201:4200"
    - "4301:4300"
    - "5433:5432"
  crate3:
    image: dockerimage.yonyou.com/cratedb/crate:4.2.3
    volumes:
    - "./cratedb/data3:/data"
    - "./cratedb/3.yaml:/crate/config/crate.yml"
    ports:
    - "4202:4200"
    - "4302:4300"
    - "5434:5432"

1.yaml:

cluster.name: cratecluster
node.name: crate1
node.master: true
node.data: true
http.port: 4200
psql.port: 5432
transport.tcp.port: 4300
discovery.seed_hosts: ["crate1"]
cluster.initial_master_nodes: ["crate1"]
http.cors.enabled: true
http.cors.allow-origin: "*"
gateway.expected_nodes: 3
gateway.recover_after_nodes: 2
gateway.recover_after_time: 5m
network.host: _local_,_site_
path.logs: /data/log
path.data: /data/data
blobs.path: /data/blobs

2.yaml:

cluster.name: cratecluster
node.name: crate2
node.master: false
node.data: true
http.port: 4200
psql.port: 5432
transport.tcp.port: 4300
discovery.seed_hosts: ["crate1"]
cluster.initial_master_nodes: ["crate1"]
http.cors.enabled: true
http.cors.allow-origin: "*"
gateway.expected_nodes: 3
gateway.recover_after_nodes: 2
gateway.recover_after_time: 5m
network.host: _local_,_site_
path.logs: /data/log
path.data: /data/data
blobs.path: /data/blobs

3.yaml:

cluster.name: cratecluster
node.name: crate3
node.master: false
node.data: true
http.port: 4200
psql.port: 5432
transport.tcp.port: 4300
discovery.seed_hosts: ["crate1"]
cluster.initial_master_nodes: ["crate1"]
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: _local_,_site_
gateway.expected_nodes: 3
gateway.recover_after_nodes: 2
gateway.recover_after_time: 5m
path.logs: /data/log
path.data: /data/data
blobs.path: /data/blobs
 
  • 代码调用
    pacakge.json:
 
{
  "name": "knex-crate-db",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "knex": "^0.21.5",
    "pg": "^8.3.2"
  },
  "scripts": {
    "app": "tsc && node dist/app.js"
  }
}

app.ts:

import knex from "knex"
var client = knex({
    client: 'pg',
    version: '7.2',
    connection: {
        host: 'ip',
        user: 'crate'
    }
});
let users = client("doc.users").select("*")
users.then((data) => {
    console.log(data)
    // close 
    client.destroy(function () {
        console.log(JSON.stringify(arguments))
    })
})

参考资料

https://crate.io/docs/crate/reference/en/latest/appendices/release-notes/4.2.0.html
https://github.com/knex/knex
https://github.com/brianc/node-postgres

posted on   荣锋亮  阅读(372)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2019-08-26 使用plotly dash-component-boilerplate 生成自己的组件
2019-08-26 podium layout 说明
2019-08-26 podium podlets 说明
2019-08-26 podium micro-frontends 简单试用
2019-08-26 podium服务器端的微前端开发框架
2018-08-26 pipelinedb 滑动窗口
2018-08-26 pipelinedb Continuous transforms 操作

导航

< 2025年3月 >
23 24 25 26 27 28 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 1 2 3 4 5
点击右上角即可分享
微信分享提示