官网上的下载需要邮件确认,邮件可能发不出来。可以去github下载源码http://gitee.com/anyline/voltdb.git
国内github网络的原因,可以去gitee下载副本http://gitee.com/anyline/voltdb
现在是11.x版本, 截止到2022年底,开源版本就不再更新了,文档也非常不友好,可以替换成【ignite】
创建centos7 docker容器(或者直接在宿主机上安装)

docker run -d --name voltdb -p 21212:21212 -v /dp/docker/file/voltdb/dp:/dp -v /etc/localtime:/etc/localtime --privileged=true centos:7 /usr/sbin/init
docker exec -it -u root voltdb  /bin/bash
以下是在容器内操作
环境要求:
CentOS7+
Java8+

Python2.6+(11.x要求3.0+)

几个基础的工具
[root@voltdb01 ~]# yum -y install net-tools.x86_64 cmake gcc-c++ ant git make cmake initscripts ethtool which
11.x要求python3
[root@voltdb01 ~]# yum -y install python3
JDK可以用8
[root@voltdb01 ~]# yum -y install java-1.8.0-openjdk*

虽然yum已经配置好了path,但后面还是需要JAVA_HOME变量,
yum安装的java_home一般是在这里/etc/alternatives/java_sdk_1.8.0
[root@voltdb01 ~]# vi  /etc/profile
添加
export JAVA_HOME=/etc/alternatives/java_sdk_1.8.0

source /etc/profile

 
[root@voltdb01 ~]# cd /dp
把源码和编码后的文件以及数据文件放在这里(万一失败了下次不用再下载了)
git clone http://github.com/VoltDB/voltdb.git
国内如果网络问题可以从这里下载
git clone http://gitee.com/anyline/voltdb
如果是从github上下载的有个错误编译时如果抛出异常

[root@voltdb01 ~]# # ant -Djmemcheck=NO_MEMCHECK
Buildfile: /dp/voltdb/build.xml

buildinfo:
     [exec] Version: 11.4.0.beta1 voltdb-10.0-1098-ge88df04-local

catalog:
     [exec] Traceback (most recent call last):
     [exec]   File "catalog.py", line 572, in <module>
     [exec]     main()
     [exec]   File "catalog.py", line 568, in main
     [exec]     classes, javaOnlyClasses = parse( f.read(), debug )
     [exec]   File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
     [exec]     return codecs.ascii_decode(input, self.errors)[0]
     [exec] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 18195: ordinal not in range(128)

修改一下
[root@voltdb01 ~]# vi /dp/voltdb/src/catgen/spec.txt 
第278行  string indexesused        "A CSV list of indexes this statement may use"
最后一半引号改成半角英文

进/dp/voltdb


执行
[root@voltdb01 ~]# ant -Djmemcheck=NO_MEMCHECK
如果中途失败先同执行ant clean再重新执行ant -Djmemcheck=NO_MEMCHECK
。。。。
voltcsvformatter:
      [jar] Building jar: /dp/voltdb/bundles/voltcsvformatter.jar

kinesisstream:
      [jar] Building jar: /dp/voltdb/bundles/kinesisstream.jar

kafkastream10:
    [javac] Compiling 9 source files to /dp/voltdb/obj/release/prod
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
      [jar] Building jar: /dp/voltdb/bundles/kafkastream10.jar

buildbundles:

default:

BUILD SUCCESSFUL
Total time: 1 minutes 22 seconds

运行到这就编译成功了
voltdb开启时遇到Transparent huge pages (THP) not supported问题 提前禁用掉
[root@voltdb01 ~]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
[root@voltdb01 ~]# echo never > /sys/kernel/mm/transparent_hugepage/defrag
设置环境变量
[root@voltdb01 ~]# export VOLTDB_PATH=/dp/voltdb
[root@voltdb01 ~]# export PATH=$PATH:$VOLTDB_PATH/bin
[root@voltdb01 ~]# export CLASSPATH=./$VOLTDB_PATH/lib/*:$VOLTDB_PATH/voltdb/*



votdb check命令可以检测服务器是否符合要求
[root@voltdb01 ~]# votdb check
试用版本与商用版本的功能一样,没有限制
初始化数据库
[root@voltdb01 ~]# voltdb init --dir=/dp/data/ --force
Build: 11.4.0.beta1 voltdb-10.0-1098-ge88df04-dirty-local Community Edition
WARN: VoltDB is running as root. Running the VoltDB server software from the system root account is not recommended.
When using the INIT command, some deployment file settings (hostcount and voltdbroot path) are ignored
Initialized VoltDB root directory /dp/data/voltdbroot

启动数据库
[root@voltdb01 ~]# voltdb start --dir=/dp/data/
Server Operational State is: NORMAL
Server completed initialization.

启动成功就可以访问数据库了,
[root@voltdb01 ~]# sqlcmd
SQL Command :: localhost:21212
1> 这里就可以执行SQL了
ctrl+C退出SQL

设置帐号密码
[root@voltdb01 ~]# # useradd voltdb
[root@voltdb01 ~]# # passwd voltdb
Changing password for user voltdb.
New password:          # 设置用户密码要足够复杂
Retype new password:   # 再次输入
passwd: all authentication tokens updated successfully.


停止数据库使用
[root@voltdb01 ~]# voltadmin shutdown
[root@voltdb01 ~]# voltadmin stop --host=svr1
停止所有集群中所有节点
[root@voltdb01 ~]# voltdb shutdown
【voltdb基础语法】【Java(JDBC)操作voltdb】