基于openEuler20.03安装openGauss5.0.0及安装DBMind

基于openEuler20.03安装openGauss5.0.0及安装DBMind

    • 一、环境说明
    • 二、安装部署
    • 三、问题及解决

一、环境说明

  1. 虚拟机:VirtualBox
  2. 操作系统:openEuler20.3LTS (x86)
  3. 数据库:openGauss5.0.0 (x86)
  4. DBMind:dbmind-5.0.0 (linux)

二、安装部署

  1. 下载openEuler20.03 LTS(安装省略),点击下载

  2. 下载openGauss-5.0.0 企业版(可选),点击下载

  3. 下载DBMind,点击下载

  4. 下载node-exporter,点击下载

  5. 下载prometheus,点击下载

  6. 安装openGauss5.0.0,使用root用户进行安装:

    • 编辑clusterconfig.xml,并添加如下内容,注意:主机名和IP地址修改成你自己的环境
      <?xml version="1.0" encoding="UTF-8"?>
      <ROOT><!-- openGauss整体信息 --><CLUSTER><!-- 数据库名称 --><PARAM name="clusterName" value="mycluster" /><!-- 数据库节点名称(hostname) --><PARAM name="nodeNames" value="openEuler01" /><!-- 数据库安装目录--><PARAM name="gaussdbAppPath" value="/opt/install/app" /><!-- 日志目录--><PARAM name="gaussdbLogPath" value="/opt/install/log/omm" /><!-- 临时文件目录--><PARAM name="tmpMppdbPath" value="/opt/install/tmp" /><!-- 数据库工具目录--><PARAM name="gaussdbToolPath" value="/opt/install/om" /><!-- 数据库core文件目录--><PARAM name="corePath" value="/opt/install/corefile" /><!-- 节点IP,与数据库节点名称列表一一对应 --><PARAM name="backIp1s" value="192.168.56.6"/> </CLUSTER><!-- 每台服务器上的节点部署信息 --><DEVICELIST><!-- 节点1上的部署信息 --><DEVICE sn="100001"><!-- 节点1的主机名称 --><PARAM name="name" value="openEuler01"/><!-- 节点1所在的AZ及AZ优先级 --><PARAM name="azName" value="AZ1"/><PARAM name="azPriority" value="1"/><!-- 节点1的IP,如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP --><PARAM name="backIp1" value="192.168.56.6"/><PARAM name="sshIp1" value="192.168.56.6"/>   <!--dbnode--><PARAM name="dataNum" value="1"/><PARAM name="dataPortBase" value="15432"/><PARAM name="dataNode1" value="/opt/install/data/dn"/><PARAM name="dataNode1_syncNum" value="0"/></DEVICE></DEVICELIST>
      </ROOT>
      
    • 编辑install.sh脚本,添加如下内容,注意:主机名和IP地址修改成你自己的环境
      #!/bin/bash# 设置字符集参数
      cat >>/etc/profile<<EOF
      export LANG=en_US.UTF-8
      EOF# 使修改生效
      source /etc/profile# 修改python版本并安装libaio包
      mv /usr/bin/python /usr/bin/python.bak
      ln -s /usr/bin/python3 /usr/bin/python
      python -V
      yum install libaio* -y# 创建目录,用于存放openGauss软件包
      mkdir -p /opt/software/openGauss
      mv clusterconfig.xml /opt/software/openGauss/
      cd /opt/software/openGauss# 下载openGauss安装包并解压
      wget https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.0/x86_openEuler/openGauss-5.0.0-openEuler-64bit-all.tar.gz
      tar -zvxf openGauss-5.0.0-openEuler-64bit-all.tar.gz
      tar -zvxf openGauss-5.0.0-openEuler-64bit-om.tar.gz# 预安装数据库
      chmod -R 755 /opt/software/openGauss
      cd /opt/software/openGauss/script
      ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/clusterconfig.xmlchown omm:dbgrp -R /opt/software/# 安装数据库,注意:以下操作是在suben用户下执行
      su - omm -c 'gs_install -X /opt/software/openGauss/clusterconfig.xml --gsinit-parameter="--encoding=UTF8"  --dn-guc="max_process_memory=4GB"  --dn-guc="shared_buffers=256MB" --dn-guc="bulk_write_ring_size=256MB" --dn-guc="cstore_buffers=16MB";gs_om -t status --detail'
      
    • 执行脚本进行安装
      sh install.sh
      
    • 创建dbmind_monitor数据库用户及元数据库
      gs_guc reload -D /opt/install/data/dn -c 'password_encryption_type=1'
      gsql -p 15432 -d postgres -c 'create user dbmind_monitor password "openEuler@1234";' 
      gsql -p 15432 -d postgres -c 'alter user dbmind_monitor monadmin;'
      gsql -p 15432 -d postgres -c 'grant all privileges to dbmind_monitor;'
      gs_guc reload -D /opt/install/data/dn -c 'password_encryption_type=2'
      gsql -p 15432 -d postgres -c 'create database metadatabase owner dbmind_monitor;'
      
  7. 安装DBMind,使用omm用户安装:

    • 上传dbmind安装包到/home/omm下,确保该文件用户是omm,用户组是dbgrp,修改命令如下:
      chown omm:dbgrp /home/omm/dbmind-installer-x86_64-python3.10.sh.tar.gz
      
    • 解压
      tar zxvf /home/omm/dbmind-installer-x86_64-python3.10.sh.tar.gz
      
    • 执行脚本安装:
      sh /home/omm/dbmind-installer-x86_64-python3.10.sh
      
    • 环境变量生效
      source ~/.bashrc
      
    • 测试是否安装成功:
      gs_dbmind --help
      
    • 配置python资源库
      mkdir ~/.pip/
      vim ~/.pip/pip.conf
      
      添加如下内容:
      [global]
      index-url = http://mirrors.aliyun.com/pypi/simple/
      trusted-host = mirrors.aliyun.com
      timeout = 120
      
    • 安装第三方插件
      建议您将DBMind所需的Python运行环境安装到DBMind根目录下的 python 目录中,DBMind会优先选择使用在其根目录下 python 目录中的环境。即 gs_dbmind 命令会首先在python/bin 目录下寻找 python3 命令执行后续的Python功能。
      /home/omm/openGauss-DBMind/python/bin/python -m pip install -r /home/omm/openGauss-DBMind/requirements-x86.txt
      /home/omm/openGauss-DBMind/python/bin/python -m pip install python-multipart
      
  8. 安装node-exporter,并将其上传到omm用户的家目录/home/omm,修改其用户和用户组为omm:dbgrp

    • 解压
      tar -zvxf node_exporter-1.7.0.linux-amd64.tar.gz -C /opt/software/
      cd /opt/software/node_exporter-1.7.0.linux-amd64
      
    • 启动 【node_exporter】 默认端口号为9100:
      ./node_exporter > node_exporter.log 2>&1 &
      
    • 查看端口是否处于监听状态:
      netstat -anp|grep 9100
      
      正常会看到如下内容:
      [omm@openEuler01 openGauss-DBMind]$ netstat -anp|grep 9100
      tcp        0      0 192.168.56.11:39872     192.168.56.11:9100      ESTABLISHED 30259/./prometheus
      tcp6       0      0 :::9100                 :::*                    LISTEN      24724/./node_export
      tcp6       0      0 192.168.56.11:9100      192.168.56.11:39872     ESTABLISHED 24724/./node_export
      [omm@openEuler01 openGauss-DBMind]$
      
    • 启动【cmd_exporter
      cmd_exporter用来执行cmd命令并获取返回结果以及采集日志信息,当前主要用于采集集群状态,如是主备集群环境,则只需要在一个备数据库节点上安装就可以了。
      gs_dbmind component cmd_exporter --web.listen-address 0.0.0.0 --web.listen-port 9180 --disable-https
      
    • 启动【opengauss_exporter
      opengauss_exporter是DBMind采集数据库的组件,从openGauss数据库中读取系统表(或系统视图)的数据,并通过Prometheus保存起来。支持远程部署,需要在每个数据库节点上安装。opengauss_exporter的默认端口号范围是9187-9197,如果被占用可以使用其他端口。注意:对于采用URL格式的DSN,由于@等特殊字符用来分割URL串中各个部分的内容,故需要URL编码。例如某个用户dbmind的密码为openEuler@1234,则URL格式的DSN为psotgresql:dbmind:Test%40123@127.0.0.1:15432,即将@字符编码为%40
      gs_dbmind component opengauss_exporter --url postgresql://dbmind_monitor:openEuler%401234@192.168.56.11:15432/postgres --web.listen-address 0.0.0.0 --web.listen-port 9187 --log.level info --disable-https
      
      启动成功后,可执行如下命令查看,如能看到输出,则说明正常:
      # 端口号9187为用户指定的端口号, 如果失败会显示Connection refused  
      curl -vv http://localhost:9187/metrics 
      
  9. 安装Prometheus,并将其上传到omm用户的家目录/home/omm,修改其用户和用户组为omm:dbgrp。

    prometheus是业内非常流行的开源监控系统,同时本身也是一款时序数据库。需要将其安装在主控节点,默认占用端口为9090。

    • 解压:

      tar -zvxf prometheus-2.48.0.linux-amd64.tar.gz -C /opt/software/
      cd /opt/software/nprometheus-2.48.0.linux-amd64
      
    • 修改配置文件

      vim prometheus.yml
      

      在该文件中找到 scrape_configs 部分,该部分包含了所有需要被抓取的targets的配置信息,用户需要根据自己的节点数量和端口占用情况进行修改。本实验是单机模式,做如下配置:

      scrape_configs:# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.- job_name: "prometheus"# metrics_path defaults to '/metrics'# scheme defaults to 'http'.static_configs:- targets: ["192.168.56.11:9090"]- job_name: "opengauss_exporter"static_configs:- targets: ["192.168.56.11:9187"]- job_name: "node_exporter"static_configs:- targets: ["192.168.56.11:9100"]- job_name: "reprocessing_exporter"static_configs:- targets: ["192.168.56.11:8181"]- job_name: "cmd_exporter"static_configs:- targets: ["192.168.56.11:9180"]
      
    • 启动【prometheus】并将日志输入到同目录下的prometheus.log里:

      ./prometheus --web.enable-admin-api --web.enable-lifecycle --storage.tsdb.retention.time=1w >./prometheus.log 2>&1 & 
      
    • 再启动【reprocessing_exporter】

      reprocessing_exporter是一个用于二次加工处理数据的exporter。由于node_exporter、opengauss_exporter保存到prometheus中的数据是即时的监控信息,而只通过这些信息是无法反应某些指标的瞬时增量信息的。因此,reprocessing_exporter可以用来计算增量信息或者聚合结果等。

      由于reprocessing_exporter是从prometheus中获取指标数据,进行二次加工处理后再返回给prometheus。因此,它与prometheus是一一对应的,即如果只有一个prometheus服务,则只需要一个reprocessing_exporter即可。prometheus和reprocessing_exproter一起部署在主控节点上,reprocessing_exproter依赖prometheus,所以需要先启动prometheus再启动reprocessing_exporter。

      gs_dbmind component reprocessing_exporter 192.168.56.11 9090 --web.listen-address 0.0.0.0 --web.listen-port 8181 --disable-https 
      
  10. 生成DBMind配置文件,在openGauss-DBMind目录下执行如下命令会在openGauss-DBMind目录下创建dbmindconf/dbmind.conf配置文件:

    cd /home/omm/openGauss-DBMind
    gs_dbmind service setup -c dbmindconf  
    
  11. 修改DBMind配置文件,需要修改内容如下:

    vim /home/omm/openGauss-DBMind/dbmindconf/dbmind.conf  
    

    修改如下内容,如下为必填的配置项如下:

    • TDSB为时序数据库配置,即prometheus相关信息。
      [TSDB]
      name = prometheus # The type of time-series database. Options: prometheus.
      host = 192.168.56.11 # Address of time-series database.
      port = 9090 # Port to connect to time-series database.
      
    • 元数据库,DBMind服务器所创建的metadatabase数据库相关信息,注意用户需要有数据库创建的权限。在启动DBMind之前,需要把metadatabase创建好。
      [METADATABASE]
      dbtype = opengauss # Database type. Options: sqlite, opengauss, postgresql.
      host = 192.168.56.11 # Address of meta-data database.
      port = 15432 # Port to connect to meta-data database.
      username = dbmind_monitor # User name to connect to meta-data database.
      password = openEuler@1234  # Password to connect to meta-data database.
      database = metadatabase  # Database name to connect to meta-data database.
      
    • 工作线程数,该模块用于指定DBMind可以使用的worker子进程数量,如果写0则会进行自适应,尽可能多地使用CPU资源。
      [WORKER]
      process_num = 2  # Number of worker processes on a local node. Less than or equal to zero means adaptive.
      
    • openGauss数据库Agent,该模块用于指定DBMind连接到openGauss Agent的信息。使用该Agent,可以让DBMind获取到被监控实例的即时状态,从而提高分析准确性。同时,也可以向数据库实例下发一些变更动作。
      masterurl为http://{DBMind服务器IP}:{opengaussexporter监听端口},置空会自动识别。usename为数据库实例的dbmind_minotor用户。
      [AGENT]
      master_url = 
      username = dbmind_monitor 
      password = openEuler@1234
      
    • 设置定时任务TIMED_TASK,可设置参数有如下:
      Discard_expired_results: 删除过期结果
      self_monitoring:指标异常监控
      daily_inspection:日检
      weekly_inspection:周检
      monthly_inspection: 月检
      slow_sql_diagnosis:慢SQL诊断
      knob_recommend:参数调优
      slow_query_killer:慢SQL查杀​​​​​​​​​​​​​​
      [TIMED_TASK]
      task = discard_expired_results,self_monitoring
      
    • 配置DNMind的WEB-SERVICE访问界面
      [WEB-SERVICE]
      host = 192.168.56.11  # Which host to bind for web service. '0.0.0.0' means to bind all.
      port = 8080  # Port to listen for web serivce.
      
  12. 初始化DBMind配置,即会在元数据metadatabase创建30表

    cd /home/omm/openGauss-DBMind
    gs_dbmind service setup --initialize -c dbmindconf
    

    正常执行后,会看到如下信息:

    [omm@openEuler01 openGauss-DBMind]$ gs_dbmind service setup --initialize -c dbmindconf
    NOTICE: You have set the variable PYTHONPATH. DBMind ignored it.
    Starting to generate a dynamic config file...
    WARN: default PostgreSQL connector (psycopg2-binary) does not support openGauss.
    It would help if you compiled psycopg2 with openGauss manually or created a connection user after setting the GUC password_encryption_type to 1.
    Notice: Without explicitly setting agent configurations, the automatic detection mechanism is used.
    Starting to encrypt the plain-text passwords in the config file...
    Starting to initialize and check the essential variables...
    Starting to connect to meta-database and create tables...
    The setup process finished successfully.
    

    另外,可以登录openGauss数据库下进行查看是否有30张表生成:

    gsql -d metadatabase -p 15432 -r
    metadatabase=# \dList of relationsSchema |                     Name                      |   Type   |     Owner      |             Storage
    --------+-----------------------------------------------+----------+----------------+----------------------------------public | tb_existing_indexes                           | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_existing_indexes_id_seq                    | sequence | dbmind_monitor |public | tb_future_alarms                              | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_future_alarms_future_alarm_id_seq          | sequence | dbmind_monitor |public | tb_healing_records                            | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_healing_records_id_seq                     | sequence | dbmind_monitor |public | tb_history_alarms                             | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_history_alarms_history_alarm_id_seq        | sequence | dbmind_monitor |public | tb_index_recommendation                       | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_index_recommendation_id_seq                | sequence | dbmind_monitor |public | tb_index_recommendation_stats                 | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_index_recommendation_stats_id_seq          | sequence | dbmind_monitor |public | tb_index_recommendation_stmt_details          | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_index_recommendation_stmt_details_id_seq   | sequence | dbmind_monitor |public | tb_index_recommendation_stmt_templates        | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_index_recommendation_stmt_templates_id_seq | sequence | dbmind_monitor |public | tb_killed_slow_queries                        | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_killed_slow_queries_killed_query_id_seq    | sequence | dbmind_monitor |public | tb_knob_recommendation_details                | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_knob_recommendation_details_id_seq         | sequence | dbmind_monitor |public | tb_knob_recommendation_metric_snapshot        | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_knob_recommendation_metric_snapshot_id_seq | sequence | dbmind_monitor |public | tb_knob_recommendation_warnings               | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_knob_recommendation_warnings_id_seq        | sequence | dbmind_monitor |public | tb_regular_inspections                        | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_regular_inspections_id_seq                 | sequence | dbmind_monitor |public | tb_slow_queries                               | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_slow_queries_journal                       | table    | dbmind_monitor | {orientation=row,compression=no}public | tb_slow_queries_journal_journal_id_seq        | sequence | dbmind_monitor |public | tb_slow_queries_slow_query_id_seq             | sequence | dbmind_monitor |
    (30 rows)
    
  13. 启动DBMind服务:

    gs_dbmind service start -c dbmindconf  
    

    正常执行命令会看到有成功信息打印出来
    另外,可以通过查看端口8080是否被监听,命令如下:

    [omm@openEuler01 openGauss-DBMind]$ netstat -anp|grep 8080
    tcp        0      0 192.168.56.11:8080      0.0.0.0:*               LISTEN      33752/DBMind [Maste
    
  14. 打开浏览器,访问http://192.168.56.11:8080/,正常情况下会看到如下界面:

    • 首页,需登录
      在这里插入图片描述
    • 登录成功
      在这里插入图片描述
      至此,已成功在openEuler20.03 LTS上安装openGauss-5.0.0企业版及DBMind-5.0.0。希望对你有所帮助~~~~

三、问题及解决

  1. 在安装过程中,可能因python环境导致缺少依赖的问题,具体文件及解决过程如下:
    [omm@openEuler01 openGauss-DBMind]$ gs_dbmind service start -c dbmindconf
    NOTICE: You have set the variable PYTHONPATH. DBMind ignored it.
    The process is starting.
    Notice: Without explicitly setting agent configurations, the automatic detection mechanism is used.
    [omm@openEuler01 openGauss-DBMind]$ An exception raised: Form data requires "python-multipart" to be installed.
    You can install "python-multipart" with:pip install python-multipartpip install python-multipart^C
    [omm@openEuler01 openGauss-DBMind]$ cd python/
    [omm@openEuler01 python]$ ls
    bin              condabin    envs  include  LICENSE.txt  pkgs   shell  x86_64-conda_cos7-linux-gnu
    compiler_compat  conda-meta  etc   lib      man          share  ssl    x86_64-conda-linux-gnu
    [omm@openEuler01 python]$ bin/python -m pip install python-multipart
    /opt/install/om/lib/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?raise TypeError("%s and %s are not of the same version" (a, b))
    Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
    Collecting python-multipartDownloading http://mirrors.aliyun.com/pypi/packages/b4/ff/b1e11d8bffb5e0e1b6d27f402eeedbeb9be6df2cdbc09356a1ae49806dbf/python_multipart-0.0.6-py3-none-any.whl (45 kB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.7/45.7 kB 752.7 kB/s eta 0:00:00
    Installing collected packages: python-multipart
    Successfully installed python-multipart-0.0.6
    [omm@openEuler01 python]$ cd ..
    [omm@openEuler01 openGauss-DBMind]$ which python-multipart
    which: no python-multipart in (/home/omm/openGauss-DBMind:/opt/install/app/bin:/opt/install/om/script/gspylib/pssh/bin:/opt/install/om/script:/home/omm/.local/bin:/home/omm/bin:/opt/install/app/bin:/opt/install/om/script/gspylib/pssh/bin:/opt/install/om/script:/bin:/opt/software/binarylibs/buildtools/openeuler_x86_64/gcc7.3/gcc/bin:/home/omm/.local/bin:/home/omm/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/install/om/script/gspylib/pssh/bin:/opt/install/om/script:/root/gauss_om/omm/script)
    [omm@openEuler01 openGauss-DBMind]$ gs_dbmind service start -c dbmindconf
    NOTICE: You have set the variable PYTHONPATH. DBMind ignored it.
    The process is starting.
    Notice: Without explicitly setting agent configurations, the automatic detection mechanism is used.
    [omm@openEuler01 openGauss-DBMind]$ netstat -anp|grep 8080
    (Not all processes could be identified, non-owned process infowill not be shown, you would have to be root to see it all.)
    tcp        0      0 192.168.56.11:8080      0.0.0.0:*               LISTEN      33752/DBMind [Maste
    tcp        0      0 192.168.56.11:58080     192.168.56.11:9090      TIME_WAIT   -
    [omm@openEuler01 openGauss-DBMind]$

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

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

相关文章

Pytest自动化测试数据驱动yaml/excel/csv/json

数据驱动 数据的改变从而驱动自动化测试用例的执行&#xff0c;最终引起测试结果的改变。简单说就是参数化的应用。 测试驱动在自动化测试中的应用场景&#xff1a; 测试步骤的数据驱动&#xff1b;测试数据的数据驱动&#xff1b;配置的数据驱动&#xff1b; 1、pytest结合…

Linux gtest单元测试

1 安装git sudo apt-get install git2 下载googletest git clone https://github.com/google/googletest.git3 安装googletest 注意1: 如果在 make 过程中报错,可在 CMakeLists.txt 中增加如下行,再执行下面的命令: SET(CMAKE_CXX_FLAGS “-std=c++11”) 注意2: CMakeLists…

Django回顾6

目录 一.Session 1.什么是Session 2.Django中Session相关方法 3.Django中的Session配置 二.中间件 1.什么是中间件 中间件的定义 2.中间件有什么用 3.自定义中间件 process_request和process_reponse &#xff08;1&#xff09;导入 &#xff08;2&#xff09;自定义…

5G常用简称

名称缩写全称缓冲区状态报告BSRBuffer Status Report&#xff08;主小区组MCGMaster Cell groupMCG的节点MNMasternode主小区PCellPrimary Cell&#xff0c;功率余量PHRPower Headroom Report主辅小区PSCellPrimary Secondary CellSCG的节点SNSecondarynode辅小区SCellSecondar…

centos安装node 、npm 、nvm

你好&#xff0c;这是Bing。我可以帮你用nodejs写一个http服务器。&#x1f60a; 根据我的搜索结果&#xff0c;你需要使用 require 指令来加载和引入 http 模块&#xff0c;然后使用 http.createServer 方法来创建一个服务器实例&#xff0c;最后使用 listen 方法来监听一个端…

优化您的Mac体验——System Dashboard Pro for Mac(系统仪表板)

作为Mac用户&#xff0c;我们都希望能够拥有一个高效、流畅的电脑体验。然而&#xff0c;在长时间使用后&#xff0c;我们的Mac可能会变得越来越慢&#xff0c;导致我们的工作效率下降。这时候&#xff0c;System Dashboard Pro for Mac(系统仪表板)就可以派上用场了。它是一款…

JAVA常见问题解答:解决Java 11新特性兼容性问题的六个步骤

引言&#xff1a; 随着技术的不断发展&#xff0c;Java作为一种被广泛使用的编程语言&#xff0c;也在不断更新和改进。Java 11作为Java的最新版本&#xff0c;带来了许多新的特性和改进。然而&#xff0c;对于一些老旧的Java应用程序来说&#xff0c;升级到Java 11可能会带来一…

使用Rust Rayon库提升程序运行速度

本文是对 N倍性能提升&#xff01;无痛Rust并行编程&#xff1a;Rayon库初体验[1]的学习与记录 有这样一段程序&#xff0c;计算1到1亿的连续数字之和 use std::i64;fn main() { let arr:Vec<i64> (1..1_0000_0000).collect(); let result sum_of_add(&arr);…

输出SearchFacesResponse对象的JSON格式字符串回包乱码解决方案

输出SearchFacesResponse对象的JSON格式字符串设置响应内容类型为"application/json;charsetutf-8"获取响应的字符输出流将SearchFacesResponse对象转化为JSON字符串并输出。 代码片段 System.out.println(SearchFacesResponse.toJsonString(resp)); response.setC…

创建腾讯云存储桶---上传图片--使用cos-sdk完成上传

创建腾讯云存储桶—上传图片 注册腾讯云账号https://cloud.tencent.com/login 登录成功&#xff0c;选择右边的控制台 点击云产品&#xff0c;选择对象存储 创建存储桶 填写名称&#xff0c;选择公有读&#xff0c;私有写一直下一步&#xff0c;到创建 选择安全管理&#…

为什么C语言用int *a 来声明指针变量,而不是int a声明?

为什么C语言用int *a 来声明指针变量&#xff0c;而不是int &a声明&#xff1f; 在开始前我有一些资料&#xff0c;是我根据自己从业十年经验&#xff0c;熬夜搞了几个通宵&#xff0c;精心整理了一份「C语言从专业入门到高级教程工具包」&#xff0c;点个关注&#xff0c…

HTTP请求

前言 HTTP是应用层的一个协议。实际我们访问一个网页&#xff0c;都会像该网页的服务器发送HTTP请求&#xff0c;服务器解析HTTP请求&#xff0c;返回HTTP响应。如此就是我们获取资源或者上传资源的原理 HTTP请求报头格式 图片来自网络 HTTP请求报头总体有四部分&#xff1a;…

Day38| Leetcode 509. 斐波那契数 Leetcode 70. 爬楼梯 Leetcode 746. 使用最小花费爬楼梯

快补&#xff01; Leetcode 509. 斐波那契数 题目链接 509 斐波那契数 class Solution { public:int fib(int n) {if(n<1){return n;}vector<int> dp(n1);dp[0] 0;dp[1] 1;for(int i2;i<n;i){dp[i] dp[i-1]dp[i-2];}return dp[n];} }; Leetcode 70. 爬楼梯 …

SR锁存器—>带EN的SR锁存器—>D锁存器—>边沿触发式D触发器—>寄存器

其实选择与非门当做构成SR锁存器的基本逻辑电路是有漏洞的&#xff0c;所以才导致了后续的都为低电平的时候&#xff0c;Q和非Q都是亮起的。但是我们设计的初衷是&#xff1a;Q和非Q是互斥的&#xff0c;是不能同时亮起的&#xff0c;且为了达到这一点&#xff0c;要使得其中两…

leetCode 47. 全排列 II + 回溯算法 + 图解 + 笔记

给定一个可包含重复数字的序列 nums &#xff0c;按任意顺序 返回所有不重复的全排列 示例 1&#xff1a; 输入&#xff1a;nums [1,1,2] 输出&#xff1a; [[1,1,2],[1,2,1],[2,1,1]] 示例 2&#xff1a; 输入&#xff1a;nums [1,2,3] 输出&#xff1a;[[1,2,3],[1,3,2…

mysql数据库的字符集和字符校对规则

所谓字符集就是字符的编码&#xff0c;是怎么保存的&#xff0c;例如UTF-8。 所谓字符校对规则是指按照什么规则来比较字符&#xff0c;打个简单的比方&#xff0c;比较字符A和a的时候&#xff0c;忽略大小写&#xff0c;这就是一条规则。 详情可以查询mysql官网&#xff1a;h…

【1day】蓝凌OA 系统custom.jsp 接口任意文件读取漏洞学习

注:该文章来自作者日常学习笔记,请勿利用文章内的相关技术从事非法测试,如因此产生的一切不良后果与作者无关。 目录 一、漏洞概述 二、影响版本 三、资产测绘 四、漏洞复现

2024年天津财经大学珠江学院专升本专业课《管理学原理》考试大纲

天津财经大学珠江学院2024年高职升本科专业课考试《管理学原理》考试大纲 一、本大纲系天津财经大学珠江学院2024年高职升本科《管理学原理》课程考试大纲。所列考试范围出自徐碧琳主编的教材《管理学原理&#xff08;第二版&#xff09;》&#xff0c;机械工业出版社&#xff…

云服务器部署过程(从零开始)

首先介绍如何在 Linux 上复制粘贴 CtrlInsert&#xff0c;或者CtrlshiftC复制文本&#xff0c;使用ShiftInsert或CtrlshiftV 在终端中粘贴文本。 搭建java部署环境 要搭建java部署环境&#xff0c;那么首先就需要在Linux上安装jdk&#xff0c;MySQL等必需工具&#xff0c;接…

vscode git管理

vscode添加了git管理 1、如下按钮&#xff0c;可以看到本次的修改部分 2、安装git history 就可以查看每次的不同部分了