在龙蜥 anolis os 23 上 源码安装 PostgreSQL 16.1

在龙蜥 OS 23上,本来想使用二进制安装,结果发现没有针对龙蜥的列表:

于是想到了源码安装,下面我们列出了PG源码安装的步骤:

1.安装准备

1.1.创建操作系统组及用户

groupadd postgres

useradd -g postgres -m postgres

1.2.建立目录

[root@dbserver1 ~]# mkdir -p /postgresql/{pgdata,pg16,soft}

[root@dbserver1 ~]# chown -R postgres:postgres /postgresql

[root@dbserver1 ~]# chmod -R 775 /postgresql

1.3.下载软件

下载软件

https://ftp.postgresql.org/pub/source/v16.1/postgresql-16.1.tar.gz

PostgreSQL: File Browser

[root@dbserver1 ~]# cd /postgresql/soft

[root@dbserver1 soft]# pwd

/postgresql/soft

[root@dbserver1 soft]# ls -ltr

total 0

[root@dbserver1 soft]# wget https://ftp.postgresql.org/pub/source/v16.1/postgresql-16.1.tar.gz

1.4.安装依赖包

使用yum安装,更简单

yum install -y cmake make gcc zlib zlib-devel gcc-c++ perl readline readline-devel  \

 python36 tcl openssl ncurses-devel openldap pam flex

2.源码安装

2.1.解压

[root@dbserver1 soft]# ls -ltr

total 31676

-rw-r--r--. 1 root root 32433767 Nov  7 06:19 postgresql-16.1.tar.gz

[root@dbserver1 soft]#

[root@dbserver1 soft]# tar xvzf postgresql-16.1.tar.gz

[root@dbserver1 soft]# cd postgresql-16.1/

[root@dbserver1 postgresql-16.1]# pwd

/postgresql/soft/postgresql-16.1

[root@dbserver1 postgresql-16.1]# ls -ltr

total 872

-rw-r--r--.  1 1107 1107   1213 Nov  7 06:04 README

-rw-r--r--.  1 1107 1107   6266 Nov  7 06:04 meson_options.txt

-rw-r--r--.  1 1107 1107   1875 Nov  7 06:04 Makefile

-rw-r--r--.  1 1107 1107    277 Nov  7 06:04 HISTORY

-rw-r--r--.  1 1107 1107   4288 Nov  7 06:04 GNUmakefile.in

-rw-r--r--.  1 1107 1107   1192 Nov  7 06:04 COPYRIGHT

-rw-r--r--.  1 1107 1107  87292 Nov  7 06:04 configure.ac

-rwxr-xr-x.  1 1107 1107 584560 Nov  7 06:04 configure

-rw-r--r--.  1 1107 1107    365 Nov  7 06:04 aclocal.m4

-rw-r--r--.  1 1107 1107 102017 Nov  7 06:17 meson.build

drwxrwxrwx. 61 1107 1107   4096 Nov  7 06:17 contrib

drwxrwxrwx.  2 1107 1107   4096 Nov  7 06:17 config

drwxrwxrwx.  3 1107 1107     87 Nov  7 06:17 doc

-rw-r--r--.  1 1107 1107  64601 Nov  7 06:18 INSTALL

drwxrwxrwx. 16 1107 1107   4096 Nov  7 06:18 src

[root@dbserver1 postgresql-16.1]#

2.2 配置

[root@dbserver1 postgresql-16.1]# ./configure --prefix=/postgresql/pg16

-------------------------------------------------------------------------------

[root@dbserver1 postgresql-16.1]# ./configure --prefix=/postgresql/pg16

checking build system type... x86_64-pc-linux-gnu

checking host system type... x86_64-pc-linux-gnu

checking which template to use... linux

checking whether NLS is wanted... no

checking for default port number... 5432

checking for block size... 8kB

checking for segment size... 1GB

checking for WAL block size... 8kB

checking for gcc... gcc

