国产数据库-Linux下KingbaseES的安装
KingbaseES安装前OS内核参数修改(限性能测试或高并发下建议设置)
配置内核参数
[root@localhost ~]# vi /etc/sysctl.conf
kernel.shmmax = 2147483648
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 2500 320000102420480
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144
修改好内核参数后,执行如下命令使新的设置生效
[root@localhost ~]# /sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 2147483648
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
创建并添加kingbase组和用户修改相应权限
[root@localhost ~]# groupadd kingbase
[root@localhost ~]# useradd kingbase -g kingbase -m
[root@localhost ~]# passwd kingbase
[root@localhost home]# chmod -R 755 kingbase
[root@localhost home]# chown -R kingbase:kingbase kingbase
配置kingbase用户环境变量
[kingbase@test ~]$ vi .bash_profile
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/kingbase/KingbaseES/lib:/home/kingbase/KingbaseES/bin:/home/kingbase/KingbaseES/unixodbc/lib
添加以下内容到/etc/security/limits.conf
[root@localhost ~]# vi /etc/security/limits.conf
kingbase soft nproc 2047
kingbase hard nproc 16384
kingbase soft nofile 1024
kingbase hard nofile 65536
//一般来说,出于性能上的考虑,还需要需要进行如下的设定,以便改进kingbase用户的有关体验,nproc(单个用户可用的最大进程数量), nofile(可打开的文件描述符的最大数)。soft是软限制 ,hard是硬限制,用户可以超过这个设置的值,但一定不能超过hard 的值 。一般soft比hard小。
添加以下内容到/etc/pam.d/login
[root@localhost ~]# vi /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so
要使 limits.conf 文件配置生效,必须要确保 pam_limits.so 文件被加入到启动文件中。查看 /etc/pam.d/login 文件中有:
session required /lib/security/pam_limits.so
添加以下内容到/etc/profile
[root@localhost ~]# vi /etc/profile
if [ $USER = "kingbase" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
将KingbaseES软件从windows中传至Linux中并解压
[root@localhost ~]# ls
anaconda-ks.cfg install.log.syslog
Desktop kdb-7.1.2.0363-release-Linux-x86_64-installer-build0032.zip
install.log license_ee_7.1.2_企业版180L64.dat
[root@localhost kingbase]# unzip kdb-7.1.2.0363-release-Linux-x86_64-installer-build0032.zip
[root@localhost kingbase]# su - kingbase
[kingbase@localhost ~]$ cd /home/kingbase/
[kingbase@localhost ~]$ ls
kdb-7.1.2.0363-release-Linux-x86_64-installer-build0032.zip setup
license_ee_7.1.2_企业版180L64.dat setup.sh
[kingbase@localhost ~]$ mkdir /home/kingbase/kingbaseES
[root@localhost ~]# xhost +
access control disabled, clients can connect from any host
[root@localhost ~]# xclock 出现小时中则正常
[kingbase@localhost ~]$ ./setup.sh
Now launch installer...
Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system‘s environment...
Launching installer...
这里选择完全安装
证书选择
确认后开始安装,期间会提示远程账号,默认krms,密码krms,这里直接下一步
选择完成
切换到root用户执行Root.sh(Linux特有步骤)
[kingbase@localhost ~]$ su -
口令:
[root@localhost kingbaseES]# cd /home/kingbase/kingbaseES/Install/
[root@localhost Install]# ls
Root.sh servicemgmt.sh startup-desktop
[root@localhost Install]# ./Root.sh
Installing ODBC driver...
ODBC Driver is installed successfully!
Installing krms7d...
krms7d is installed successfully!
krms7d is starting...
starting krms[确定]
成功启动krms服务。
krms7d start successfully!
Installing kingbase7d...
kingbase7d is installed successfully!
Installing jobmgmt7d...
jobmgmt7d is installed successfully!
Installing kdbws7d...
kdbws7d is installed successfully!
kdbws7d is starting...
kdbws7d is starting[确定]
kdbws7d start successfully!
Starting to initialize database by kingbase ...
Complete.
初始化数据库
检查下4个进程的启动情况
[kingbase@localhost ~]$ /etc/init.d/krms7d status
krms of kingbase: running[确定]
[kingbase@localhost ~]$ /etc/init.d/kingbase7d status
kingbase kingbasees_instance1 of kingbase: running[确定]
[kingbase@localhost ~]$ /etc/init.d/jobmgmt7d status
job_manager kingbasees_instance1 of kingbase: not running[警告]
[kingbase@localhost ~]$ /etc/init.d/kdbws7d status
kdbws7d (pid 10497) is running......[确定]
启动数据库
[kingbase@localhost ~]$ isql -U SYSTEM -W beijing TEST //-U表示用户 -W表示密码 TEST为数据库名
欢迎使用 isql 7.1.2.0363 release 64 bit, Kingbase 交互式终端.
类型: \h SQL帮助命令
\? isql帮助命令
\g 将之前的SQL语句发往服务器执行
\q 退出
TEST=#
本文出自 “岁伏” 博客,请务必保留此出处http://suifu.blog.51cto.com/9167728/1606503
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。