以下是griddb 4.5 的体验(基于虚拟机部署)
安装包
https://github.com/griddb/griddb/releases/download/v4.5.2/griddb-4.5.2-linux.x86_64.rpm
安装
yum install -y griddb-4.5.2-linux.x86_64.rpm
配置
默认在/var/lib/gridstore
- home
export GS_HOME=$PWD
export GS_LOG=$PWD/log
- 修改密码
gs_passwd admin
- 集群配置(固定ip)
注意修改为自己的ip
{
"dataStore":{
"partitionNum":128,
"storeBlockSize":"64KB"
},
"cluster":{
"clusterName":"defaultCluster",
"replicationNum":2,
"notificationInterval":"5s",
"heartbeatInterval":"5s",
"loadbalanceCheckInterval":"180s",
"notificationMember": [
{
"cluster": {"address":"xxxx", "port":10010},
"sync": {"address":"xxxx", "port":10020},
"system": {"address":"xxxxx", "port":10040},
"transaction": {"address":"xxxxx", "port":10001},
"sql": {"address":"xxxxx", "port":20001}
}
]
},
"sync":{
"timeoutInterval":"30s"
}
}
启动
需要切换用户gsadm
su gsadm
gs_startnode -u admin/admin -w
加入集群
gs_joincluster -u admin/admin –w -c defaultCluster
查看状态
gs_stat -u admin/admin | grep Status
如果看到以下信息就是成功的
"clusterStatus": "MASTER",
"nodeStatus": "ACTIVE",
"partitionStatus": "NORMAL"
jdbc 链接
- 驱动下载
https://search.maven.org/artifact/com.github.griddb/gridstore-jdbc/4.5.0.1/jar
- 配置
使用dbeaver
- 创建表
CREATE TABLE users (
username STRING(131072),
userage INTEGER
);
- 插入数据
INSERT INTO users
(username, userage)
VALUES('dalong', 1111);
- 查询
SELECT * from users
说明
关于griddb sql 驱动链接的说明,可以参考源码的demo,或者官方文档
参考资料
https://griddb.org/docs-en/manuals/GridDB_QuickStartGuide.html#Introduction
https://griddb.org/docs-en/manuals/GridDB_SQL_Reference.html
https://griddb.org/docs-en/manuals/GridDB_FeaturesReference.html
https://github.com/griddb/jdbc
https://griddb.org/docs-en/manuals/GridDB_JDBC_Driver_UserGuide.html