checking whether the C compiler works... yes

checking for C compiler default output file name... a.out

checking for suffix of executables...

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking for gcc option to accept ISO C89... none needed

checking for gcc option to accept ISO C99... none needed

checking for g++... g++

checking whether we are using the GNU C++ compiler... yes

checking whether g++ accepts -g... yes

checking for gawk... gawk

checking whether gcc supports -Wdeclaration-after-statement, for CFLAGS... yes

checking whether gcc supports -Werror=vla, for CFLAGS... yes

checking whether gcc supports -Werror=unguarded-availability-new, for CFLAGS... no

checking whether g++ supports -Werror=unguarded-availability-new, for CXXFLAGS... no

checking whether gcc supports -Wendif-labels, for CFLAGS... yes

checking whether g++ supports -Wendif-labels, for CXXFLAGS... yes

checking whether gcc supports -Wmissing-format-attribute, for CFLAGS... yes

checking whether g++ supports -Wmissing-format-attribute, for CXXFLAGS... yes

checking whether gcc supports -Wimplicit-fallthrough=3, for CFLAGS... yes

checking whether g++ supports -Wimplicit-fallthrough=3, for CXXFLAGS... yes

checking whether gcc supports -Wcast-function-type, for CFLAGS... yes

checking whether g++ supports -Wcast-function-type, for CXXFLAGS... yes

checking whether gcc supports -Wshadow=compatible-local, for CFLAGS... yes

checking whether g++ supports -Wshadow=compatible-local, for CXXFLAGS... yes

checking whether gcc supports -Wformat-security, for CFLAGS... yes

checking whether g++ supports -Wformat-security, for CXXFLAGS... yes

checking whether gcc supports -fno-strict-aliasing, for CFLAGS... yes

checking whether g++ supports -fno-strict-aliasing, for CXXFLAGS... yes

checking whether gcc supports -fwrapv, for CFLAGS... yes

checking whether g++ supports -fwrapv, for CXXFLAGS... yes

checking whether gcc supports -fexcess-precision=standard, for CFLAGS... yes

checking whether g++ supports -fexcess-precision=standard, for CXXFLAGS... no

checking whether gcc supports -funroll-loops, for CFLAGS_UNROLL_LOOPS... yes

checking whether gcc supports -ftree-vectorize, for CFLAGS_VECTORIZE... yes

checking whether gcc supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... no

checking whether gcc supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... no

checking whether gcc supports -Wformat-truncation, for NOT_THE_CFLAGS... yes

checking whether gcc supports -Wstringop-truncation, for NOT_THE_CFLAGS... yes

checking whether gcc supports -Wcast-function-type-strict, for NOT_THE_CFLAGS... no

checking whether gcc supports -fvisibility=hidden, for CFLAGS_SL_MODULE... yes

checking whether g++ supports -fvisibility=hidden, for CXXFLAGS_SL_MODULE... yes

checking whether g++ supports -fvisibility-inlines-hidden, for CXXFLAGS_SL_MODULE... yes

checking whether the C compiler still works... yes

checking how to run the C preprocessor... gcc -E

checking for pkg-config... /usr/bin/pkg-config

checking pkg-config is at least version 0.9.0... yes

checking allow thread-safe client libraries... yes

checking whether to build with ICU support... yes

checking for icu-uc icu-i18n... yes

checking whether to build with Tcl... no

checking whether to build Perl modules... no

checking whether to build Python modules... no

checking whether to build with GSSAPI support... no

checking whether to build with PAM support... no

checking whether to build with BSD Authentication support... no

checking whether to build with LDAP support... no

checking whether to build with Bonjour support... no

checking whether to build with SELinux support... no

checking whether to build with systemd support... no

checking whether to build with XML support... no

checking whether to build with LZ4 support... no

checking whether to build with ZSTD support... no

checking for strip... strip

checking whether it is possible to strip libraries... yes

checking for ar... ar

