当前位置: 首页 > news >正文

Spring Boot集成kudu快速入门Demo

1.什么是kudu

在Kudu出现前,由于传统存储系统的局限性,对于数据的快速输入和分析还没有一个完美的解决方案,要么以缓慢的数据输入为代价实现快速分析,要么以缓慢的分析为代价实现数据快速输入。随着快速输入和分析场景越来越多,传统存储层的局限性越来越明显,Kudu应运而生,它的定位介于HDFS和HBase之间,将低延迟随机访问,逐行插入、更新和快速分析扫描融合到一个存储层中,是一个既支持随机读写又支持OLAP分析的存储引擎

kudu应用场景

  • 适用于那些既有随机访问,也有批量数据扫描的复合场景
  • 高计算量的场景
  • 使用了高性能的存储设备,包括使用更多的内存
  • 支持数据更新,避免数据反复迁移
  • 支持跨地域的实时数据备份和查询

架构

2359044-20210815113801516-299445637
1、Table

表(Table)是数据库中用来存储数据的对象,是有结构的数据集合。kudu中的表具有schema和全局有序的primary key(主键)。kudu中一个table会被水平分成多个被称之为tablet的片段。

2、Tablet

一个 tablet 是一张 table连续的片段,tablet是kudu表的水平分区,类似于HBase的region。每个tablet存储着一定连续range的数据(key),且tablet两两间的range不会重叠。一张表的所有tablet包含了这张表的所有key空间 tablet 会冗余存储。放置到多个 tablet server上,并且在任何给定的时间点,其中一个副本被认为是leader tablet,其余的被认之为follower tablet。每个tablet都可以进行数据的读请求,但只有Leader tablet负责写数据请求

3、Tablet Server

tablet server负责数据存储,并提供数据读写服务 一个 tablet server 存储了table表的tablet,向kudu client 提供读取数据服务。对于给定的 tablet,一个tablet server 充当 leader,其他 tablet server 充当该 tablet 的 follower 副本 只有 leader服务写请求,然而 leader 或 followers 为每个服务提供读请求 。一个 tablet server 可以服务多个 tablets ,并且一个 tablet 可以被多个 tablet servers 服务着

4、Master Server

集群中负责集群管理、元数据管理等功能

2.环境安装

采用docker-composer安装

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
version: "3"
services:kudu-master-1:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}ports:- "7051:7051"- "8051:8051"command: ["master"]volumes:- kudu-master-1:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251# TODO: Use `host.docker.internal` instead of KUDU_QUICKSTART_IP when it# works on Linux (https://github.com/docker/for-linux/issues/264)- >MASTER_ARGS=--fs_wal_dir=/var/lib/kudu/master--rpc_bind_addresses=0.0.0.0:7051--rpc_advertised_addresses=${KUDU_QUICKSTART_IP:?Please set KUDU_QUICKSTART_IP environment variable}:7051--webserver_port=8051--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8051--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-master-2:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}ports:- "7151:7151"- "8151:8151"command: ["master"]volumes:- kudu-master-2:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >MASTER_ARGS=--fs_wal_dir=/var/lib/kudu/master--rpc_bind_addresses=0.0.0.0:7151--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7151--webserver_port=8151--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8151--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-master-3:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}ports:- "7251:7251"- "8251:8251"command: ["master"]volumes:- kudu-master-3:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >MASTER_ARGS=--fs_wal_dir=/var/lib/kudu/master--rpc_bind_addresses=0.0.0.0:7251--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7251--webserver_port=8251--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8251--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-tserver-1:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}depends_on:- kudu-master-1- kudu-master-2- kudu-master-3ports:- "7050:7050"- "8050:8050"command: ["tserver"]volumes:- kudu-tserver-1:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >TSERVER_ARGS=--fs_wal_dir=/var/lib/kudu/tserver--rpc_bind_addresses=0.0.0.0:7050--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7050--webserver_port=8050--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8050--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-tserver-2:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}depends_on:- kudu-master-1- kudu-master-2- kudu-master-3ports:- "7150:7150"- "8150:8150"command: ["tserver"]volumes:- kudu-tserver-2:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >TSERVER_ARGS=--fs_wal_dir=/var/lib/kudu/tserver--rpc_bind_addresses=0.0.0.0:7150--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7150--webserver_port=8150--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8150--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-tserver-3:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}depends_on:- kudu-master-1- kudu-master-2- kudu-master-3ports:- "7250:7250"- "8250:8250"command: ["tserver"]volumes:- kudu-tserver-3:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >TSERVER_ARGS=--fs_wal_dir=/var/lib/kudu/tserver--rpc_bind_addresses=0.0.0.0:7250--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7250--webserver_port=8250--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8250--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-tserver-4:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}depends_on:- kudu-master-1- kudu-master-2- kudu-master-3ports:- "7350:7350"- "8350:8350"command: ["tserver"]volumes:- kudu-tserver-4:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >TSERVER_ARGS=--fs_wal_dir=/var/lib/kudu/tserver--rpc_bind_addresses=0.0.0.0:7350--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7350--webserver_port=8350--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8350--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-tserver-5:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}depends_on:- kudu-master-1- kudu-master-2- kudu-master-3ports:- "7450:7450"- "8450:8450"command: ["tserver"]volumes:- kudu-tserver-5:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >TSERVER_ARGS=--fs_wal_dir=/var/lib/kudu/tserver--rpc_bind_addresses=0.0.0.0:7450--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7450--webserver_port=8450--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8450--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=true
volumes:kudu-master-1:kudu-master-2:kudu-master-3:kudu-tserver-1:kudu-tserver-2:kudu-tserver-3:kudu-tserver-4:kudu-tserver-5:

