1. 自动安装
(1)执行脚本(lightdb用户执行)
./LightDB-X13.3-21.1-el7.x86_64.bin install
(2)选择是否安装LightDB,默认Y,如果n/N,不安装。
Do you want to install LightDB?[Y/N]:Y
(3)创建LightDB用户及LightDB用户组,如果存在则无需创建
Do you need to add user 'lightdb' and group 'lightdb'?[Y/N]:Y
(4)选择要安装的目录,默认/home/lightdb目录(lightdb用户 $HOME目录)
Which directory do you want to install to? [/home/lightdb]:
Install to directory '/home/lightdb'?[Y/N]:
lightdb install path is: '/home/lightdb/lightdb13.3-21.1'
lightdb bin directory is: '/home/lightdb/lightdb13.3-21.1/lightdb-x/bin'
Install db ...
lightdb_after_install.sh is not exists,now set environment
configuring environment variable of lightdb ... config path done
configuring lib environment variable of lightdb ... config libpath done
(5)选择是否创建默认实例。默认y,会在安装目录data目录创建defaultCluster实例,如果n/N,不创建启动实例,安装结束(注意创建的实例 会根据用户的机器,动态计算和修改postgresql.conf文件相关配置,以提升性能)
lightdb installed success,next step to init default instance,Do you want to create default cluster?[Y/N]:Y
Now configure instance parameters ...
INFO modify effective_cache_size successfully
INFO modify wal_buffers successfully
INFO modify max_wal_size successfully
INFO modify min_wal_size successfully
INFO modify random_page_cost successfully
INFO modify max_parallel_maintenance_workers successfully
INFO modify default_statistics_target successfully
INFO modify min_parallel_index_scan_size successfully
INFO modify max_worker_processes successfully
INFO modify auto_explain.log_min_duration successfully
INFO modify max_parallel_workers successfully
INFO modify logging_collector successfully
INFO modify enable_partitionwise_aggregate successfully
INFO modify log_min_duration_statement successfully
INFO modify shared_buffers successfully
INFO modify pgpool.pg_ctl successfully
INFO modify parallel_setup_cost successfully
INFO modify track_io_timing successfully
INFO modify log_min_messages successfully
INFO modify temp_buffers successfully
INFO modify commit_siblings successfully
INFO modify min_parallel_table_scan_size successfully
(6)需要注意创建的默认实例,会生成随机密码,在安装时会高亮提示,需要记下来
init default instance sucess,We will start this install by default port 5432,please remember your password RuiIajfPbz
(7)实例创建成功后,以5432端口默认启动。 默认license90天
waiting for server to start....
The license will expire in 89 days.
2021-08-13 12:02:46.007 CST @ postmaster 00000[2021-08-13 12:02:46 CST] 0 [8860] LOG: pgaudit extension initialized
2021-08-13 12:02:46.102 CST @ postmaster 00000[2021-08-13 12:02:46 CST] 0 [8860] LOG: redirecting log output to logging collector process
2021-08-13 12:02:46.102 CST @ postmaster 00000[2021-08-13 12:02:46 CST] 0 [8860] HINT: Future log output will appear in directory "log".
done
server started
(8)安装结束
LightDB install finish,welcome to use LightDB
2. 安装后操作
2.1 环境变量
vim ~/.bashrc
PATH=安装根目录/lightdb-x/bin:$PATH export PATH
LD_LIBRARY_PATH=安装根目录/lightdb-x/lib:$PATH export LD_LIBRARY_PATH
例如:
PATH=/home/lightdb/lightdb13.3-21.1/lightdb-x/bin:$PATH export PATH
LD_LIBRARY_PATH=/home/lightdb/lightdb13.3-21.1/lightdb-x/lib:$PATH export LD_LIBRARY_PATH
2.2 测试实例
# 使用lightdb 用户登录
su – lightdb
# 连接默认创建实例(记住4.2创建实例时的密码)
ltsql -d postgres -U lightdb -h 192.168.10.110 -p 5432
[lightdb@localhost lightdb-x]$ ltsql -d postgres -U lightdb -h 192.168.10.110 -p 5432 Password for user lightdb:
ltsql (13.3)
Type "help" for help.
postgres=# \d
List of relations
Schema | Name | Type | Owner
-------+------+------+---------
public | baselines | table | lightd
2.3 修改数据库参数
# 实例目录下,修改postgresql.conf配置文件里面需要修改的参数
# 例如,要修改端口
(1)进入实例目录
cd /home/lightdb/lightdb13.3-21.1/data/defaultCluster/
(2)修改端口,找到关键字port 格式: 参数名 = 参数值
#port = 5432 # (change requires restart) (3)修改为5433
port = 5433
(4)修改后重启实例生效
# lt_ctl –D 实例路径 restart,例如:
lt_ctl –D /home/lightdb/lightdb13.3-21.1/data/defaultCluster restart
2.3修改数据库参数
# 实例目录下,修改pg_hba.conf配置文件,格式如下
# TYPE DATABASE USER ADDRESS METHOD
host all all 127.0.0.1/32 trust
# 例如:给当前安装后默认创建的实例添加所有远程主机访问权限
echo "host all all 0.0.0.0/0 md5">>/home/lightdb/lightdb13.3-
21.1/data/defaultCluster/pg_hba.conf
本文节选自《LightDB数据库安装手册》
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