checking for a BSD-compatible install... /usr/bin/install -c

checking for tar... /usr/bin/tar

checking whether ln -s works... yes

checking for a thread-safe mkdir -p... /usr/bin/mkdir -p

checking for bison... no

configure: WARNING:

*** Without Bison you will not be able to build PostgreSQL from Git nor

*** change any of the parser definition files.  You can obtain Bison from

*** a GNU mirror site.  (If you are using the official distribution of

*** PostgreSQL then you do not need to worry about this, because the Bison

*** output is pre-generated.)

checking for flex... /usr/bin/flex

configure: using flex 2.6.4

checking for perl... /usr/bin/perl

configure: using perl 5.36.0

checking for a sed that does not truncate output... /usr/bin/sed

checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking for ANSI C header files... yes

checking for sys/types.h... yes

checking for sys/stat.h... yes

checking for stdlib.h... yes

checking for string.h... yes

checking for memory.h... yes

checking for strings.h... yes

checking for inttypes.h... yes

checking for stdint.h... yes

checking for unistd.h... yes

checking whether gcc is Clang... no

checking whether pthreads work with -pthread... yes

checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE

checking whether more special flags are required for pthreads... no

checking for PTHREAD_PRIO_INHERIT... yes

checking pthread.h usability... yes

checking pthread.h presence... yes

checking for pthread.h... yes

checking for strerror_r... yes

checking whether strerror_r returns int... no

checking for main in -lm... yes

checking for library containing setproctitle... no

checking for library containing dlsym... none required

checking for library containing socket... none required

checking for library containing getopt_long... none required

checking for library containing shm_open... none required

checking for library containing shm_unlink... none required

checking for library containing clock_gettime... none required

checking for library containing fdatasync... none required

checking for library containing shmget... none required

checking for library containing backtrace_symbols... none required

checking for library containing pthread_barrier_wait... none required

checking for library containing readline... -lreadline

checking for inflate in -lz... yes

checking for stdbool.h that conforms to C99... yes

checking for _Bool... yes

checking atomic.h usability... no

checking atomic.h presence... no

checking for atomic.h... no

checking copyfile.h usability... no

checking copyfile.h presence... no

checking for copyfile.h... no

checking execinfo.h usability... yes

checking execinfo.h presence... yes

checking for execinfo.h... yes

checking getopt.h usability... yes

checking getopt.h presence... yes

checking for getopt.h... yes

checking ifaddrs.h usability... yes

checking ifaddrs.h presence... yes

checking for ifaddrs.h... yes

checking langinfo.h usability... yes

checking langinfo.h presence... yes

checking for langinfo.h... yes

checking mbarrier.h usability... no

checking mbarrier.h presence... no

checking for mbarrier.h... no

checking sys/epoll.h usability... yes

checking sys/epoll.h presence... yes

checking for sys/epoll.h... yes

checking sys/event.h usability... no

checking sys/event.h presence... no

checking for sys/event.h... no

checking sys/personality.h usability... yes

checking sys/personality.h presence... yes

checking for sys/personality.h... yes

checking sys/prctl.h usability... yes

checking sys/prctl.h presence... yes

checking for sys/prctl.h... yes

checking sys/procctl.h usability... no

checking sys/procctl.h presence... no

checking for sys/procctl.h... no

checking sys/signalfd.h usability... yes

checking sys/signalfd.h presence... yes

checking for sys/signalfd.h... yes

checking sys/ucred.h usability... no

checking sys/ucred.h presence... no

checking for sys/ucred.h... no

checking termios.h usability... yes

checking termios.h presence... yes

checking for termios.h... yes

checking ucred.h usability... no

checking ucred.h presence... no

checking for ucred.h... no

checking readline/readline.h usability... yes

checking readline/readline.h presence... yes

checking for readline/readline.h... yes

checking readline/history.h usability... yes

checking readline/history.h presence... yes

checking for readline/history.h... yes

checking zlib.h usability... yes

