docker 安装单机版 opengauss5.0.1

前言

因为官网的镜像直接安装不成功,所以才写的这边文章

1、下载openGauss

地址: https://opengauss.org/zh/download/
下载名称为:openGauss-5.0.1-CentOS-64bit.tar.bz2

1.1、 下载gosu-amd64

下载 gosu-amd64

2、制作镜像(和官网保持一致)

FROM centos:centos7.9.2009
COPY openGauss-5.0.1-CentOS-64bit.tar.bz2 .
COPY gosu-amd64 /usr/local/bin/gosu
ENV LANG en_US.utf8
RUN set -eux; \yum install -y bzip2 bzip2-devel curl libaio&& \groupadd -g 70 omm;  \useradd -u 70 -g omm -d /home/omm omm;  \mkdir -p /var/lib/opengauss && \mkdir -p /usr/local/opengauss && \mkdir -p /var/run/opengauss  && \mkdir /docker-entrypoint-initdb.d && \tar -jxf openGauss-5.0.1-CentOS-64bit.tar.bz2 -C /usr/local/opengauss && \chown -R omm:omm /var/run/opengauss && chown -R omm:omm /usr/local/opengauss && chown -R omm:omm /var/lib/opengauss &&  chown -R omm:omm /docker-entrypoint-initdb.d && \chmod 2777 /var/run/opengauss && \rm -rf openGauss-5.0.1-CentOS-64bit.tar.bz2 && yum clean allRUN set -eux; \echo "export GAUSSHOME=/usr/local/opengauss"  >> /home/omm/.bashrc && \echo "export PATH=\$GAUSSHOME/bin:\$PATH " >> /home/omm/.bashrc && \echo "export LD_LIBRARY_PATH=\$GAUSSHOME/lib:\$LD_LIBRARY_PATH" >> /home/omm/.bashrcENV GOSU_VERSION 1.12
RUN set -eux; \chmod +x /usr/local/bin/gosuENV PGDATA /var/lib/opengauss/dataCOPY entrypoint.sh /usr/local/bin/
RUN chmod 755 /usr/local/bin/entrypoint.sh;ln -s /usr/local/bin/entrypoint.sh / # backwards compatENTRYPOINT ["entrypoint.sh"]EXPOSE 5432
CMD ["gaussdb"]# docker build -t 192.168.0.117:8089/library/single-opengauss:5.0.1 .
# docker push 192.168.0.117:8089/library/single-opengauss:5.0.1

2.1、 二次修改镜像中的 entrypoint.sh 文件

