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.pswp.cn/news/710849.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/710849.shtml
英文地址,請注明出處:http://en.pswp.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 邊緣檢測 圖像金字塔與輪廓檢測 圖像輪廓 接口定義 輪廓繪制 輪廓特征與相似 模板匹配 傅里葉變換 傅里葉變換的作用 濾波 圖像基本操作 讀取圖像&…