checking zlib.h presence... yes

checking for zlib.h... yes

checking for lz4... no

checking for zstd... /usr/bin/zstd

checking for openssl... /usr/bin/openssl

configure: using openssl: OpenSSL 3.0.12 24 Oct 2023 (Library: OpenSSL 3.0.12 24 Oct 2023)

checking whether byte ordering is bigendian... no

checking for inline... inline

checking for printf format archetype... gnu_printf

checking for _Static_assert... yes

checking for typeof... typeof

checking for __builtin_types_compatible_p... yes

checking for __builtin_constant_p... yes

checking for __builtin_unreachable... yes

checking for computed goto support... yes

checking for struct tm.tm_zone... yes

checking for union semun... no

checking for socklen_t... yes

checking for struct sockaddr.sa_len... no

checking for locale_t... yes

checking for C/C++ restrict keyword... __restrict

checking for struct option... yes

checking for z_streamp... yes

checking whether assembler supports x86_64 popcntq... yes

checking for special C compiler options needed for large files... no

checking for _FILE_OFFSET_BITS value needed for large files... no

checking size of off_t... 8

checking size of bool... 1

checking for int timezone... yes

checking for wcstombs_l declaration... no

checking for backtrace_symbols... yes

checking for copyfile... no

checking for getifaddrs... yes

checking for getpeerucred... no

checking for inet_pton... yes

checking for kqueue... no

checking for mbstowcs_l... no

checking for memset_s... no

checking for posix_fallocate... yes

checking for ppoll... yes

checking for pthread_is_threaded_np... no

checking for setproctitle... no

checking for setproctitle_fast... no

checking for strchrnul... yes

checking for strsignal... yes

checking for syncfs... yes

checking for sync_file_range... yes

checking for uselocale... yes

checking for wcstombs_l... no

checking for __builtin_bswap16... yes

checking for __builtin_bswap32... yes

checking for __builtin_bswap64... yes

checking for __builtin_clz... yes

checking for __builtin_ctz... yes

checking for __builtin_popcount... yes

checking for __builtin_frame_address... yes

checking for _LARGEFILE_SOURCE value needed for large files... no

checking how gcc reports undeclared, standard C functions... error

checking for posix_fadvise... yes

checking whether posix_fadvise is declared... yes

checking whether fdatasync is declared... yes

checking whether strlcat is declared... no

checking whether strlcpy is declared... no

checking whether strnlen is declared... yes

checking whether preadv is declared... yes

checking whether pwritev is declared... yes

checking whether F_FULLFSYNC is declared... no

checking for explicit_bzero... yes

checking for getopt... yes

checking for getpeereid... no

checking for inet_aton... yes

checking for mkdtemp... yes

checking for strlcat... no

checking for strlcpy... no

checking for strnlen... yes

checking for pthread_barrier_wait... yes

checking for getopt_long... yes

checking for syslog... yes

checking syslog.h usability... yes

checking syslog.h presence... yes

checking for syslog.h... yes

checking for opterr... yes

checking for optreset... no

checking unicode/ucol.h usability... yes

checking unicode/ucol.h presence... yes

checking for unicode/ucol.h... yes

checking for rl_completion_suppress_quote... yes

checking for rl_filename_quote_characters... yes

checking for rl_filename_quoting_function... yes

checking for append_history... yes

checking for history_truncate_file... yes

checking for rl_completion_matches... yes

checking for rl_filename_completion_function... yes

checking for rl_reset_screen_size... yes

checking for rl_variable_bind... yes

checking test program... ok

checking whether long int is 64 bits... yes

checking for __builtin_mul_overflow... yes

checking size of void *... 8

checking size of size_t... 8

checking size of long... 8

checking alignment of short... 2

checking alignment of int... 4

checking alignment of long... 8

checking alignment of double... 8

checking for int8... no

checking for uint8... no

checking for int64... no

checking for uint64... no

checking for __int128... yes

