1. 程式人生 > 其它 >lightdb啟動與停止

lightdb啟動與停止

[zjh@hs-10-20-30-193 ~]$ lt_ctl -D lightdb-x-dev-server/data stop   #停止
waiting for server to shut down............................... done
server stopped

[zjh@hs-10-20-30-193 ~]$ lt_ctl -D lightdb-x-dev-server/data start    # 啟動
waiting for server to start....2022-05-26 06:43:53.407933C  @  postmaster  00000[2022-05
-26 06:43:53 UTC] 0 [167878] LOG: LightDB autoprewarm: prewarm dbnum=0 2022-05-26 06:43:53.408078C @ postmaster 00000[2022-05-26 06:43:53 UTC] 0 [167878] LOG: Auto detecting pg_stat_kcache.linux_hz parameter... 2022-05-26 06:43:53.408093C @ postmaster 00000[2022-05-26 06:43:53 UTC] 0 [167878] LOG: pg_stat_kcache.linux_hz is set to 1000000
2022-05-26 06:43:53.410947C @ postmaster 00000[2022-05-26 06:43:53 UTC] 0 [167878] LOG: pgaudit extension initialized 2022-05-26 06:43:53.617145C @ postmaster 00000[2022-05-26 06:43:53 UTC] 0 [167878] LOG: redirecting log output to logging collector process 2022-05-26 06:43:53.617145C @ postmaster 00000[2022-05-26 06:43:53
UTC] 0 [167878] HINT: Future log output will appear in directory "log". done server started [zjh@hs-10-20-30-193 ~]$ lt_ctl --help lt_ctl is a utility to initialize, start, stop, or control a LightDB server. Usage: lt_ctl init[db] [-D DATADIR] [-s] [-o OPTIONS] lt_ctl start [-D DATADIR] [-l FILENAME] [-W] [-t SECS] [-K KEY-CMD] [-s] [-o OPTIONS] [-p PATH] [-c] lt_ctl stop [-D DATADIR] [-m SHUTDOWN-MODE] [-W] [-t SECS] [-s] lt_ctl restart [-D DATADIR] [-m SHUTDOWN-MODE] [-W] [-t SECS] [-K KEY-CMD] [-s] [-o OPTIONS] [-c] lt_ctl reload [-D DATADIR] [-s] lt_ctl status [-D DATADIR] lt_ctl promote [-D DATADIR] [-W] [-t SECS] [-s] lt_ctl logrotate [-D DATADIR] [-s] lt_ctl kill SIGNALNAME PID Common options: -D, --pgdata=DATADIR location of the database storage area -K, --encryption-key-command command that returns encryption key -s, --silent only print errors, no informational messages -t, --timeout=SECS seconds to wait when using -w option -V, --version output version information, then exit -w, --wait wait until operation completes (default) -W, --no-wait do not wait until operation completes -Y, --SM key file external import SM2/SM4 key file path -?, --help show this help, then exit If the -D option is omitted, the environment variable PGDATA is used. Options for start or restart: -c, --core-files allow lightdb to produce core files -l, --log=FILENAME write (or append) server log to FILENAME -o, --options=OPTIONS command line options to pass to postgres (PostgreSQL server executable) or initdb -p PATH-TO-POSTGRESQL normally not necessary Options for stop or restart: -m, --mode=MODE MODE can be "smart", "fast", or "immediate" Shutdown modes are: smart quit after all clients have disconnected fast quit directly, with proper shutdown (default) immediate quit without complete shutdown; will lead to recovery on restart Allowed signal names for kill: ABRT HUP INT KILL QUIT TERM USR1 USR2 Report bugs to <https://github.com/hslightdb>. LightDB home page: <https://www.hs.net/lightdb> [zjh@hs-10-20-30-193 ~]$ ltsql -Ulightdb ltsql (13.3-22.1) Type "help" for help. lightdb@postgres=# select current_user; current_user -------------- lightdb (1 row) lightdb@postgres=# show %data%; name | setting | description ---------------------+-------------------------+----------------------------------------------------------------- cron.database_name | postgres | Database in which pg_cron metadata is kept. data_checksums | off | Shows whether data checksums are turned on for this cluster. data_directory | /mnt/pmem0/data/data524 | Sets the server's data directory. data_directory_mode | 0700 | Mode of the data directory. data_encryption | off | Shows whether data encryption is turned on for this cluster. data_sync_retry | off | Whether to continue running after a failure to sync data files. (6 rows)

不重啟修改引數

lightdb@postgres=# alter system set data_sync_retry=on;
ALTER SYSTEM
lightdb@postgres=# exit
[zjh@hs-10-20-30-193 ~]$ lt_ctl -D lightdb-x-dev-server/data reload
server signaled
[zjh@hs-10-20-30-193 ~]$