前言
本次安装的KingBaseES的版本是V008R006C008B0014。
服务器操作系统为CentOS 7.5 X86。
下载
本次选择的是上图红框中的版本的docker镜像,点击下载,会弹框提示留下信息(如下图),补充后确定即可下载。
哦,别忘了下载授权文件,授权文件在这里。
授权文件是个压缩包,下载下来即可。
安装
将下载到的tar和授权文件压缩包上传到服务器。
#解压授权文件
tar -xvf license_开发版.zip
#load镜像文件
docker load -i kdb_x86_64_v008r006c008b0014.tar
#启动容器,注意-v的位置是将授权文件所在目录挂载到/opt,具体位置需要自己调整
docker run -d -it --privileged=true -p 54321:54321 -v /home/setup/kingbasse/license_29404:/opt --name kingbase-latest -e DB_USER=kingbase -e DB_PASSWORD=123456 kingbase:v1
#查看运行日志
docker logs -f kingbase-latest
chmod: cannot access '/home/kingbase/userdata/data': No such file or directory
The files belonging to this database system will be owned by user "kingbase".
This user must also own the server process.
The database cluster will be initialized with locale "C".
The default database encoding has accordingly been set to "SQL_ASCII".
The default text search configuration will be set to "english".
The comparision of strings is case-insensitive.
Data page checksums are disabled.
fixing permissions on existing directory /home/kingbase/userdata/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... UTC
creating configuration files ... ok
Begin setup encrypt device
initializing the encrypt device ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
create security database ... ok
load security database ... ok
syncing data to disk ... ok
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing sys_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
/home/kingbase/install/kingbase/bin/sys_ctl -D /home/kingbase/userdata/data -l logfile start
waiting for server to start.... done
server started
* * * * * kingbase /home/kingbase/init.sh check_and_run /home/kingbase/userdata/data >> /home/kingbase/cronlog
看到如上日志,即为正常启动。
连接
连接时,我用的工具是DBeaver 23.3.3,具体操作如下。
新建连接,驱动选择PostgreSQL即可。填写如下信息,以下用户名/密码是启动容器时指定的kingbase/123456。
点击测试连接,出现连接成功提示即可。