LightDB单机安装

LightDB单机安装

LightDB官网:https://www.hs.net/lightdb

下载安装包:lightdb-x-13.8-22.3-7953-el7.x86_64.zip

前置准备

  • 防火墙配置(选择一种操作)
    1. firewall防火墙
    firewall-cmd --permanent --add-port=5432/tcp
    firewall-cmd --permanent --add-port=123/udp
    
    1. iptables防火墙
    iptables -A INPUT -p tcp --dport 5432 -j ACCEPT
    iptables -A INPUT -p udp --dport 123 -j ACCEPT
    
    1. 直接关闭防火墙
    systemctl stop firewalld.service
    systemctl disable firewalld.service
    systemctl stop NetworkManager.service
    systemctl disable NetworkManager.service 
    
  • 关闭 SELINUX
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
setenforce 0
  • 检查时间和时区
[root@localhost lib64]# timedatectl
  Local time: 五 2023-01-06 16:06:20 CST
Universal time: 五 2023-01-06 08:06:20 UTC
    RTC time: 五 2023-01-06 08:06:20
   Time zone: Asia/Shanghai (CST, +0800)
 NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
  DST active: n/a
  
  如果需要修改可以执行:
  #时区列表
  $ timedatectl list-timezones
  #设定时区
  $ timedatectl set-timezone Asia/Shanghai   
  • 安装依赖包
以下执行命令过多,可以创建一个bash可执行文件,统一运行(示例)
$ touch pack.sh
$ vi pack.sh 
$ chmod 777 pack.sh
$ ./pack.sh

# 安 装 包 通 用 运 行 依 赖 ,GUI安 装 和 命 令 行 安 装 均 需 要
yum install -y procps-ng
yum install -y coreutils
# GUI安 装 运 行 依 赖 , 仅GUI安 装 需 要
yum install -y gtk2
yum install -y libXtst
yum install -y dejavu-fonts # 麒 麟v10sp1可 能 需 要 安 装 字 体
# 数 据 库 的 运 行 依 赖
yum install -y readline
yum install -y zlib
yum install -y libxml2
yum install -y openssl-libs
yum install -y uuid
yum install -y c-ares libpcap snappy # tshark
yum install -y ncurses-libs # iftop
yum install -y libnl3 # keepalived ipv6
yum install -y libzstd # canopy
yum install -y sysstat
yum install -y json-c
yum install -y libicu
  • 创建 lightdb 用户并设置 sudo 免密
#创建组(lightdb)
$ groupadd lightdb
#创建用户(lightdb)
$ useradd -g lightdb -m lightdb
#设置密码
$ passwd lightdb

#设置免密
#修改sudoers文件权限
$ chmod 755 /etc/sudoers
$ vi /etc/sudoers
  追加一行:lightdb   ALL=(ALL)      NOPASSWD: ALL 
$ chmod 440 /etc/sudoers
  • 创建 LightDB 安装目录和实例目录
#创建安装目录
$ mkdir -p /usr/local/lightdb
# 修改目录所属用户和组
$ chown -R lightdb:lightdb /usr/local/lightdb

实例目录默认路径为:安装目录下
修改默认实例目录示例:
$ mkdir -p /data/lightdb_data
$ chown -R lightdb:lightdb /data/lightdb_data
  • 配置操作系统内核参数
echo "kernel.shmmni=4096" >> /etc/sysctl.conf
echo "kernel.shmmax=$(expr $(getconf _PHYS_PAGES) / 2 \* $(getconf PAGE_SIZE))" \
>> /etc/sysctl.conf
echo "kernel.shmall=$(expr $(getconf _PHYS_PAGES) / 2)" >> /etc/sysctl.conf
echo "kernel.sem=500 2048000 200 4096" >> /etc/sysctl.conf
echo "fs.aio-max-nr=1048576" >> /etc/sysctl.conf
echo "fs.file-max=524288" >> /etc/sysctl.conf
echo "vm.swappiness=5" >> /etc/sysctl.conf
echo "vm.overcommit_memory=2" >> /etc/sysctl.conf
echo "vm.overcommit_ratio=75" >> /etc/sysctl.conf
echo "vm.dirty_background_ratio=5" >> /etc/sysctl.conf
echo "vm.dirty_ratio=40" >> /etc/sysctl.conf
echo "vm.dirty_expire_centisecs=500" >> /etc/sysctl.conf
echo "vm.dirty_writeback_centisecs=250" >> /etc/sysctl.conf
echo "net.core.somaxconn=2000" >> /etc/sysctl.conf
echo "net.ipv4.tcp_max_syn_backlog=2000" >> /etc/sysctl.conf
echo "net.ipv4.tcp_tw_reuse=1" >> /etc/sysctl.conf
echo "net.ipv4.tcp_syn_retries=3" >> /etc/sysctl.conf
echo "net.ipv4.tcp_retries2=5" >> /etc/sysctl.conf
echo "net.ipv4.tcp_slow_start_after_idle=0" >> /etc/sysctl.conf

