elasticsearch集群部署
一、创建 elasticsearch-cluster 文件夹
创建 elasticsearch-7.6.2-cluster文件夹
修改服务es服务文件夹为node-001
修改config/elasticsearch.yml 配置文件
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: my-elasticsearch
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1001
node.master: true
node.data: true
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: localhost
#
# Set a custom port for HTTP:
#
http.port: 1001
#tcp 监听端口 节点通信端口
transport.tcp.port: 9301
#只有一个节点的时候就得配置
discovery.seed_hosts: ["localhost:9302","localhost:9303"]
#discovery.zen.fd.ping_timeout: 1m
#discovery.zen.fd.ping_retries: 5
#集群内的可以被选为主节点的节点列表
cluster.initial_master_nodes: ["node-1001","node-1002","node-1003"]
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
#跨域配置
#action.destructive_requires_name: true
http.cors.enabled: true
http.cors.allow-origin: "*"
双击启动,bin/elasticsearch.bat
用postman 查看集群信息
GET http://127.0.0.1:1001/_cluster/health
返回结果
{"cluster_name": "my-elasticsearch","status": "green","timed_out": false,"number_of_nodes": 1,"number_of_data_nodes": 1,"active_primary_shards": 0,"active_shards": 0,"relocating_shards": 0,"initializing_shards": 0,"unassigned_shards": 0,"delayed_unassigned_shards": 0,"number_of_pending_tasks": 0,"number_of_in_flight_fetch": 0,"task_max_waiting_in_queue_millis": 0,"active_shards_percent_as_number": 100.0
}
二、创建其他节点
复制node-001,生成node-002,node-003
删除data下的数据,这里面有缓存,导致集群一直只能查到一个节点
修改各自配置文件
node-002
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: my-elasticsearch
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1002
node.master: true
node.data: true
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: localhost
#
# Set a custom port for HTTP:
#
http.port: 1002
#tcp 监听端口 节点通信端口
transport.tcp.port: 9302
#只有一个节点的时候就得配置
discovery.seed_hosts: ["localhost:9301","localhost:9303"]
discovery.zen.fd.ping_timeout: 1m
discovery.zen.fd.ping_retries: 5
#discovery.zen.fd.ping_timeout: 1m
#discovery.zen.fd.ping_retries: 5
#集群内的可以被选为主节点的节点列表
cluster.initial_master_nodes: ["node-1001","node-1002","node-1003"]#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
#跨域配置
#action.destructive_requires_name: true
http.cors.enabled: true
http.cors.allow-origin: "*"
node-003
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: my-elasticsearch
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1003
node.master: true
node.data: true
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: localhost
#
# Set a custom port for HTTP:
#
http.port: 1003
#tcp 监听端口 节点通信端口
transport.tcp.port: 9303
#只有一个节点的时候就得配置
discovery.seed_hosts: ["localhost:9301","localhost:9302"]
#discovery.zen.fd.ping_timeout: 1m
#discovery.zen.fd.ping_retries: 5
#集群内的可以被选为主节点的节点列表
cluster.initial_master_nodes: ["node-1001","node-1002","node-1003"]
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
#跨域配置
#action.destructive_requires_name: true
http.cors.enabled: true
http.cors.allow-origin: "*"
启动各自服务即可
如果出现第一个服务起不来,控制台报错,先不用管,这是因为master选举机制,票数不够,具体可看选举机制文档,这个时候多启一个服务就可以了;同理,服务挂的只剩一个的时候,最后一个节点也会报错,多启动一个就可以了。
相关文章:
elasticsearch集群部署
一、创建 elasticsearch-cluster 文件夹 创建 elasticsearch-7.6.2-cluster文件夹 修改服务es服务文件夹为node-001 修改config/elasticsearch.yml 配置文件 # Elasticsearch Configuration # # NOTE: Elasticsearch comes with reasonable defaults for most settings. # …...
python调用window库全屏截图生成bmp位图学习
import io import time import struct import ctypes s time.time() gdi32 ctypes.windll.gdi32 user32 ctypes.windll.user32# 定义常量 SM_CXSCREEN 0 SM_CYSCREEN 1# 缩放比例 zoom 1 screenWidth int(user32.GetSystemMetrics(SM_CXSCREEN) * zoom) screenHeight i…...
Wireshark使用
1.抓包过滤器--BPF语法 类型Type:主机(host)、网段(net)、端口(port) 方向Dir:源地址(src)、目标地址(dst) 协议Proto:各种…...
FLASK 上传文件
HTML form enctype"multipart/form-data" 编码类型说明application/x-www-form-urlencoded表单数据编码为名称/值对。 这是标准编码格式。multipart/form-data表单数据编码为消息,页面上每个控件都有单独的部分。text/plain表单数据以纯文本编码&#x…...
卷积神经网络
卷积神经网络 随着输入数据规模的增大,计算机视觉的处理难度也大幅增加。 64 64 3 64 \times 64 \times 3 64643 的图片特征向量维度为12288,而 1000 1000 3 1000 \times 1000 \times 3 100010003 的图片数据量达到了300万。随着数据维度的增加&am…...
SparrowRTOS系列:链表版本内核
前言 Sparrow RTOS是笔者之前写的一个极简性RTOS,初代版本只有400行,后面笔者又添加了消息队列、信号量、互斥锁三种IPC机制,使之成为一个较完整、堪用的内核,初代版本以简洁为主,使用数组和表作为任务挂载的抽象数据…...
【redis初阶】环境搭建
目录 一、Ubuntu 安装 redis 二、Centos7 安装 redis 三、Centos8 安装 redis 四、redis客户端介绍 redis学习🥳 一、Ubuntu 安装 redis 使用 apt 安装 apt install redis -y 查看redis版本 redis-server --version 支持远程连接…...
OpenCV相机标定与3D重建(54)解决透视 n 点问题(Perspective-n-Point, PnP)函数solvePnP()的使用
操作系统:ubuntu22.04 OpenCV版本:OpenCV4.9 IDE:Visual Studio Code 编程语言:C11 算法描述 根据3D-2D点对应关系找到物体的姿态。 cv::solvePnP 是 OpenCV 库中的一个函数,用于解决透视 n 点问题(Perspective-n-Po…...
shell脚本回顾1
1、shell 脚本写出检测 /tmp/size.log 文件如果存在显示它的内容,不存在则创建一个文件将创建时间写入。 一、 ll /tmp/size.log &>/dev/null if [ $? -eq 0 ];then cat /tmp/size.log else touch /tmp/size.log echo date > /tmp/size.log fi二、 if …...
HarmonyOS命令行工具
作为一个从Android转过来的鸿蒙程序猿,在开发过程中不由自主地想使用类似adb命令的命令行工具去安装/卸载应用,往设备上推或者拉去文件,亦或是抓一些日志。但是发现在鸿蒙里边,华为把命令行工具分的很细,种类相当丰富 …...
V少JS基础班之第四弹
一、 前言 第四弹内容是操作符。 本章结束。第一个月的内容就完成了, 是一个节点。 下个月我们就要开始函数的学习了。 我们学习完函数之后。很多概念就可以跟大家补充说明了。 OK,那我们就开始本周的操作符学习 本系列为一周一更,计划历时6…...
从前端视角看设计模式之创建型模式篇
设计模式简介 "设计模式"源于GOF(四人帮)合著出版的《设计模式:可复用的面向对象软件元素》,该书第一次完整科普了软件开发中设计模式的概念,他们提出的设计模式主要是基于以下的面向对象设计原则ÿ…...
网络应用技术 实验七:实现无线局域网
一、实验简介 在 eNSP 中构建无线局域网,并实现全网移动终端互相通信。 二、实验目的 1 、理解无线局域网的工作原理; 2 、熟悉无线局域网的规划与构建过程; 3 、掌握无线局域网的配置方法; 三、实验学时 2 学时 四、实…...
Kotlin 循环语句详解
文章目录 循环类别for-in 循环区间整数区间示例1:正向遍历示例2:反向遍历 示例1:遍历数组示例2:遍历区间示例3:遍历字符串示例4:带索引遍历 while 循环示例:计算阶乘 do-while 循环示例…...
B+树的原理及实现
文章目录 B树的原理及实现一、引言二、B树的特性1、结构特点2、节点类型3、阶数 三、B树的Java实现1、节点实现2、B树操作2.1、搜索2.2、插入2.3、删除2.4、遍历 3、B树的Java实现示例 四、总结 B树的原理及实现 一、引言 B树是一种基于B树的树形数据结构,它在数据…...
ArkTS 基础语法:声明式 UI 描述与自定义组件
1. ArkTS 简介 ArkTS 是 HarmonyOS 应用开发中的一种编程语言,它结合了 TypeScript 的类型检查和声明式 UI 描述方式,帮助开发者更高效地构建用户界面。 2. 声明式 UI 描述 ArkTS 使用声明式语法来定义 UI 结构,通过组件、属性和事件配置实…...
list的模拟实现详解
文章目录 list的模拟实现list的迭代器begin()和end() list的模拟实现 #pragma once #include<iostream> #include<list>using namespace std;namespace wbc {// 类模版template<class T>struct list_node // 链表的节点{T _data;list_node<T>* _next;…...
图解Git——分支的新建与合并《Pro Git》
⭐分支的新建与合并 先引入一个实际开发的工作流: 开发某个网站。为实现某个新的需求,创建一个分支。在这个分支上开展工作。 正在此时,你突然接到一个电话说有个很严重的问题需要紧急修补。你将按照如下方式来处理: 切换到你…...
SQLite 语法快速入门
SQLite 是一个软件库,实现了自给自足的、无服务器的、零配置的、事务性的 SQL 数据库引擎。 提供一个免费的在线SQLite编辑器 (0)常用命令 # 格式化 .header on .mode column .timer on# 查看表格 .tables# 查看表结构(建表语句) .schema …...
高速光电探测器设计 PIN APD铟镓砷TIA放大脉冲误码测试800-1700nm
高速光电探测器PIN APD铟镓砷TIA放大脉冲误码测试800-1700nm (对标:索雷博APD431A) (对标:索雷博APD431A) (对标:索雷博APD431A) 规格参数: 波长范围:800-1700nm 输出带宽:DC-400MHz(-3dB&…...
【Linux】【内存】Buddy内存分配基础 NUMA架构
【Linux】【内存】Buddy内存分配基础 NUMA架构 NUMA架构 在 NUMA 架构中,计算机的多个 CPU 被划分为不同的处理单元,每个处理单元有一个本地内存。这些内存被称为内存节点(memory node)。处理器尽量访问自己的本地内存 node_da…...
【机器学习:十九、反向传播】
1. 计算图和导数 计算图的概念 计算图(Computation Graph)是一种有向无环图,用于表示数学表达式中的计算过程。每个节点表示一个操作或变量,每条边表示操作的依赖关系。通过计算图,可以轻松理解和实现反向传播。 计算…...
使用中间件自动化部署java应用
为了实现你在 IntelliJ IDEA 中打包项目并通过工具推送到两个 Docker 服务器(172.168.0.1 和 172.168.0.12),并在推送后自动或手动重启容器,我们可以按照以下步骤进行操作: 在 IntelliJ IDEA 中配置 Maven 或 Gradle 打…...
Vue.js开发入门:从零开始搭建你的第一个项目
前言 嘿,小伙伴们!今天咱们来聊聊 Vue.js,一个超火的前端框架。如果你是编程小白,别怕,跟着我一步步来,保证你能轻松上手,搭建起属于自己的第一个 Vue 项目。Vue.js 可能听起来有点高大上&#…...
基于大语言模型的组合优化
摘要:组合优化(Combinatorial Optimization, CO)对于提高工程应用的效率和性能至关重要。随着问题规模的增大和依赖关系的复杂化,找到最优解变得极具挑战性。在处理现实世界的工程问题时,基于纯数学推理的算法存在局限…...
mySQL安装(LINUX)
一、1. 下载并安装MySQL官方的 Yum Repository 1、连接云服务器,进入opt 2、下载安装包 wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm 3、解压 rpm -ivh mysql-community-release-el7-5.noarch.rpm 4、安装 yum install mysql-commu…...
【机器学习】农业 4.0 背后的智慧引擎:机器学习助力精准农事决策
我的个人主页 我的领域:人工智能篇,希望能帮助到大家!!!👍点赞 收藏❤ 在当今数字化浪潮汹涌澎湃之际,农业领域正经历着一场前所未有的深刻变革,大踏步迈向农业 4.0时代。这一时代…...
在 Azure 100 学生订阅中新建一台 Ubuntu VPS,并通过 Docker 部署 Nginx 服务器
今天来和大家分享一下如何在 Azure 100 学生订阅中创建一台 Ubuntu VPS,并在其上通过 Docker 部署 Nginx 服务器。在这个过程中,我们将一步步走过每一个细节,希望能帮助到大家。 Docker 和 Nginx 简介 Docker 是一个开源的容器化平台&#…...
快速、可靠且高性价比的定制IP模式提升芯片设计公司竞争力
作者:Karthik Gopal,SmartDV Technologies亚洲区总经理 智权半导体科技(厦门)有限公司总经理 无论是在出货量巨大的消费电子市场,还是针对特定应用的细分芯片市场,差异化芯片设计带来的定制化需求也在芯片…...
Linux常用命令大全
mv详解目录 Linux 常用命令大全 1. ls 指令 2. touch 指令 3. pwd 指令 4. mkdir 指令 5. cd 指令 6. rmdir 和 rm 指令 7. man 指令 8. cp 指令 9. mv 指令 10. cat 指令 11. more 指令 12. less 指令 13. head 指令 14. tail 指令 15. find 指令 16. grep 指…...
K-均值聚类算法
K-均值聚类算法是一种常用的无监督学习算法,用于将数据集划分为K个不同的簇。它的基本思想是通过迭代将样本点划分到最相邻的簇中,以最小化各个簇内的平均距离。下面我们来详细讲解K-均值聚类算法的步骤及其优缺点。 步骤: 1. 随机选择K个质…...
Windows 环境下安装和启动 Redis 服务
在 Windows 环境下安装和启动 Redis 服务可以通过多种方式实现,下面将详细介绍几种常见的方法。我们将重点介绍通过 Chocolatey 包管理器、Docker 容器以及 MSOpenTech 提供的官方移植版来安装 Redis。 方法一:使用 Chocolatey 安装 Redis Chocolatey …...
关于在windows系统中编译ffmpeg并导入到自己项目中这件事
关于在windows系统中编译ffmpeg并导入到自己项目中这件事 前因(可跳过不看) 前阵子由于秋招需求,写了一个简易的安卓播放器,最终因为时间问题还有一些功能没有实现着实可惜,如:倍速播放,快进操…...
实战开发:基于用户反馈筛选与分析系统的实现
引言 在当今的数字化社会中,用户反馈是企业决策的重要依据。无论是电商平台、社交网络,还是产品服务,收集用户反馈并加以分析,有助于提升用户体验,改善服务质量。然而,面对海量的用户反馈,如何有…...
Android SystemUI——服务启动流程(二)
在 Andorid 系统源码中,package/apps下放的是系统内置的一些 APP,例如 Settings、Camera、Phone、Message 等等。而在 framework/base/package 下,它们也是系统的 APP,SystemUI 就在此目录下。它控制着整个 Android 系统的界面&am…...
拷贝构造函数
文章目录 一、4. 拷贝构造函数 今天我们来学习拷贝构造函数。 一、4. 拷贝构造函数 如果⼀个构造函数的第⼀个参数是自身类型的引用,且任何额外的参数都有默认值,则此叫做拷贝构造函数,也就是说拷贝构造是⼀个特殊的构造函数。 它的形式是这…...
解析OVN架构及其在OpenStack中的集成
引言 随着云计算技术的发展,虚拟化网络成为云平台不可或缺的一部分。为了更好地管理和控制虚拟网络,Open Virtual Network (OVN) 应运而生。作为Open vSwitch (OVS) 的扩展,OVN 提供了对虚拟网络抽象的支持,使得大规模部署和管理…...
面试加分项:Android Framework PMS 全面概述和知识要点
在Android面试时,懂得越多越深android framework的知识,越为自己加分。 目录 第一章:PMS 基础知识 1.1 PMS 定义与工作原理 1.2 PMS 的主要任务 1.3 PMS 与相关组件的交互 第二章:PMS 的核心功能 2.1 应用安装与卸载机制 2.2 应用更新与版本管理 2.3 组件管理 第…...
征服Windows版nginx(2)
1.配置Nginx 编辑Nginx的配置文件(通常是nginx.conf),找到安装Nginx位置,如下路径: D:\nginx-1.26.2\conf 双击打开nginx.CONF编辑,在http块中添加一个新的server块,用于指定Vue项目的静态文件…...
QML states和transitions的使用
一、介绍 1、states Qml states是指在Qml中定义的一组状态(States),用于管理UI元素的状态转换和属性变化。每个状态都包含一组属性值的集合,并且可以在不同的状态间进行切换。 通过定义不同的状态,可以在不同的应用场…...
flask_sqlalchemy relationship 子表排序
背景: 使用flask_sqlalchemy 的orm 时总不可避免的遇到子表排序问题 材料: 省略 制作: 直接看下面2段代码片段(一对多关系组合),自行理解: 1、多的一方实体 from .exts import db from f…...
python+pymysql
python操作mysql 一、python操作数据库 1、下载pymysql 库, 方法一:pip3 install pymysql 或pip install pymysql 方法二:在pycharm中setting下载pymysql 2、打开虚拟机上的数据库 3、pymysql连接 dbpymysql.Connection(host&qu…...
HAL库 中断相关函数
目录 中断相关函数 函数:HAL_SuspendTick()和HAL_ResumeTick() 涉及手册: 涉及寄存器: 涉及位: 函数:HAL_UART_IRQHandler(&huart3) 存在位置: 拓展: 函数:HAL_UARTEx…...
薪资协商注意事项
根据从AI(豆包kimi)中查询的内容,以及实际面试中的经验,进行整理,供大家参考: 薪资构成:了解薪水的固定工资、绩效、补贴、奖金及其他福利等具体构成。 进行沟通时需要确认清楚是税前还是税后沟…...
【机器学习】Kaggle实战Rossmann商店销售预测(项目背景、数据介绍/加载/合并、特征工程、构建模型、模型预测)
文章目录 1、项目背景2、数据介绍3、数据加载3.1 查看数据3.2 空数据处理3.2.1 训练数据3.2.2 测试数据3.3.3 商店数据处理3.3.4 销售时间关系 4、合并数据5、特征工程6、构建训练数据和测试数据7、数据属性间相关性系数8、提取模型训练的数据集9、构建模型9.1 定义评价函数9.2…...
简化计算步骤以减少误差
简化计算步骤以减少误差 同样一个计算问题,若能减少运算次数,既可以节省计算机的计算时间,还可以减小舍人误差。 例 计算 x 255 x^{255} x255的值. 如果逐个相乘要用 254 次乘法,但若写成 x 255 x ⋅ x 2 ⋅ x 4 ⋅ x 8 ⋅…...
利用AI大模型和Mermaid生成流程图
核心点1:利用大模型生成流程图的语句(Code) 确定业务流程: 用户需要明确要绘制的业务流程,包括主要步骤、决策点以及各步骤之间的关系。将确定的业务流程以文字形式描述出来。 生成Mermaid代码: 将描述好的…...
SqlServer 杂项知识整理
目录 一. decimal字段类型二. 查询时加锁 一. decimal字段类型 ⏹decimal(8,3): 整数5位,小数3位。一共8位。 如果输入 20,会自动格式化为 20.000如果输入 20.1,会自动格式化为 20.100 -- 给数据库新增一个字段,类型要求是decimal类型 ALT…...
【Uniapp-Vue3】@import导入css样式及scss变量用法与static目录
一、import导入css样式 在项目文件中创建一个common文件夹,下面创建一个css文件夹,里面放上style.css文件,编写的是公共样式,我们现在要在App.vue中引入该样式。 在App.vue中引入该样式,这样就会使样式全局生效&#…...
Maven 中 scope=provided 和 optional=true 的区别
先说效果,maven依赖声明中加了<scope>provided</scope>,或者加了<optional>true</optional>,从效果上看是一样的,都会中断依赖传递,观察下图: 图中,项目B分别依赖了C和…...