windows set env

$env:KUDU_QUICKSTART_VERSION = "1.12.0"
$env:KUDU_QUICKSTART_IP= "10.11.68.77"
Get-ChildItem Env:

linux set env

export KUDU_QUICKSTART_VERSION="1.12.0"
export KUDU_QUICKSTART_IP=$(ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}' | tail -1)

run

docker-compose -f docker/quickstart.yml up -d

stop

docker-compose -f docker/quickstart.yml down

    访问http://localhost:8051/

17211931983631

3.代码工程

 实验目的

实现java对kudu的创建表 ,插入,查询,修改操作

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><parent><artifactId>springboot-demo</artifactId><groupId>com.et</groupId><version>1.0-SNAPSHOT</version></parent><modelVersion>4.0.0</modelVersion><artifactId>kudu</artifactId><properties><maven.compiler.source>17</maven.compiler.source><maven.compiler.target>17</maven.compiler.target><kudu-version>1.12.0</kudu-version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-autoconfigure</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.apache.kudu</groupId><artifactId>kudu-client</artifactId><version>${kudu-version}</version></dependency><!-- For logging messages. --><dependency><groupId>org.slf4j</groupId><artifactId>slf4j-simple</artifactId><version>1.7.30</version></dependency><dependency><groupId>org.apache.kudu</groupId><artifactId>kudu-test-utils</artifactId><version>${kudu-version}</version><scope>test</scope></dependency></dependencies></project>

example.java

// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.package com.et.kudu;import java.util.ArrayList;
import java.util.List;import org.apache.kudu.ColumnSchema;
import org.apache.kudu.Schema;
import org.apache.kudu.Type;
import org.apache.kudu.client.AlterTableOptions;
import org.apache.kudu.client.CreateTableOptions;
import org.apache.kudu.client.Insert;
import org.apache.kudu.client.KuduClient;
import org.apache.kudu.client.KuduException;
import org.apache.kudu.client.KuduPredicate;
import org.apache.kudu.client.KuduPredicate.ComparisonOp;
import org.apache.kudu.client.KuduScanner;
import org.apache.kudu.client.KuduSession;
import org.apache.kudu.client.KuduTable;
import org.apache.kudu.client.PartialRow;
import org.apache.kudu.client.RowResult;
import org.apache.kudu.client.RowResultIterator;
import org.apache.kudu.client.SessionConfiguration.FlushMode;/** A simple example of using the synchronous Kudu Java client to* - Create a table.* - Insert rows.* - Alter a table.* - Scan rows.* - Delete a table.*/
public class Example {private static final Double DEFAULT_DOUBLE = 12.345;private static final String KUDU_MASTERS = System.getProperty("kuduMasters", "localhost:7051");static void createExampleTable(KuduClient client, String tableName)  throws KuduException {// Set up a simple schema.List<ColumnSchema> columns = new ArrayList<>(2);columns.add(new ColumnSchema.ColumnSchemaBuilder("key", Type.INT32).key(true).build());columns.add(new ColumnSchema.ColumnSchemaBuilder("value", Type.STRING).nullable(true).build());Schema schema = new Schema(columns);// Set up the partition schema, which distributes rows to different tablets by hash.// Kudu also supports partitioning by key range. Hash and range partitioning can be combined.// For more information, see http://kudu.apache.org/docs/schema_design.html.CreateTableOptions cto = new CreateTableOptions();List<String> hashKeys = new ArrayList<>(1);hashKeys.add("key");int numBuckets = 8;cto.addHashPartitions(hashKeys, numBuckets);// Create the table.client.createTable(tableName, schema, cto);System.out.println("Created table " + tableName);}static void insertRows(KuduClient client, String tableName, int numRows) throws KuduException {// Open the newly-created table and create a KuduSession.KuduTable table = client.openTable(tableName);KuduSession session = client.newSession();session.setFlushMode(FlushMode.AUTO_FLUSH_BACKGROUND);for (int i = 0; i < numRows; i++) {Insert insert = table.newInsert();PartialRow row = insert.getRow();row.addInt("key", i);// Make even-keyed row have a null 'value'.if (i % 2 == 0) {row.setNull("value");} else {row.addString("value", "value " + i);}session.apply(insert);}// Call session.close() to end the session and ensure the rows are// flushed and errors are returned.// You can also call session.flush() to do the same without ending the session.// When flushing in AUTO_FLUSH_BACKGROUND mode (the mode recommended// for most workloads, you must check the pending errors as shown below, since// write operations are flushed to Kudu in background threads.session.close();if (session.countPendingErrors() != 0) {System.out.println("errors inserting rows");org.apache.kudu.client.RowErrorsAndOverflowStatus roStatus = session.getPendingErrors();org.apache.kudu.client.RowError[] errs = roStatus.getRowErrors();int numErrs = Math.min(errs.length, 5);System.out.println("there were errors inserting rows to Kudu");System.out.println("the first few errors follow:");for (int i = 0; i < numErrs; i++) {System.out.println(errs[i]);}if (roStatus.isOverflowed()) {System.out.println("error buffer overflowed: some errors were discarded");}throw new RuntimeException("error inserting rows to Kudu");}System.out.println("Inserted " + numRows + " rows");}static void scanTableAndCheckResults(KuduClient client, String tableName, int numRows) throws KuduException {KuduTable table = client.openTable(tableName);Schema schema = table.getSchema();// Scan with a predicate on the 'key' column, returning the 'value' and "added" columns.List<String> projectColumns = new ArrayList<>(2);projectColumns.add("key");projectColumns.add("value");projectColumns.add("added");int lowerBound = 0;KuduPredicate lowerPred = KuduPredicate.newComparisonPredicate(schema.getColumn("key"),ComparisonOp.GREATER_EQUAL,lowerBound);int upperBound = numRows / 2;KuduPredicate upperPred = KuduPredicate.newComparisonPredicate(schema.getColumn("key"),ComparisonOp.LESS,upperBound);KuduScanner scanner = client.newScannerBuilder(table).setProjectedColumnNames(projectColumns).addPredicate(lowerPred).addPredicate(upperPred).build();// Check the correct number of values and null values are returned, and// that the default value was set for the new column on each row.// Note: scanning a hash-partitioned table will not return results in primary key order.int resultCount = 0;int nullCount = 0;while (scanner.hasMoreRows()) {RowResultIterator results = scanner.nextRows();while (results.hasNext()) {RowResult result = results.next();if (result.isNull("value")) {nullCount++;}double added = result.getDouble("added");if (added != DEFAULT_DOUBLE) {throw new RuntimeException("expected added=" + DEFAULT_DOUBLE +" but got added= " + added);}resultCount++;}}int expectedResultCount = upperBound - lowerBound;if (resultCount != expectedResultCount) {throw new RuntimeException("scan error: expected " + expectedResultCount +" results but got " + resultCount + " results");}int expectedNullCount = expectedResultCount / 2 + (numRows % 2 == 0 ? 1 : 0);if (nullCount != expectedNullCount) {throw new RuntimeException("scan error: expected " + expectedNullCount +" rows with value=null but found " + nullCount);}System.out.println("Scanned some rows and checked the results");}public static void main(String[] args) {System.out.println("-----------------------------------------------");System.out.println("Will try to connect to Kudu master(s) at " + KUDU_MASTERS);System.out.println("Run with -DkuduMasters=master-0:port,master-1:port,... to override.");System.out.println("-----------------------------------------------");String tableName = "java_example-" + System.currentTimeMillis();KuduClient client = new KuduClient.KuduClientBuilder(KUDU_MASTERS).build();try {createExampleTable(client, tableName);int numRows = 150;insertRows(client, tableName, numRows);// Alter the table, adding a column with a default value.// Note: after altering the table, the table needs to be re-opened.AlterTableOptions ato = new AlterTableOptions();ato.addColumn("added", org.apache.kudu.Type.DOUBLE, DEFAULT_DOUBLE);client.alterTable(tableName, ato);System.out.println("Altered the table");scanTableAndCheckResults(client, tableName, numRows);} catch (Exception e) {e.printStackTrace();} finally {try {client.deleteTable(tableName);System.out.println("Deleted the table");} catch (Exception e) {e.printStackTrace();} finally {try {client.shutdown();} catch (Exception e) {e.printStackTrace();}}}}
}

以上只是一些关键代码,所有代码请参见下面代码仓库

代码仓库