执行: sysctl -p
  • 配置 limits.conf
echo "lightdb hard core unlimited" >> /etc/security/limits.conf
echo "lightdb soft core unlimited" >> /etc/security/limits.conf
echo "lightdb hard nofile 524288" >> /etc/security/limits.conf
echo "lightdb soft nofile 524288" >> /etc/security/limits.conf
echo "lightdb hard nproc 16384" >> /etc/security/limits.conf
echo "lightdb soft nproc 16384" >> /etc/security/limits.conf
  • 切换到lightdb用户执行
$ su lightdb 
$ ulimit -c
$ ulimit -n
$ ulimit -u

安装操作

  • 准备lightdb安装包
  • 解压lightdb安装包
unzip lightdb-x-13.8-22.3-7953-el7.x86_64.zip
  • 执行安装脚本
$ cd lightdb-x-13.8-22.3-7953-el7.x86_64.zip
$ ./install.sh
  • 命令行方式安装
Whether to use the graphical user interface (GUI, Make sure DISPLAY is configured, Such as [export DISPLAY=127.0.0.1:0.0])?(Yes or No)
no
Choice a kind of configuration mode!
1: Only install.
2: Install database and Create instance.
3: Developer
Please enter 1 2 or 3(The default is 1):
2
Choice a kind of install mode!

1: Single Mode.
2: High Availability Mode
3: Distributed Mode
Please enter 1, 2 or 3:(The default is 1)
1
Assign a port to the LightDB!
Listen Port(The default port is 5432):

Check system parameters and dependency packages!
========================================= 10.188.122.215 =========================================
NETWORK
name: sem, recommend value: 500,2048000,200,4096, current value: 500,2048000,200,4096, status: OK
name: aio_max_nr, recommend value: 1048576, current value: 1048576, status: OK
name: somaxconn, recommend value: 2000, current value: 2000, status: OK
name: tcp_max_syn_backlog, recommend value: 2000, current value: 2000, status: OK
name: tcp_tw_reuse, recommend value: 1, current value: 1, status: OK
name: tcp_syn_retries, recommend value: 3, current value: 3, status: OK
name: tcp_retries2, recommend value: 5, current value: 5, status: OK
name: tcp_slow_start_after_idle, recommend value: 0, current value: 0, status: OK
PAGE_CACHE
name: dirty_background_ratio, recommend value: 5, current value: 5, status: OK
name: dirty_ratio, recommend value: 40, current value: 40, status: OK
name: dirty_expire_centisecs, recommend value: 500, current value: 500, status: OK
name: dirty_writeback_centisecs, recommend value: 250, current value: 250, status: OK
MEMORY
name: shmmni, recommend value: 4096, current value: 4096, status: OK
name: shmmax, recommend value: 1976979456, current value: 1976979456, status: OK
name: shmall, recommend value: 482661, current value: 482661, status: OK
name: swappiness, recommend value: 5, current value: 5, status: OK
name: overcommit_memory, recommend value: 2, current value: 2, status: OK
name: overcommit_ratio, recommend value: 75, current value: 75, status: OK
FILE_HANDLER
name: file_max, recommend value: 524288, current value: 524288, status: OK
ULIMIT
name: ulimit_core, recommend value: unlimited, current value: unlimited, status: OK
name: ulimit_nofile, recommend value: 8192, current value: 524288, status: OK
Dependency Package
name: JSON-C-0.11 is existed: yes
name: C-ARES-1 is existed: yes
name: LIBNL3 is existed: yes
name: LIBPCAP-1 is existed: yes
name: LIBZSTD-1 is existed: yes
name: LZ4-1 is existed: yes
name: NCURSES-LIBS-5 is existed: yes
name: READLINE-6 is existed: yes
name: SNAPPY-1 is existed: yes
name: UUID-1.6 is existed: yes
name: LIBICU-50 is existed: yes
Choice a kind of Compatible Type!
1: LightdDB(Compatible with PostgreSQL).
2: ORACLE(Compatible with ORACLE).
3: MYSQL(Compatible with MYSQL).
Please enter 1, 2 or 3:(The default is 1)
1
Choice a kind of Compatible Type!
1: LightdDB(Compatible with PostgreSQL).
2: ORACLE(Compatible with ORACLE).
3: MYSQL(Compatible with MYSQL).
Please enter 1, 2 or 3:(The default is 1)
1
Choice a kind of LightDB workload!
1: OLTP(On-line Transaction Processing).
2: OLAP(On-Line Analytical Processing).
Please enter 1 or 2:(The default is 1)
1
Specify a path for installing all LightDB software and storing configuration information.
Please enter base location(The default is /usr/local/lightdb):