checking for __int128 alignment bug... ok

checking alignment of PG_INT128_TYPE... 16

checking for builtin __sync char locking functions... yes

checking for builtin __sync int32 locking functions... yes

checking for builtin __sync int32 atomic operations... yes

checking for builtin __sync int64 atomic operations... yes

checking for builtin __atomic int32 atomic operations... yes

checking for builtin __atomic int64 atomic operations... yes

checking for __get_cpuid... yes

checking for __cpuid... no

checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=... yes

checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=... no

checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc... no

checking which CRC-32C implementation to use... SSE 4.2

checking for library containing sem_init... none required

checking which semaphore API to use... unnamed POSIX

checking which random number source to use... /dev/urandom

checking for /dev/urandom... yes

checking for xmllint... /usr/bin/xmllint

checking for xsltproc... /usr/bin/xsltproc

checking for fop... no

checking for dbtoepub... no

checking whether gcc supports -Wl,--as-needed, for LDFLAGS... yes

checking whether gcc supports -Wl,--export-dynamic, for LDFLAGS_EX_BE... yes

configure: using compiler=gcc (GCC) 12.2.1 20221121 (Anolis OS 12.2.1-2)

configure: using CFLAGS=-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2

configure: using CPPFLAGS= -D_GNU_SOURCE

configure: using LDFLAGS=  -Wl,--as-needed

configure: creating ./config.status

config.status: creating GNUmakefile

config.status: creating src/Makefile.global

config.status: creating src/include/pg_config.h

config.status: creating src/include/pg_config_ext.h

config.status: creating src/interfaces/ecpg/include/ecpg_config.h

config.status: linking src/backend/port/tas/dummy.s to src/backend/port/tas.s

config.status: linking src/backend/port/posix_sema.c to src/backend/port/pg_sema.c

config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c

config.status: linking src/include/port/linux.h to src/include/pg_config_os.h

config.status: linking src/makefiles/Makefile.linux to src/Makefile.port

-------------------------------------------------------------------------------

2.3 编译

make

make install

3.创建数据库

3.1 配置环境变量

su – postgres

cat >>  ~/.bash_profile <<"EOF"

export PGPORT=5432

export PGDATA=/postgresql/pgdata

export PGHOME=/postgresql/pg16

export LD_LIBRARY_PATH=$PGHOME/lib:$LD_LIBRARY_PATH

export PATH=$PGHOME/bin:$PATH:.

export PGHOST=$PGDATA

export PGUSER=postgres

export PGDATABASE=postgres

export PGCLIENTENCODING=GBK

EOF

3.2 .安装语言包

[root@dbserver1 postgresql-16.1]# yum install glibc-common langpacks-zh_CN glibc-langpack-zh glibc-locale-source

3.3 .支持中文

修改/etc/locale.conf配置

 原配置:    LANG="en_US.UTF-8"

修改为:    LANG="zh_CN.UTF-8"

输入:      source /etc/locale.conf

3.4. 初始化

[postgres@dbserver1 ~]$ export LANG=zh_CN.gbk

[postgres@dbserver1 ~]$ /postgresql/pg16/bin/initdb -D /postgresql/pgdata -E UTF8 --locale=zh_CN.UTF8 -U postgres

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.

The database cluster will be initialized with locale "zh_CN.UTF8".

initdb: could not find suitable text search configuration for locale "zh_CN.UTF8"

The default text search configuration will be set to "simple".

Data page checksums are disabled.

fixing permissions on existing directory /postgresql/pgdata ... 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 ... ok

performing post-bootstrap initialization ... ok

syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections

initdb: hint: 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:

    /postgresql/pg16/bin/pg_ctl -D /postgresql/pgdata -l logfile start

[postgres@dbserver1 ~]$

4.调整参数

4.1 修改数据库基本参数

cat >> /postgresql/pgdata/postgresql.conf << "EOF"

listen_addresses = '*'

port=5432