  • GitHub - Harries/springboot-demo: a simple springboot demo with some components for example: redis,solr,rockmq and so on.

4.测试

 测试创建表

@Test
public void testCreateExampleTable() throws KuduException {String tableName = "test_create_example";Example.createExampleTable(client, tableName);assertTrue(client.tableExists(tableName));
}

插入数据

@Test
public void testInsertRows() throws KuduException {String tableName = "test_create_example";// Example.insertRows(client,tableName,100);System.out.println(client.getTableStatistics(tableName).getLiveRowCount());
}

7211937492543

dashboard可以看到我们创建的表和记录条数

5.引用

  • Apache Kudu - Fast Analytics on Fast Data
  • Spring Boot集成kudu快速入门Demo | Harries Blog™

相关文章:

Spring Boot集成kudu快速入门Demo

1.什么是kudu 在Kudu出现前&#xff0c;由于传统存储系统的局限性&#xff0c;对于数据的快速输入和分析还没有一个完美的解决方案&#xff0c;要么以缓慢的数据输入为代价实现快速分析&#xff0c;要么以缓慢的分析为代价实现数据快速输入。随着快速输入和分析场景越来越多&a…...

html超文本传输协议

在今天的Web开发学习中&#xff0c;我掌握了一些HTML和CSS的基础知识&#xff0c;下面我将分享我的学习笔记&#xff0c;帮助大家快速构建一个简单的Web界面。 一、HTML基础标签 1. 网站头 使用<title>标签定义网页的标题。 html <title>我的第一个网页</t…...

利用AI辅助制作ppt封面

如何利用AI辅助制作一个炫酷的PPT封面 标题使用镂空字背景替换为动态视频 标题使用镂空字 1.首先&#xff0c;新建一个空白的ppt页面&#xff0c;插入一张你认为符合主题的图片&#xff0c;占满整个可视页面。 2.其次&#xff0c;插入一个矩形&#xff0c;右键选择设置形状格式…...

【spring boot】初学者项目快速练手

一小时带你从0到1实现一个SpringBoot项目开发_哔哩哔哩_bilibili 一、简介 二、项目结构 三、代码结构 1.生成框架 Spring Initializr 快速生成一个初始的项目代码&#xff0c;会生成一个demo文件 打开intellj idea&#xff0c;导入demo文件 2.目录结构 源码都放在src-ma…...

Laravel+swoole 实现websocket长链接

需要使用 swoole 扩展 我使用的是 swoole 5.x start 方法启动服务 和 定时器 调整 listenQueue 定时器可以降低消息通讯延迟 定时器会自动推送队列里面的消息 testMessage 方法测试给指定用户推送消息 使用 laravel console 启动 <?phpnamespace App\Console\Comman…...

【C#】Array和List

C#中的List<T>和数组&#xff08;T[]&#xff09;在某些方面是相似的&#xff0c;因为它们都是用来存储一系列元素的集合。然而&#xff0c;它们在功能和使用上有一些重要的区别&#xff1a; 数组&#xff08;Array&#xff09; 固定大小&#xff1a;数组的大小在声明时…...

SpringCloud网关的实现原理与使用指南

Spring Cloud网关是一个基于Spring Cloud的微服务网关&#xff0c;它是一个独立的项目&#xff0c;可以对外提供API接口服务&#xff0c;负责请求的转发和路由。本文将介绍Spring Cloud网关的实现原理和使用指南。 一、Spring Cloud网关的实现原理 Spring Cloud网关基于Spring…...

LabVIEW 与 PLC 通讯方式

在工业自动化中&#xff0c;LabVIEW 与 PLC&#xff08;可编程逻辑控制器&#xff09;的通信至关重要&#xff0c;常见的通信方式包括 OPC、Modbus、EtherNet/IP、Profibus/Profinet 和 Serial&#xff08;RS232/RS485&#xff09;。这些通信协议各有特点和应用场景&#xff0c…...

数据结构初阶·排序算法(内排序)

目录 前言&#xff1a; 1 冒泡排序 2 选择排序 3 插入排序 4 希尔排序 5 快速排序 5.1 Hoare版本 5.2 挖坑法 5.3 前后指针法 5.4 非递归快排 6 归并排序 6.1递归版本归并 6.2 非递归版本归并 7 计数排序 8 排序总结 前言&#xff1a; 目前常见的排序算法有9种…...

PL/SQL oracle上多表关联的一些记录

1.记录自己在PL/SQL上写的几张表的关联条件没有跑出来的一些优化 1. join后面跟上筛选条件 left join on t1.id t2.id and --- 带上分区字段&#xff0c;如 t1.month 202405, 操作跑不出来的一些问题&#xff0c;可能是数据量过大&#xff0c;未做分区过滤 2. 创建…...

Java.Net.UnknownHostException:揭开网络迷雾,解锁异常处理秘籍

在Java编程的浩瀚宇宙中&#xff0c;java.net.UnknownHostException犹如一朵不时飘过的乌云&#xff0c;让开发者在追求网络畅通无阻的道路上遭遇小挫。但别担心&#xff0c;今天我们就来一场说走就走的探险&#xff0c;揭秘这个异常的真面目&#xff0c;并手把手教你几招应对之…...

第十课:telnet(远程登入)

如何远程管理网络设备&#xff1f; 只要保证PC和路由器的ip是互通的&#xff0c;那么PC就可以远程管理路由器&#xff08;用telnet技术管理&#xff09;。 我们搭建一个下面这样的简单的拓扑图进行介绍 首先我们点击云&#xff0c;把云打开&#xff0c;点击增加 我们绑定vmn…...

【概率论三】参数估计:点估计(矩估计、极大似然法)、区间估计

文章目录 一. 点估计1. 矩估计法2. 极大似然法2.1. 似然函数2.2. 极大似然估计法 3. 评价估计量的标准3.1. 无偏性3.2. 有效性3.3. 一致性 二. 区间估计1. 区间估计的概念2. 正态总体参数的区间估计 参数估计讲什么 由样本来确定未知参数参数估计分为点估计与区间估计 一. 点估…...

自动化产线 搭配数据采集监控平台 创新与突破

自动化产线在现在的各行各业中应用广泛&#xff0c;已经是现在的生产趋势&#xff0c;不同的自动化生产设备充斥在各行各业中&#xff0c;自动化的设备会产生很多的数据&#xff0c;这些数据如何更科学化的管理&#xff0c;更优质的利用&#xff0c;就需要数据采集监控平台来完…...

【Karapathy大神build-nanogpt】Take Away Notes

B站翻译LINK Personal Note Andrej rebuild gpt2 in pytorch. Take Away Points Before entereing serious training, he use Shakespear’s work as a small debugging datset to see if a model can overfit. Overfitging is a should thing.If we use TF32 or BF32, (by…...

MySQL学习记录 —— 이십이 MySQL服务器日志

文章目录 1、日志介绍2、一般、慢查询日志1、一般查询日志2、慢查询日志FILE格式TABLE格式 3、错误日志4、二进制日志5、日志维护 1、日志介绍 中继服务器的数据来源于集群中的主服务。每次做一些操作时&#xff0c;把操作保存到重做日志&#xff0c;这样崩溃时就可以从重做日志…...

HTTPS请求头缺少HttpOnly和Secure属性解决方案

问题描述&#xff1a; 建立Filter拦截器类 package com.ruoyi.framework.security.filter;import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.framework.…...

react基础样式控制

行内样式 <div style{{width:500px, height:300px,background:#ccc,margin:200px auto}}>文本</div> class类名 注意&#xff1a;在react中使用class类名必须使用className 在外部src下新建index.css文件写入你的样式 .fontcolor{color:red } 在用到的页面引入…...

【区块链 + 智慧政务】涉税行政事业性收费“e 链通”项目 | FISCO BCOS应用案例

国内很多城市目前划转至税务部门征收的非税收入项目已达 17 项&#xff0c;其征管方式为行政主管部门核定后交由税务 部门征收。涉税行政事业性收费受限于传统的管理模式&#xff0c;缴费人、业务主管部门、税务部门、财政部门四方处于 相对孤立的状态&#xff0c;信息的传递靠…...

Socket、WebSocket 和 MQTT 的区别

Socket 协议 定义&#xff1a;操作系统提供的网络通信接口&#xff0c;抽象了TCP/IP协议&#xff0c;支持TCP和UDP。特点&#xff1a; 通用性&#xff1a;不限于Web应用&#xff0c;适用于各种网络通信。协议级别&#xff1a;直接使用TCP/UDP&#xff0c;需要手动管理连接和数…...

vscode里如何用git

打开vs终端执行如下&#xff1a; 1 初始化 Git 仓库&#xff08;如果尚未初始化&#xff09; git init 2 添加文件到 Git 仓库 git add . 3 使用 git commit 命令来提交你的更改。确保在提交时加上一个有用的消息。 git commit -m "备注信息" 4 …...

css实现圆环展示百分比,根据值动态展示所占比例

代码如下 <view class""><view class"circle-chart"><view v-if"!!num" class"pie-item" :style"{background: conic-gradient(var(--one-color) 0%,#E9E6F1 ${num}%),}"></view><view v-else …...

树莓派超全系列教程文档--(62)使用rpicam-app通过网络流式传输视频

使用rpicam-app通过网络流式传输视频 使用 rpicam-app 通过网络流式传输视频UDPTCPRTSPlibavGStreamerRTPlibcamerasrc GStreamer 元素 文章来源&#xff1a; http://raspberry.dns8844.cn/documentation 原文网址 使用 rpicam-app 通过网络流式传输视频 本节介绍来自 rpica…...

遍历 Map 类型集合的方法汇总

1 方法一 先用方法 keySet() 获取集合中的所有键。再通过 gey(key) 方法用对应键获取值 import java.util.HashMap; import java.util.Set;public class Test {public static void main(String[] args) {HashMap hashMap new HashMap();hashMap.put("语文",99);has…...

使用分级同态加密防御梯度泄漏

抽象 联邦学习 &#xff08;FL&#xff09; 支持跨分布式客户端进行协作模型训练&#xff0c;而无需共享原始数据&#xff0c;这使其成为在互联和自动驾驶汽车 &#xff08;CAV&#xff09; 等领域保护隐私的机器学习的一种很有前途的方法。然而&#xff0c;最近的研究表明&…...

家政维修平台实战20:权限设计

目录 1 获取工人信息2 搭建工人入口3 权限判断总结 目前我们已经搭建好了基础的用户体系&#xff0c;主要是分成几个表&#xff0c;用户表我们是记录用户的基础信息&#xff0c;包括手机、昵称、头像。而工人和员工各有各的表。那么就有一个问题&#xff0c;不同的角色&#xf…...

网站指纹识别

网站指纹识别 网站的最基本组成&#xff1a;服务器&#xff08;操作系统&#xff09;、中间件&#xff08;web容器&#xff09;、脚本语言、数据厍 为什么要了解这些&#xff1f;举个例子&#xff1a;发现了一个文件读取漏洞&#xff0c;我们需要读/etc/passwd&#xff0c;如…...

Go 语言并发编程基础:无缓冲与有缓冲通道

在上一章节中&#xff0c;我们了解了 Channel 的基本用法。本章将重点分析 Go 中通道的两种类型 —— 无缓冲通道与有缓冲通道&#xff0c;它们在并发编程中各具特点和应用场景。 一、通道的基本分类 类型定义形式特点无缓冲通道make(chan T)发送和接收都必须准备好&#xff0…...

深入浅出深度学习基础:从感知机到全连接神经网络的核心原理与应用

文章目录 前言一、感知机 (Perceptron)1.1 基础介绍1.1.1 感知机是什么&#xff1f;1.1.2 感知机的工作原理 1.2 感知机的简单应用&#xff1a;基本逻辑门1.2.1 逻辑与 (Logic AND)1.2.2 逻辑或 (Logic OR)1.2.3 逻辑与非 (Logic NAND) 1.3 感知机的实现1.3.1 简单实现 (基于阈…...

云原生安全实战:API网关Kong的鉴权与限流详解

&#x1f525;「炎码工坊」技术弹药已装填&#xff01; 点击关注 → 解锁工业级干货【工具实测|项目避坑|源码燃烧指南】 一、基础概念 1. API网关&#xff08;API Gateway&#xff09; API网关是微服务架构中的核心组件&#xff0c;负责统一管理所有API的流量入口。它像一座…...