Base Location: /usr/local/lightdb
Install Location: /usr/local/lightdb/lightdb-x/13.8-22.3
Please enter instance location(The default is /usr/local/lightdb/lightdb-x/13.8-22.3/data/defaultCluster/):

Instance location: /usr/local/lightdb/lightdb-x/13.8-22.3/data/defaultCluster/
Please configure memory(MB) and character set!
Please enter shared_buffers, Default value is (942):

Please enter effective_cache_size, Default value is (2639):

Please choice a kind of Character Set.
1. UTF8
2. GBK
3. SQL_ASCII
4. LATIN1
The default choice 1(UTF8)
1
Please enter LightDB password!
Please enter original password:

Please enter confirm password:

The original password and confirm password are different one times. Please try again!

Confirm Password must not be null!

Do you want to deploy immediately?(Yes or No, The default is yes)

yes
[>>>>>>>>>>>>>>>                                   ] 30%

  • GUI方式安装
  1. 宿主机Windows上安装并运行:Xmanager - Passive
  2. 虚拟机centos7配置 DISPLAY 环境变量
#命令格式
export DISPLAY=Windows IP:0.0
#IP为运行Xmanager-Passive的系统IP
#【:】后的值为Passive运行后的状态提示,通常为0.0
# 以下命令在lightdb用户下执行
$ export DISPLAY=10.188.122.214:0.0
  1. 安装GUI依赖包
yum install -y libXtst gtk2 libX11
  1. 执行安装脚本
$ ./install.sh 
Whether to use the graphical user interface (GUI, Make sure DISPLAY is configured, Such as [export DISPLAY=127.0.0.1:0.0])?(Yes or No)
yes

  1. 按照引导进行安装
gui-install.png
  • 安装问题
    1. LIBZSTD-1 not existed
      查看lightdb-x-13.8-22.3-7953-el7.x86_64/system-lib目录
      [root@localhost system-lib]# rpm -hvi libzstd-1.5.2-1.el7.x86_64.rpm 
    警告:libzstd-1.5.2-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 352c64e5: NOKEY
    准备中...  ################################# [100%]
    软件包 libzstd-1.5.2-1.el7.x86_64 已经安装
    
    1. file_max, recommend value: 524288,…, status: ERROR
      注意配置操作系统内核参数后执行:sysctl -p 
    
    1. DISPLAY无法开启
      注意下export DISPLAY=xx 的执行用户
    
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
离线安装ora2pg的步骤如下: 1. 首先,您需要下载ora2pg的软件。您可以从GitHub的ora2pg发布页面下载软件。 2. 将下载的软件解压缩。使用以下命令:tar -xzvf ora2pg-21.0.tar.gz 3. 进入解压后的目录。使用以下命令:cd ora2pg-21.0 4. 确保您已经安装了perl,并且版本在5.8以上。 5. 安装ora2pg的依赖模块。您可以使用以下命令来安装Compress::Zlib模块:perl -MCPAN -e 'install Compress::Zlib' 6. 修改ora2pg.conf文件,该文件位于/home/lightdb/config目录下。根据您的需要修改导出数据库的信息和需要导出的对象,如表、视图、序列等。 7. 执行编译和安装命令。使用以下命令:perl Makefile.PL -l && make && make install 8. 您可以使用以下命令来验证ora2pg是否安装成功:ora2pg --help 请注意,上述步骤是基于离线安装ora2pg的前提下。如果您的服务器没有互联网连接,您需要事先准备好所需的软件和依赖模块。提供了一个离线安装ora2pg的下载链接,并提取码为1qaz。您可以将软件和依赖模块文件下载到服务器上,并按照上述步骤进行安装。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [ora2pg安装和使用](https://blog.csdn.net/enzesheng/article/details/112478016)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *2* [关于docker离线安装,ora2pg镜像导入,以及数据迁移](https://blog.csdn.net/weixin_44031114/article/details/129948848)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值