unix_socket_directories='/postgresql/pgdata'

logging_collector = on

log_directory = 'pg_log'

log_filename = 'postgresql-%a.log'

log_truncate_on_rotation = on

max_connections = 500

shared_buffers = 2GB

EOF

4.2 开放远程访问

cat >> /postgresql/pgdata/pg_hba.conf << "EOF"

# TYPE  DATABASE    USER    ADDRESS       METHOD

host      all       all    0.0.0.0/0        md5

EOF

5.设置服务

5.1 配置系统服务

cat > /etc/systemd/system/PG16.service <<"EOF"

[Unit]

Description=PostgreSQL database server

Documentation=man:postgres(1)

After=network.target

[Service]

Type=forking

User=postgres

Group=postgres

Environment=PGPORT=5432

Environment=PGDATA=/postgresql/pgdata

OOMScoreAdjust=-1000

ExecStart=/postgresql/pg16/bin/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300

ExecStop=/postgresql/pg16/bin/pg_ctl stop -D ${PGDATA} -s -m fast

ExecReload=/postgresql/pg16/bin/pg_ctl reload -D ${PGDATA} -s

KillMode=mixed

KillSignal=SIGINT

TimeoutSec=0

[Install]

WantedBy=multi-user.target

EOF

5.2 加载PG16服务

systemctl daemon-reload

[root@dbserver1 postgresql-16.1]# systemctl daemon-reload

[root@dbserver1 postgresql-16.1]#

5.3 配置自动启动PG

[root@dbserver1 postgresql-16.1]#

[root@dbserver1 postgresql-16.1]# systemctl enable PG16

Created symlink /etc/systemd/system/multi-user.target.wants/PG16.service → /etc/systemd/system/PG16.service.

6. 启动PG

6.1 通过服务方式去启动PG

[root@dbserver1 postgresql-16.1]# systemctl start PG16.service

6.2 确认PG服务

[root@dbserver1 postgresql-16.1]# systemctl status PG16.service

● PG16.service - PostgreSQL database server

     Loaded: loaded (/etc/systemd/system/PG16.service; enabled; preset: disabled)

     Active: active (running) since Mon 2023-11-27 23:45:37 CST; 2s ago

       Docs: man:postgres(1)

    Process: 88748 ExecStart=/postgresql/pg16/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=0/SUCCESS)

   Main PID: 88750 (postgres)

      Tasks: 7 (limit: 9227)

     Memory: 77.4M

        CPU: 122ms

     CGroup: /system.slice/PG16.service

             ├─88750 /postgresql/pg16/bin/postgres -D /postgresql/pgdata -p 5432

             ├─88751 "postgres: logger "

             ├─88752 "postgres: checkpointer "

             ├─88753 "postgres: background writer "

             ├─88755 "postgres: walwriter "

             ├─88756 "postgres: autovacuum launcher "

             └─88757 "postgres: logical replication launcher "

11月 27 23:45:37 dbserver1 systemd[1]: Starting PG16.service - PostgreSQL database server...

11月 27 23:45:37 dbserver1 pg_ctl[88750]: 2023-11-27 23:45:37.799 CST [88750] LOG:  redirecting log output to logging collector process

11月 27 23:45:37 dbserver1 pg_ctl[88750]: 2023-11-27 23:45:37.799 CST [88750] HINT:  Future log output will appear in directory "pg_log".

11月 27 23:45:37 dbserver1 systemd[1]: Started PG16.service - PostgreSQL database server.

7.验证PG

登录PG

[postgres@dbserver1 ~]$ psql -U postgres

psql (16.1)

Type "help" for help.

postgres=#

到此,PG16 源码安装全部执行完。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/175073.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

10、静态数码管显示

数码管介绍 LED数码管:是一种简单、廉价的显示器&#xff0c;是由多个发光二极管封装在一起组成“8”字型的器件 数码管引脚的定义 共阴极、共阳极 例如&#xff1a;显示数字1&#xff08;b,c段&#xff09; 3、8&#xff1a;接VCC或者GND/低电平 10011111 0110000 共阴极、…