#!/usr/bin/env bash
set -Eeo pipefail# usage: file_env VAR [DEFAULT]
#    ie: file_env 'XYZ_DB_PASSWORD' 'example'
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
#  "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)export GAUSSHOME=/usr/local/opengauss
export PATH=$GAUSSHOME/bin:$PATH
export LD_LIBRARY_PATH=$GAUSSHOME/lib:$LD_LIBRARY_PATHfile_env() {local var="$1"local fileVar="${var}_FILE"local def="${2:-}"if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; thenecho >&2 "error: both $var and $fileVar are set (but are exclusive)"exit 1filocal val="$def"if [ "${!var:-}" ]; thenval="${!var}"elif [ "${!fileVar:-}" ]; thenval="$(< "${!fileVar}")"fiexport "$var"="$val"unset "$fileVar"
}# check to see if this file is being run or sourced from another script
_is_sourced() {[ "${#FUNCNAME[@]}" -ge 2 ] \&& [ "${FUNCNAME[0]}" = '_is_sourced' ] \&& [ "${FUNCNAME[1]}" = 'source' ]
}# used to create initial opengauss directories and if run as root, ensure ownership belong to the omm user
docker_create_db_directories() {local user; user="$(id -u)"mkdir -p "$PGDATA"chmod 700 "$PGDATA"# ignore failure since it will be fine when using the image provided directory;mkdir -p /var/run/opengauss || :chmod 775 /var/run/opengauss || :# Create the transaction log directory before initdb is run so the directory is owned by the correct userif [ -n "$POSTGRES_INITDB_XLOGDIR" ]; thenmkdir -p "$POSTGRES_INITDB_XLOGDIR"if [ "$user" = '0' ]; thenfind "$POSTGRES_INITDB_XLOGDIR" \! -user postgres -exec chown postgres '{}' +fichmod 700 "$POSTGRES_INITDB_XLOGDIR"fi# allow the container to be started with `--user`if [ "$user" = '0' ]; thenfind "$PGDATA" \! -user omm -exec chown omm '{}' +find /var/run/opengauss \! -user omm -exec chown omm '{}' +fi
}# initialize empty PGDATA directory with new database via 'initdb'
# arguments to `initdb` can be passed via POSTGRES_INITDB_ARGS or as arguments to this function
# `initdb` automatically creates the "postgres", "template0", and "template1" dbnames
# this is also where the database user is created, specified by `GS_USER` env
docker_init_database_dir() {# "initdb" is particular about the current user existing in "/etc/passwd", so we use "nss_wrapper" to fake that if necessaryif ! getent passwd "$(id -u)" &> /dev/null && [ -e /usr/lib/libnss_wrapper.so ]; thenexport LD_PRELOAD='/usr/lib/libnss_wrapper.so'export NSS_WRAPPER_PASSWD="$(mktemp)"export NSS_WRAPPER_GROUP="$(mktemp)"echo "postgres:x:$(id -u):$(id -g):PostgreSQL:$PGDATA:/bin/false" > "$NSS_WRAPPER_PASSWD"echo "postgres:x:$(id -g):" > "$NSS_WRAPPER_GROUP"fiif [ -n "$POSTGRES_INITDB_XLOGDIR" ]; thenset -- --xlogdir "$POSTGRES_INITDB_XLOGDIR" "$@"fiif [ -n "$GS_NODENAME" ]; then
#                eval 'gs_initdb --pwfile=<(echo "$GS_PASSWORD") --nodename=$GS_NODENAME '"$POSTGRES_INITDB_ARGS"' "$@"'eval 'gs_initdb --pwfile=<(echo "$GS_PASSWORD") --nodename=$GS_NODENAME -D $PGDATA'else
#                eval 'gs_initdb --pwfile=<(echo "$GS_PASSWORD") --nodename=gaussdb '"$POSTGRES_INITDB_ARGS"' "$@"'eval 'gs_initdb --pwfile=<(echo "$GS_PASSWORD") --nodename=gaussdb -D $PGDATA'fi# unset/cleanup "nss_wrapper" bitsif [ "${LD_PRELOAD:-}" = '/usr/lib/libnss_wrapper.so' ]; thenrm -f "$NSS_WRAPPER_PASSWD" "$NSS_WRAPPER_GROUP"unset LD_PRELOAD NSS_WRAPPER_PASSWD NSS_WRAPPER_GROUPfi
}# print large warning if GS_PASSWORD is long
# error if both GS_PASSWORD is empty and GS_HOST_AUTH_METHOD is not 'trust'
# print large warning if GS_HOST_AUTH_METHOD is set to 'trust'
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
docker_verify_minimum_env() {# check password first so we can output the warning before postgres# messes it upif [[ "$GS_PASSWORD" =~  ^(.{8,}).*$ ]] &&  [[ "$GS_PASSWORD" =~ ^(.*[a-z]+).*$ ]] && [[ "$GS_PASSWORD" =~ ^(.*[A-Z]).*$ ]] &&  [[ "$GS_PASSWORD" =~ ^(.*[0-9]).*$ ]] && [[ "$GS_PASSWORD" =~ ^(.*[#?!@$%^&*-]).*$ ]]; thencat >&2 <<-'EOWARN'Message: The supplied GS_PASSWORD is meet requirements.EOWARNelsecat >&2 <<-'EOWARN'Error: The supplied GS_PASSWORD is not meet requirements.Please Check if the password contains uppercase, lowercase, numbers, special characters, and password length(8).At least one uppercase, lowercase, numeric, special character.Example: Enmo@123
EOWARNexit 1fiif [ -z "$GS_PASSWORD" ] && [ 'trust' != "$GS_HOST_AUTH_METHOD" ]; then# The - option suppresses leading tabs but *not* spaces. :)cat >&2 <<-'EOE'Error: Database is uninitialized and superuser password is not specified.You must specify GS_PASSWORD to a non-empty value for thesuperuser. For example, "-e GS_PASSWORD=password" on "docker run".You may also use "GS_HOST_AUTH_METHOD=trust" to allow allconnections without a password. This is *not* recommended.EOEexit 1fiif [ 'trust' = "$GS_HOST_AUTH_METHOD" ]; thencat >&2 <<-'EOWARN'********************************************************************************WARNING: GS_HOST_AUTH_METHOD has been set to "trust". This will allowanyone with access to the opengauss port to access your database withouta password, even if GS_PASSWORD is set.It is not recommended to use GS_HOST_AUTH_METHOD=trust. Replaceit with "-e GS_PASSWORD=password" instead to set a password in"docker run".********************************************************************************
EOWARNfi
}# usage: docker_process_init_files [file [file [...]]]
#    ie: docker_process_init_files /always-initdb.d/*
# process initializer files, based on file extensions and permissions
docker_process_init_files() {# gsql here for backwards compatiblilty "${gsql[@]}"gsql=( docker_process_sql )echolocal ffor f; docase "$f" in*.sh)if [ -x "$f" ]; thenecho "$0: running $f""$f"elseecho "$0: sourcing $f". "$f"fi;;*.sql)    echo "$0: running $f"; docker_process_sql -f "$f"; echo ;;*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;;*.sql.xz) echo "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;;*)        echo "$0: ignoring $f" ;;esacechodone
}# Execute sql script, passed via stdin (or -f flag of pqsl)
# usage: docker_process_sql [gsql-cli-args]
#    ie: docker_process_sql --dbname=mydb <<<'INSERT ...'
#    ie: docker_process_sql -f my-file.sql
#    ie: docker_process_sql <my-file.sql
docker_process_sql() {local query_runner=( gsql -v ON_ERROR_STOP=1 --username "$GS_USER" --password "$GS_PASSWORD")if [ -n "$GS_DB" ]; thenquery_runner+=( --dbname "$GS_DB" )fiecho "Execute SQL: ${query_runner[@]} $@""${query_runner[@]}" "$@"
}# create initial database
# uses environment variables for input: GS_DB
docker_setup_db() {echo "GS_DB = $GS_DB"if [ "$GS_DB" != 'postgres' ]; thenGS_DB= docker_process_sql --dbname postgres --set db="$GS_DB" --set passwd="$GS_PASSWORD" --set passwd="$GS_PASSWORD" <<-'EOSQL'CREATE DATABASE :"db" ;create user gaussdb with login password :"passwd" ;grant all privileges to gaussdb;EOSQLechofi
}docker_setup_user() {if [ -n "$GS_USERNAME" ]; thenGS_DB= docker_process_sql --dbname postgres --set db="$GS_DB" --set passwd="$GS_PASSWORD" --set user="$GS_USERNAME" <<-'EOSQL'create user :"user" with login password :"passwd" ;
EOSQLelseecho " default user is gaussdb"fi
}docker_setup_rep_user() {if [ -n "$SERVER_MODE" ] && [ "$SERVER_MODE" = "primary" ]; thenGS_DB= docker_process_sql --dbname postgres --set passwd="$GS_PASSWORD" --set user="repuser" <<-'EOSQL'create user :"user" SYSADMIN REPLICATION password :"passwd" ;
EOSQLelseecho " default no repuser created"fi
}# Loads various settings that are used elsewhere in the script
# This should be called before any other functions
docker_setup_env() {export GS_USER=ommfile_env 'GS_PASSWORD'# file_env 'GS_USER' 'omm'file_env 'GS_DB' "$GS_USER"file_env 'POSTGRES_INITDB_ARGS'# default authentication method is md5: "${GS_HOST_AUTH_METHOD:=md5}"declare -g DATABASE_ALREADY_EXISTS# look specifically for OG_VERSION, as it is expected in the DB dirif [ -s "$PGDATA/PG_VERSION" ]; thenDATABASE_ALREADY_EXISTS='true'fi
}# append GS_HOST_AUTH_METHOD to pg_hba.conf for "host" connections
opengauss_setup_hba_conf() {{echoif [ 'trust' = "$GS_HOST_AUTH_METHOD" ]; thenecho '# warning trust is enabled for all connections'fiecho "host all all 0.0.0.0/0 $GS_HOST_AUTH_METHOD"echo "host replication gaussdb 0.0.0.0/0 md5"if [ -n "$SERVER_MODE" ]; thenecho "host replication repuser $OG_SUBNET trust"fi} >> "$PGDATA/pg_hba.conf"
}# append parameter to postgres.conf for connections
opengauss_setup_postgresql_conf() {{echoif [ -n "$GS_PORT" ]; thenecho "password_encryption_type = 0"echo "port = $GS_PORT"echo "wal_level = logical"elseecho '# use default port 5432'echo "password_encryption_type = 0"echo "wal_level = logical"fiif [ -n "$SERVER_MODE" ]; thenecho "listen_addresses = '0.0.0.0'"echo "most_available_sync = on"echo "remote_read_mode = non_authentication"echo "pgxc_node_name = '$NODE_NAME'"# echo "application_name = '$NODE_NAME'"if [ "$SERVER_MODE" = "primary" ]; thenecho "max_connections = 100"elseecho "max_connections = 100"fiecho -e "$REPL_CONN_INFO"if [ -n "$SYNCHRONOUS_STANDBY_NAMES" ]; thenecho "synchronous_standby_names=$SYNCHRONOUS_STANDBY_NAMES"fielseecho "listen_addresses = '*'"fiif [ -n "$OTHER_PG_CONF" ]; thenecho -e "$OTHER_PG_CONF"fi} >> "$PGDATA/postgresql.conf"
}opengauss_setup_mot_conf() {echo "enable_numa = false" >> "$PGDATA/mot.conf"
}# start socket-only postgresql server for setting up or running scripts
# all arguments will be passed along as arguments to `postgres` (via pg_ctl)
docker_temp_server_start() {if [ "$1" = 'gaussdb' ]; thenshiftfiPGUSER="${PGUSER:-$GS_USER}" \gs_ctl -D "$PGDATA" \-w start
}# stop postgresql server after done setting up user and running scripts
docker_temp_server_stop() {PGUSER="${PGUSER:-postgres}" \gs_ctl -D "$PGDATA" -m fast -w stop
}docker_slave_full_backup() {gs_ctl build -D "$PGDATA" -b full
}# check arguments for an option that would cause opengauss to stop
# return true if there is one
docker_setup_slot() {
cp /usr/local/opengauss/wal2json.so /usr/local/opengauss/lib/postgresqlGS_DB= docker_process_sql --dbname postgres --set db="$GS_DB" --set passwd="$GS_PASSWORD" --set user="$GS_USERNAME" <<-'EOSQL'select * from pg_create_logical_replication_slot('wal2json', 'wal2json');create table gaussdb.test (id int primary key, name varchar2(20));insert into gaussdb.test values(1,'yun');insert into gaussdb.test values(2,'he');insert into gaussdb.test values(3,'enmo');ALTER TABLE gaussdb.test REPLICA IDENTITY FULL;
EOSQL
}_opengauss_want_help() {local argcount=1for arg; docase "$arg" in# postgres --help | grep 'then exit'# leaving out -C on purpose since it always fails and is unhelpful:# postgres: could not access the server configuration file "/var/lib/postgresql/data/postgresql.conf": No such file or directory-'?'|--help|--describe-config|-V|--version)return 0;;esacif [ "$arg" == "-M" ]; thenSERVER_MODE=${@:$count+1:1}echo "openGauss DB SERVER_MODE = $SERVER_MODE"shiftficount=$[$count + 1]donereturn 1
}_main() {# if first arg looks like a flag, assume we want to run postgres serverif [ "${1:0:1}" = '-' ]; thenset -- gaussdb "$@"fiif [ "$1" = 'gaussdb' ] && ! _opengauss_want_help "$@"; thendocker_setup_env# setup data directories and permissions (when run as root)docker_create_db_directoriesif [ "$(id -u)" = '0' ]; then# then restart script as postgres userexec gosu omm "$BASH_SOURCE" "$@"fi# only run initialization on an empty data directoryif [ -z "$DATABASE_ALREADY_EXISTS" ]; thendocker_verify_minimum_env# check dir permissions to reduce likelihood of half-initialized databasels /docker-entrypoint-initdb.d/ > /dev/nulldocker_init_database_diropengauss_setup_hba_confopengauss_setup_postgresql_confopengauss_setup_mot_conf# PGPASSWORD is required for gsql when authentication is required for 'local' connections via pg_hba.conf and is otherwise harmless# e.g. when '--auth=md5' or '--auth-local=md5' is used in POSTGRES_INITDB_ARGSexport PGPASSWORD="${PGPASSWORD:-$GS_PASSWORD}"docker_temp_server_start "$@"if [ -z "$SERVER_MODE" ] || [ "$SERVER_MODE" = "primary" ]; thendocker_setup_dbdocker_setup_userdocker_setup_rep_user
#                        docker_setup_slotdocker_process_init_files /docker-entrypoint-initdb.d/*fi#todo 注意删除这里
#                        if [ -n "$SERVER_MODE" ] && [ "$SERVER_MODE" != "primary" ]; then
#                            docker_slave_full_backup
#                        fidocker_temp_server_stopunset PGPASSWORDechoecho 'openGauss  init process complete; ready for start up.'echoelseechoecho 'openGauss Database directory appears to contain a database; Skipping initialization'echofifiexec "$@"
}if ! _is_sourced; then_main "$@"
fi

2.2、 build Dokcerfile

docker build -t single-opengauss:5.0.1 .

3、docker部署

docker run --name opengauss --privileged=true -d -e GS_PASSWORD=Enmo@123 opengauss:5.0.1

3.1、k8s部署

apiVersion: apps/v1
kind: Deployment
metadata:annotations:description: opengaussname: opengaussnamespace: test
spec:replicas: 1selector:matchLabels:app: opengausstemplate:metadata:labels:app: opengaussspec:containers:- env:- name: GS_PASSWORDvalue: "Enmo@123"#根据自己docker build的名称执行image: single-opengauss:5.0.1
#          imagePullPolicy: IfNotPresentimagePullPolicy: Alwaysname: opengausssecurityContext:privileged: trueports:- containerPort: 5432name: tcpvolumeMounts:- name: volume-opengauss-datamountPath: /var/lib/opengauss/datavolumes:- name: volume-opengauss-datahostPath:path: /app/test/opengauss/datatype: DirectoryOrCreate---
apiVersion: v1
kind: Service
metadata:name: opengaussnamespace: test
spec:ports:- port: 5432protocol: TCPtargetPort: 5432nodePort: 30034selector:app: opengausstype: NodePort# su opengauss

4、参考

1、 官网
2、github

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

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

相关文章

佛山50公里徒步组团|真北敏捷社区佛山敏捷DevOps社区

真北敏捷社区&佛山敏捷DevOps社区有两个宗旨&#xff0c;一是求知&#xff0c;二是连接。连接有识之士&#xff0c;同修友士之识。峨峨乎高山&#xff0c;洋洋乎流水。谈笑有鸿儒&#xff0c;往来无白丁。 《柳叶刀》上的研究显示&#xff0c;运动的情绪价值&#xff0c;相…

探索NebulaGraph:一个开源分布式图数据库的技术解析

1. 介绍 NebulaGraph的定位和用途 NebulaGraph是一款开源的分布式图数据库&#xff0c;专注于存储和处理大规模图数据。它的主要定位是为了解决图数据存储和分析的问题&#xff0c;能够处理节点和边数量巨大、结构复杂的图结构数据。NebulaGraph被设计用来应对各种领域的图数…

c语言求阶乘序列前N项和

本题要求编写程序&#xff0c;计算序列 1!2!3!⋯ 的前N项之和。 输入格式: 输入在一行中给出一个不超过12的正整数N。 输出格式: 在一行中输出整数结果。 输入样例: 5输出样例: 153 #include<stdio.h> int main() {int a,b,c0,d1;scanf("%d",&a);fo…

数据结构之树结构(下)

各种各样的大树 平衡二叉树 (AVL树) 普通二叉树存在的问题 左子树全部为空&#xff0c;从形式上看&#xff0c;更像一个单链表 插入速度没有影响 查询速度明显降低&#xff08;因为需要依次比较&#xff09;&#xff0c;不能发挥BST的优势&#xff0c;因为每次还需要比较左子…

javaWeb个人学习04

AOP核心概念: 连接点: JoinPoint, 可以被AOP控制的方法 通知: Advice 指哪些重复的逻辑&#xff0c;也就是共性功能(最终体现为一个方法) 切入点: PointCut, 匹配连接点的条件&#xff0c;通知仅会在切入点方法执行时被应用 目标对象: Target, 通知所应用的对象 通知类…

docker基线安全修复和容器逃逸修复

一、docker安全基线存在的问题和修复建议 1、将容器的根文件系统挂载为只读 修复建议&#xff1a; 添加“ --read-only”标志&#xff0c;以允许将容器的根文件系统挂载为只读。 可以将其与卷结合使用&#xff0c;以强制容器的过程仅写入要保留的位置。 可以使用命令&#x…

航拍无人机技术,航拍无人机方案详解,无人机摄影技术

航拍无人机是利用遥控技术和摄像设备&#xff0c;在空中进行拍摄和录像的无人机。这种无人机通常具有高清摄像设备、图像传输设备、GPS定位系统、智能控制系统等&#xff0c;可以轻松实现各种拍摄角度和高度&#xff0c;广泛应用于影视制作、旅游景区航拍、城市规划、环保监测等…

【数据结构与算法】回溯法解题20240301

这里写目录标题 一、78. 子集1、nums [1,2,3]为例把求子集抽象为树型结构2、回溯三部曲 二、90. 子集 II1、本题搜索的过程抽象成树形结构如下&#xff1a; 三、39. 组合总和1、回溯三部曲2、剪枝优化 四、LCR 082. 组合总和 II1、思路2、树形结构如图所示&#xff1a;3、回溯…

用vivado创建一个赛灵思AXI的IP核

一、新建一个管理IP的任务 二、设置板子&#xff0c;verilog语言和文件位置 三、创建新的IP核 添加一个axi-full的master接口和axi-full的slave接口 四、查看赛灵思AXI代码 第一个是axi的master接口代码&#xff0c;下面的是axi的slave接口代码 五、打包IP核以供后续使用 六、…

共享旅游卡:打开0费用旅游新纪元,探索40+精彩线路

随着现代生活节奏的加快&#xff0c;旅游成为了许多人释放压力、寻求乐趣的方式。然而&#xff0c;面对琳琅满目的旅游线路和不断上涨的旅游费用&#xff0c;许多人望而却步。 今天&#xff0c;我们要为您介绍一种颠覆传统旅游方式的创新产品——共享旅游卡。它不仅能让您以0费…

什么是双线服务器?

双线服务器是一种有着两条高速网络线路的主机服务器&#xff0c;通常又被称为双线独享服务器&#xff0c;双线服务器的出现提高了服务器的可靠性&#xff0c;因为双线服务器对数据与请求可以使用两条高速网络线路进行处理&#xff0c;对比于单线服务器&#xff0c;提高了服务器…

easyexcel字体加粗

public static void main(String[] args) { List dataList new ArrayList<>(); dataList.add(new Data(“Data 1”)); dataList.add(new Data(“Data 2”)); dataList.add(new Data(“Data 3”)); // 设置加粗字体WriteCellStyle boldCellStyle new WriteCellStyle();W…

出现 ‘vue‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件的解决方法(图文界面)

目录 前言1. 问题所示2. 原理分析3. 解决方法前言 由于Java转全栈,对此前端的细节点都比他人更加注意,所以此处记录更有用的信息!(小白都能看懂) 1. 问题所示 出现如下问题: F:\vue_project>vue -version vue 不是内部或外部命令,也不是可运行的程序 或批处理文件…

基于Python的电商评论数据采集与分析|电商API接口数据采集

引言 在电商竞争日益激烈的情况下&#xff0c;商家既要提高产品质量&#xff0c;又要洞悉客户的想法和需求&#xff0c;关注客户购买商品后的评论&#xff0c;而第三方商家获取商品评价主要依赖于人工收集&#xff0c;不但效率低&#xff0c;而且准确度得不到保障。通过使用Py…

鸿蒙 渲染控制

前提&#xff1a;基于官网3.1/4.0文档。参考官网文档 基于Android开发体系来进行比较和思考。&#xff08;或有偏颇&#xff0c;自行斟酌&#xff09; 1.概念 ArkUI通过自定义组件的build()函数和builder装饰器中的声明式UI描述语句构建相应的UI。在声明式描述语句中开发者除了…

Ps:绘画对称功能

Photoshop 中的绘画对称 Paint Symmetry功能允许用户在画布上创建对称的绘画和设计&#xff0c;极大地提高了创作的效率和准确性&#xff0c;尤其适合于制作复杂的对称图形和图案。 可在使用画笔工具、铅笔工具或橡皮擦工具时启用“绘画对称"功能。 提示&#xff1a; 绘画…

Ubuntu Qt控制终端运行ros

文章目录 gnome-terminalQt 通过QProcess类Qt 通过system gnome-terminal 在Ubuntu中可以使用man gnome-terminal命令查看gnome-terminal的使用指南&#xff0c;也可在ubuntu manuals查看&#xff1a; NAMEgnome-terminal — 一个终端仿真应用.概要gnome-terminal [-e, --c…

Cocos游戏开发中的金币落袋效果

引言 Cocos游戏开发中的金币落袋效果 大家好,不知道大家有没有被游戏中的一些小细节打动或吸引。 往往游戏就是通过一些与众不同的细节,去留住玩家。 金币落袋效果正是如此,它比普通的数值变化来得更加形象,给予玩家成就感和满足感。 本文重点给大家介绍一下如何在Coc…

深入探索Java集合框架

在Java编程中&#xff0c;数据的组织和存储是核心部分。为了更有效地管理和操作这些数据&#xff0c;Java提供了一个强大且灵活的集合框架&#xff08;Java Collection Framework&#xff0c;JCF&#xff09;。这个框架不仅简化了数据结构的处理&#xff0c;还提供了高效的性能…

Opencv基本操作 (上)

目录 图像基本操作 阈值与平滑处理 图像阈值 图像平滑处理 图像形态学操作 图像梯度计算 Sobel 算子 Canny 边缘检测 图像金字塔与轮廓检测 图像轮廓 接口定义 轮廓绘制 轮廓特征与相似 模板匹配 傅里叶变换 傅里叶变换的作用 滤波 图像基本操作 读取图像&…