lightdb实例初始化
[lightdb@hs-10-20-30-199 ~]$ lt_initdb -p9876 -D lightdb22.1-data The files belonging to this database system will be owned by user "lightdb". 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". initdb: warning: specified text search configuration "simple" might not match locale "C" The default text search configuration will be set to "simple". Data page checksums are disabled. Data encryption is disabled. creating directory lightdb22.1-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 ... Asia/Shanghai creating configuration files ... ok running bootstrap script ... 2022-05-26 14:56:17.842069T @ not initialized 00000[2022-05-26 14:56:17 CST] 0 [259431] LOG: checkpoint starting: shutdown immediate 2022-05-26 14:56:17.843277T @ not initialized 00000[2022-05-26 14:56:17 CST] 0 [259431] LOG: checkpoint complete: wrote 211 buffers (1.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.002 s, sync=0.001 s, total=0.002 s; sync files=0, longest=0.000 s, average=0.000 s; distance=725 kB, estimate=725 kB ok performing post-bootstrap initialization ... 2022-05-26 14:56:18.173448T @ not initialized 00000[2022-05-26 14:56:17 CST] 480 [259445] LOG: checkpoint starting: immediate force wait flush-all 2022-05-26 14:56:18.173448T @ not initialized 00000[2022-05-26 14:56:17 CST] 480 [259445] STATEMENT: CREATE DATABASE template0 IS_TEMPLATE = true ALLOW_CONNECTIONS = false; 2022-05-26 14:56:18.178813T @ not initialized 00000[2022-05-26 14:56:17 CST] 480 [259445] LOG: checkpoint complete: wrote 845 buffers (5.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.005 s, sync=0.001 s, total=0.006 s; sync files=0, longest=0.000 s, average=0.000 s; distance=7606 kB, estimate=7606 kB 2022-05-26 14:56:18.178813T @ not initialized 00000[2022-05-26 14:56:17 CST] 480 [259445] STATEMENT: CREATE DATABASE template0 IS_TEMPLATE = true ALLOW_CONNECTIONS = false; 2022-05-26 14:56:18.190468T @ not initialized 00000[2022-05-26 14:56:17 CST] 480 [259445] LOG: checkpoint starting: immediate force wait 2022-05-26 14:56:18.190468T @ not initialized 00000[2022-05-26 14:56:17 CST] 480 [259445] STATEMENT: CREATE DATABASE template0 IS_TEMPLATE = true ALLOW_CONNECTIONS = false; 2022-05-26 14:56:18.191312T @ not initialized 00000[2022-05-26 14:56:17 CST] 480 [259445] LOG: checkpoint complete: wrote 0 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.000 s, total=0.001 s; sync files=0, longest=0.000 s, average=0.000 s; distance=0 kB, estimate=6845 kB 2022-05-26 14:56:18.191312T @ not initialized 00000[2022-05-26 14:56:17 CST] 480 [259445] STATEMENT: CREATE DATABASE template0 IS_TEMPLATE = true ALLOW_CONNECTIONS = false; 2022-05-26 14:56:18.191902T @ not initialized 00000[2022-05-26 14:56:17 CST] 485 [259445] LOG: checkpoint starting: immediate force wait flush-all 2022-05-26 14:56:18.191902T @ not initialized 00000[2022-05-26 14:56:17 CST] 485 [259445] STATEMENT: CREATE DATABASE postgres; 2022-05-26 14:56:18.192810T @ not initialized 00000[2022-05-26 14:56:17 CST] 485 [259445] LOG: checkpoint complete: wrote 11 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.001 s, total=0.001 s; sync files=0, longest=0.000 s, average=0.000 s; distance=42 kB, estimate=6165 kB 2022-05-26 14:56:18.192810T @ not initialized 00000[2022-05-26 14:56:17 CST] 485 [259445] STATEMENT: CREATE DATABASE postgres; 2022-05-26 14:56:18.202844T @ not initialized 00000[2022-05-26 14:56:17 CST] 485 [259445] LOG: checkpoint starting: immediate force wait 2022-05-26 14:56:18.202844T @ not initialized 00000[2022-05-26 14:56:17 CST] 485 [259445] STATEMENT: CREATE DATABASE postgres; 2022-05-26 14:56:18.203554T @ not initialized 00000[2022-05-26 14:56:17 CST] 485 [259445] LOG: checkpoint complete: wrote 0 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.000 s, total=0.001 s; sync files=0, longest=0.000 s, average=0.000 s; distance=0 kB, estimate=5549 kB 2022-05-26 14:56:18.203554T @ not initialized 00000[2022-05-26 14:56:17 CST] 485 [259445] STATEMENT: CREATE DATABASE postgres; 2022-05-26 14:56:18.203657T @ not initialized 00000[2022-05-26 14:56:17 CST] 0 [259445] LOG: checkpoint starting: shutdown immediate 2022-05-26 14:56:18.203954T @ not initialized 00000[2022-05-26 14:56:17 CST] 0 [259445] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.000 s, total=0.001 s; sync files=0, longest=0.000 s, average=0.000 s; distance=1 kB, estimate=4994 kB ok syncing data to disk ... ok initdb: warning: enabling "trust" authentication for local connections You can change this by editing pg_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/lightdb/base0524/lightdb-x/13.3-22.1/bin/lt_ctl -D lightdb22.1-data -l logfile start Notice: It is recommended to use lt_initdb, otherwise some functions are unavailable. If you are run initdb directly, you can using like: $PGHOME/scripts/5_lightdb_modify_para.sh $PGHOME $PGDATA OLTP/OLAP shared_buffers(MB) effective_cache_size(MB) $PGPORT $PGHOME/scripts/6_lightdb_start.sh $PGHOME $PGDATA (if not started) $PGHOME/scripts/8_lightdb_create_extension.sh $PGHOME $PGPORT for optimised performance. 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 transform_null_equals successfully INFO modify max_worker_processes successfully INFO modify max_parallel_workers successfully INFO modify logging_collector successfully INFO modify enable_partitionwise_aggregate successfully INFO modify shared_buffers successfully INFO modify pg_stat_statements.track_planning successfully INFO modify bgwriter_lru_maxpages successfully INFO modify max_slot_wal_keep_size successfully INFO modify parallel_setup_cost successfully INFO modify shared_preload_libraries 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 canopy.shard_count successfully INFO modify cron.database_name successfully INFO modify min_parallel_table_scan_size successfully CREATE SCHEMA GRANT CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE TEXT SEARCH CONFIGURATION ALTER TEXT SEARCH CONFIGURATION ALTER TEXT SEARCH DICTIONARY CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE SCHEMA GRANT CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE TEXT SEARCH CONFIGURATION ALTER TEXT SEARCH CONFIGURATION ALTER TEXT SEARCH DICTIONARY CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION CREATE EXTENSION schedule ---------- 1 (1 row) schedule ---------- 2 (1 row) schedule ---------- 3 (1 row) schedule ---------- 4 (1 row) schedule ---------- 5 (1 row) waiting for server to shut down.... done server stopped lt_initdb success
[lightdb@hs-10-20-30-199 ~]$ lt_ctl -D lightdb22.1-data start waiting for server to start....2022-05-26 14:58:12.819141T @ postmaster 00000[2022-05-26 14:58:12 CST] 0 [1040] LOG: LightDB autoprewarm: prewarm dbnum=0 2022-05-26 14:58:12.820401T @ postmaster 00000[2022-05-26 14:58:12 CST] 0 [1040] LOG: pgaudit extension initialized 2022-05-26 14:58:13.542666T @ postmaster 00000[2022-05-26 14:58:12 CST] 0 [1040] LOG: redirecting log output to logging collector process 2022-05-26 14:58:13.542666T @ postmaster 00000[2022-05-26 14:58:12 CST] 0 [1040] HINT: Future log output will appear in directory "log". done server started [lightdb@hs-10-20-30-199 ~]$ ltsql -p9876 ltsql (13.3-22.2) Type "help" for help. lightdb@postgres=# show %port%; name | setting | description ----------------------------------------+---------+------------------------------------------------------- jit_debugging_support | off | Register JIT compiled function with debugger. jit_profiling_support | off | Register JIT compiled function with perf profiler. port | 9876 | Sets the TCP port the server listens on. ssl_passphrase_command_supports_reload | off | Also use ssl_passphrase_command during server reload. (4 rows)
lt_initdb走的是bootstrap模式的postgres进程启动,通过直接读取postgres.bki文件(由genbki.pl在编译的时候生成,虽然维护麻烦了点,但是避免了头文件和初始化数据硬编码两边需要同时维护的麻烦)创建执行SQL所需的所有系统目录,所以创建bki模式的对象不会插入数据字典。
也可以直接创建bki模式的表,只要建表的时候指定bootstrap子句即可。
注:虽然genbki使用pl写的,从pg 9.0 开始官方文档第一次提及,但是在2020年之前,python完全不可和perl比拟,所以你可以认为每个大型系统至今为止选型在当初一定是最佳的,同时当下也还有开发可以维护,否则它就会被替换掉。比如pg16计划替换autoconf。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
2019-05-26 linux signal 处理
2019-05-26 freemarker null异常详解及兼容模式
2019-05-26 蓝绿部署、A/B测试以及灰度发布(金丝雀发布)
2019-05-26 动态BGP与静态BGP
2019-05-26 axios与ajax的区别及中文用户指南
2019-05-26 java poi excel给单元格增加批注(包含SXSSF)及设置列类型
2019-05-26 java图片处理(加水印、生成缩略图)等之Thumbnailator库