Vue框架学习笔记——条件渲染:v-show和v-if

文章目录 前文提要条件渲染v-showv-ifv-else-if和v-else特殊写法&#xff0c;很多个一致的v-if如何消除 总结 前文提要 本人仅做个人学习记录&#xff0c;如有错误&#xff0c;请多包涵 主要学习链接&#xff1a;尚硅谷Vue2.0Vue3.0全套教程丨vuejs从入门到精通 条件渲染 条…

百度人工智能培训第一天笔记

参加了百度人工智能初步培训&#xff0c;主要是了解一下现在人工智能的基本情况&#xff0c;以便后续看可以参与一些啥&#xff1f; 下面就有关培训做一些记录&#xff0c;以便后续可以继续学习。 一、理论基础部分 二、实际操作部分 主要学习的百度人工智能平台如下&#xf…

蓝桥杯-平方和(599)

【题目】平方和 【通过测试】代码 import java.util.Scanner; import java.util.ArrayList; import java.util.List; // 1:无需package // 2: 类名必须Main, 不可修改public class Main {public static void main(String[] args) {Scanner scan new Scanner(System.in);//在此…

利用STM32和蓝牙模块构建智能物联网设备的开发指南

智能物联网设备在现代生活中扮演着重要的角色&#xff0c;而STM32微控制器和蓝牙模块则为实现智能物联网设备提供了基础支持。本文将介绍如何使用STM32微控制器和蓝牙模块构建智能物联网设备的开发指南&#xff0c;包括硬件设计、蓝牙模块配置、传感器数据采集和云平台连接等关…

Uni-app智慧工地可视化信息云平台源码

智慧工地的核心是数字化&#xff0c;它通过传感器、监控设备、智能终端等技术手段&#xff0c;实现对工地各个环节的实时数据采集和传输&#xff0c;如环境温度、湿度、噪音等数据信息&#xff0c;将数据汇集到云端进行处理和分析&#xff0c;生成各种报表、图表和预警信息&…

数据可视化:在Jupyter中使用Matplotlib绘制常用图表

Matplotlib是一个强大的数据可视化库&#xff0c;用于创建各种图表。 在Jupyter中使用Matplotlib可以轻松实现折线图、柱状图、散点图和饼图等常用图表。 本篇文章将为你详细讲解用matlpotlib绘制常用图表的方法。 1、折线图 折线图是展示数据趋势和变化的常见图表类型。 …

设计问卷调查问题的技巧二:确定问题的结构与顺序

上篇文章中&#xff0c;我们了解到设计问卷调查问卷的技巧有保持问题中立、少用开放式问题、保持全名平衡的答案集、谨慎设置单一回答。在这篇文章中&#xff0c;我们将继续深入探讨设计问卷调查问题的剩余5大技巧&#xff01; Tip5&#xff1a;注意问题的顺序 虽然您可以任意…

【Linux】 file命令使用

file命令 file命令用于辨识文件类型。 语法 file [参数] [文件名] who命令 -Linux手册页 命令选项及作用 执行令 file --help 执行命令结果 参数 -b  列出辨识结果时&#xff0c;不显示文件名称&#xff1b;-i&#xff1a;显示MIME类型&#xff1b;-z&#xff1a;对…

Linux 栈回溯

目录 前言一、什么是栈回溯&#xff1f;二、栈回溯的实现原理三、参考阅读 前言 日常工作中&#xff0c;我们在开发软件程序时&#xff0c;经常会遇到程序奔溃的问题&#xff0c;导致程序奔溃的原因有很多&#xff0c;我们一般都是定位到相关代码&#xff0c;再去查询具体原因。…

C# 使用PanGu分词

写在前面 这是官方介绍&#xff1a;盘古分词是一个中英文分词组件。作者eaglet 曾经开发过KTDictSeg 中文分词组件&#xff0c;拥有大量用户。作者基于之前分词组件的开发经验&#xff0c;结合最新的开发技术重新编写了盘古分词组件。 盘古分词组件需要配合其字典文件使用&am…

虚幻学习笔记—文本内容处理

一、前言 本文使用的虚幻引擎5.3.2&#xff0c;在虚幻中已经集成了很多可以直接处理多样化文本的蓝图&#xff0c;比如格式化动态显示、浮点数多样化等。 二、实现 2.1、格式化文本显示动态内容&#xff1a;在设置某个文本时可以使用“Format Text”蓝图设置自定义可以的显示…

1.6锁的升级过程

一、偏向锁 轻量级锁 当有新的线程进来时 其实就是竞争不激烈&#xff0c;但是确实存在多个锁竞争的情况&#xff0c;而且是&#xff0c;大家都很有序的进行&#xff0c;一释放&#xff0c;下一个线程就拿到锁&#xff0c;很有顺序的获取锁&#xff0c;基本上通过自旋的方式代…

一、Oceanbase基础

一、集群相关概念 集群&#xff1a;整个分布式数据库。Region&#xff1a;表示区域&#xff0c;是地域的逻辑概念&#xff0c;如1个城市&#xff0c;1个集群可以有多个Region&#xff0c;用于跨城市远 距离容灾。Zone&#xff1a;表示分区&#xff0c;是机房或机架的逻辑概念…

Git指定分支或文件回退到指定版本

文章目录 一、分支回滚1.1、使用 git reset 命令1.2、使用 git revert 命令1.3、使用 git checkout 命令 二、文件回滚2.1、回滚未提交文件2.2、回滚已提交文件2.2.1、首先查看文件的历史版本2.2.2、找到你想要还原的版本2.2.3、将文件还原到你想要还原的版本2.2.4、提交代码 三…

Scrapy爬虫异步框架之持久化存储(一篇文章齐全)

1、Scrapy框架初识&#xff08;点击前往查阅&#xff09; 2、Scrapy框架持久化存储 3、Scrapy框架内置管道&#xff08;点击前往查阅&#xff09; 4、Scrapy框架中间件&#xff08;点击前往查阅&#xff09; Scrapy 是一个开源的、基于Python的爬虫框架&#xff0c;它提供了…

Android应用程序开发实战篇----期末总结1

项目1&#xff08;了解移动电子商务开发&#xff09; 1,任务一&#xff1a;了解移动电子商务 移动电子商务&#xff1a;利用无线终端进行的电子商务活动。 移动电子商务的特点&#xff1a;方便&#xff0c;摆脱时空性&#xff0c;安全&#xff0c;潜在用户规模大&#xff0c;…

vue day2

1、指令修饰符&#xff1a;.指明一些指令后缀&#xff0c;不同后缀封装不同处理操作 按键修饰符&#xff1a;keyup.enter v-model修饰符&#xff1a; v-model.trim&#xff1a;去首位空格 v-model.number&#xff1a;转数字 事件修饰符&#xff1a; 阻止事件冒泡&#xff1…

新版idea如何开启多台JVM虚拟机

1.看看自己的项目 2.可能开始的时候啥也没有&#xff0c;就点Run Configuration Type 3.再点击Edit Configurations... 4.点击号添加SpringBoot 5.主类选择一下&#xff0c;一般就一个&#xff0c;点他选了就行。 6.然后点击Modify Options 选择添加add VM Options 7.点击appl…

云服务器哪家便宜?亚马逊AWS等免费云服务器推荐

在这数字化的时代&#xff0c;云计算技术越来越广泛应用于各种场景&#xff0c;尤其是云服务器&#xff0c;作为一种全新的服务器架构正在逐渐取代传统的物理服务器&#xff0c;“云服务器哪家便宜”等用户相关问题也受到越来越多的关注。自从亚马逊最早推出了首个云计算服务—…