法院 公开网站建设情况/aso优化排名违法吗

法院 公开网站建设情况,aso优化排名违法吗,用什么网站推广,网站远程图片💢欢迎来到张胤尘的开源技术站 💥开源如江河,汇聚众志成。代码似星辰,照亮行征程。开源精神长,传承永不忘。携手共前行,未来更辉煌💥 文章目录 Etcd 服务搭建预编译的二进制文件安装下载 etcd 的…

💢欢迎来到张胤尘的开源技术站
💥开源如江河,汇聚众志成。代码似星辰,照亮行征程。开源精神长,传承永不忘。携手共前行,未来更辉煌💥

文章目录

  • Etcd 服务搭建
    • 预编译的二进制文件安装
      • 下载 `etcd` 的压缩包
      • 解压文件
      • 将可执行文件移动到系统路径
      • 验证版本
      • 配置 `etcd` 服务
        • 创建配置文件
        • 创建 `systemd` 服务文件
        • 启动 `etcd` 服务
        • 检查服务状态
    • 源代码编译安装
      • 克隆 `etcd` 仓库
      • 编译代码
      • 将编译后的文件移动到系统路径
      • 验证版本
      • 配置 `etcd` 服务
        • 创建配置文件
        • 创建 `systemd` 服务文件
        • 启动 `etcd` 服务
        • 检查服务状态
    • 包管理器安装
      • `Ubuntu`
      • `CentOS`
      • `Fedora`
    • `docker` 容器化安装
      • 拉取官方镜像
      • 默认配置文件
      • 启动 `etcd` 容器
      • 验证
    • 认证配置
      • 添加用户并设置密码
      • 创建角色
      • 为角色授予权限
      • 为用户分配角色
      • 开启认证功能
      • 服务重启
      • 验证

Etcd 服务搭建

在 Linux 上安装 etcd 服务可以通过几种方式进行:预编译的二进制文件安装、源代码编译安装、使用包管理器安装、docker 容器化安装。

预编译的二进制文件安装

下载 etcd 的压缩包

访问 etcd 的 GitHub Releases 页面:etcd

选择适合您系统的版本(例如 v3.5.19 或其他版本),并使用以下命令下载:

wget https://github.com/etcd-io/etcd/releases/download/v3.5.19/etcd-v3.5.19-linux-amd64.tar.gz

或者直接使用 curl 命令下载:

curl -L https://github.com/etcd-io/etcd/releases/download/v3.5.19/etcd-v3.5.19-linux-amd64.tar.gz -o etcd-v3.5.19-linux-amd64.tar.gz

解压文件

解压下载的压缩包:

tar -xvf etcd-v3.5.19-linux-amd64.tar.gz
cd etcd-v3.5.19-linux-amd64

将可执行文件移动到系统路径

etcdetcdctl 移动到 /usr/local/bin 目录,使其全局可用:

sudo mv etcd etcdctl /usr/local/bin/

验证版本

检查 etcd 的版本信息:

$ etcd --version
etcd Version: 3.5.19
Git SHA: 815eaba
Go Version: go1.23.7
Go OS/Arch: linux/amd64
$ etcdctl version
etcdctl version: 3.5.19
API version: 3.5

配置 etcd 服务

安装完成后,需要配置 etcd 服务以确保其正常运行:

创建配置文件

创建 /etc/etcd.conf 文件并添加配置:

cat <<EOF | sudo tee /etc/etcd.conf
ETCD_NAME=$(hostname -s)
ETCD_DATA_DIR=/var/lib/etcd/
EOF
创建 systemd 服务文件

创建 /etc/systemd/system/etcd.service 文件:

cat <<EOF | sudo tee /etc/systemd/system/etcd.service
[Unit]
Description=Etcd Server
Documentation=https://github.com/coreos/etcd
After=network.target[Service]
User=root
Type=notify
EnvironmentFile=-/etc/etcd.conf
ExecStart=/usr/local/bin/etcd
Restart=on-failure
RestartSec=10s
LimitNOFILE=40000[Install]
WantedBy=multi-user.target
EOF
启动 etcd 服务
sudo systemctl daemon-reload
sudo systemctl enable etcd
sudo systemctl start etcd
检查服务状态
sudo systemctl status etcd

源代码编译安装

如果需要最新功能或定制化版本,可以从源代码编译 etcd

克隆 etcd 仓库

git clone -b v3.5.19 https://github.com/etcd-io/etcd.git
cd etcd

编译代码

运行构建脚本:

./build.sh

将编译后的文件移动到系统路径

sudo mv bin/etcd /usr/local/bin/
sudo mv bin/etcdctl /usr/local/bin/

验证版本

检查 etcd 的版本信息:

$ etcd --version
etcd Version: 3.5.19
Git SHA: 815eaba
Go Version: go1.23.7
Go OS/Arch: linux/amd64
$ etcdctl version
etcdctl version: 3.5.19
API version: 3.5

配置 etcd 服务

安装完成后,需要配置 etcd 服务以确保其正常运行:

创建配置文件

创建 /etc/etcd.conf 文件并添加配置:

cat <<EOF | sudo tee /etc/etcd.conf
ETCD_NAME=$(hostname -s)
ETCD_DATA_DIR=/var/lib/etcd/
EOF
创建 systemd 服务文件

创建 /etc/systemd/system/etcd.service 文件:

cat <<EOF | sudo tee /etc/systemd/system/etcd.service
[Unit]
Description=Etcd Server
Documentation=https://github.com/coreos/etcd
After=network.target[Service]
User=root
Type=notify
EnvironmentFile=-/etc/etcd.conf
ExecStart=/usr/local/bin/etcd
Restart=on-failure
RestartSec=10s
LimitNOFILE=40000[Install]
WantedBy=multi-user.target
EOF
启动 etcd 服务
sudo systemctl daemon-reload
sudo systemctl enable etcd
sudo systemctl start etcd
检查服务状态
sudo systemctl status etcd

包管理器安装

虽然大多数 Linux 发行版的包管理器中包含 etcd,但是这些版本可能较旧。如果需要最新版本,建议使用预编译的二进制文件。

如果是实际生成环境不推荐使用该安装方法。

Ubuntu

sudo apt-get update
sudo apt-get install etcd

CentOS

sudo yum install etcd

Fedora

sudo dnf install etcd

docker 容器化安装

Docker hub

拉取官方镜像

从 Docker Hub 拉取 etcd 的官方镜像。例如,拉取最新版本的 etcd

docker pull bitnami/etcd:latest

或者指定特定版本:

docker pull bitnami/etcd:3.5.19

拉取完成后,查看镜像信息:

$ sudo docker images
REPOSITORY     TAG       IMAGE ID       CREATED       SIZE
bitnami/etcd   latest    c8fb74306c9b   2 days ago    192MB

默认配置文件

默认配置文件如下所示(使用时需要根据实际的情况进行修改):

# This is the configuration file for the etcd server.# Human-readable name for this member.
name: 'default'# Path to the data directory.
data-dir: /bitnami/etcd/data# Path to the dedicated wal directory.
wal-dir: # Number of committed transactions to trigger a snapshot to disk.
snapshot-count: 10000# Time (in milliseconds) of a heartbeat interval.
heartbeat-interval: 100# Time (in milliseconds) for an election to timeout.
election-timeout: 1000# Raise alarms when backend size exceeds the given quota. 0 means use the
# default quota.
quota-backend-bytes: 0# List of comma separated URLs to listen on for peer traffic.
listen-peer-urls: http://localhost:2380# List of comma separated URLs to listen on for client traffic.
listen-client-urls: http://localhost:2379# Maximum number of snapshot files to retain (0 is unlimited).
max-snapshots: 5# Maximum number of wal files to retain (0 is unlimited).
max-wals: 5# Comma-separated white list of origins for CORS (cross-origin resource sharing).
cors:# List of this member's peer URLs to advertise to the rest of the cluster.
# The URLs needed to be a comma-separated list.
initial-advertise-peer-urls: http://localhost:2380# List of this member's client URLs to advertise to the public.
# The URLs needed to be a comma-separated list.
advertise-client-urls: http://localhost:2379# Discovery URL used to bootstrap the cluster.
discovery:# Valid values include 'exit', 'proxy'
discovery-fallback: 'proxy'# HTTP proxy to use for traffic to discovery service.
discovery-proxy:# DNS domain used to bootstrap initial cluster.
discovery-srv:# Initial cluster configuration for bootstrapping.
initial-cluster:# Initial cluster token for the etcd cluster during bootstrap.
initial-cluster-token: 'etcd-cluster'# Initial cluster state ('new' or 'existing').
initial-cluster-state: 'new'# Reject reconfiguration requests that would cause quorum loss.
strict-reconfig-check: false# Accept etcd V2 client requests
enable-v2: true# Enable runtime profiling data via HTTP server
enable-pprof: true# Valid values include 'on', 'readonly', 'off'
proxy: 'off'# Time (in milliseconds) an endpoint will be held in a failed state.
proxy-failure-wait: 5000# Time (in milliseconds) of the endpoints refresh interval.
proxy-refresh-interval: 30000# Time (in milliseconds) for a dial to timeout.
proxy-dial-timeout: 1000# Time (in milliseconds) for a write to timeout.
proxy-write-timeout: 5000# Time (in milliseconds) for a read to timeout.
proxy-read-timeout: 0client-transport-security:# Path to the client server TLS cert file.cert-file:# Path to the client server TLS key file.key-file:# Enable client cert authentication.client-cert-auth: false# Path to the client server TLS trusted CA cert file.trusted-ca-file:# Client TLS using generated certificatesauto-tls: falsepeer-transport-security:# Path to the peer server TLS cert file.cert-file:# Path to the peer server TLS key file.key-file:# Enable peer client cert authentication.client-cert-auth: false# Path to the peer server TLS trusted CA cert file.trusted-ca-file:# Peer TLS using generated certificates.auto-tls: false# Allowed CN for inter peer authentication.allowed-cn:# Allowed TLS hostname for inter peer authentication.allowed-hostname:# The validity period of the self-signed certificate, the unit is year.
self-signed-cert-validity: 1# Enable debug-level logging for etcd.
log-level: debuglogger: zap# Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd.
log-outputs: [stderr]# Force to create a new one member cluster.
force-new-cluster: falseauto-compaction-mode: periodic
auto-compaction-retention: "1"

启动 etcd 容器

sudo docker run -d --name etcd \--restart=always \--user $(id -u):$(id -g) \-p 2379:2379 \-p 2380:2380 \-e ETCD_ROOT_PASSWORD="123456" \-v /configPath/etcd.yaml:/opt/bitnami/etcd/conf/etcd.yaml \-v /dataPath/data:/bitnami/etcd \bitnami/etcd:latest
  • -d:后台运行容器。
  • --name etcd:为容器指定名称 etcd
  • --restart=always:设置容器的重启策略为 always。这意味着无论容器因何种原因退出(正常退出或异常退出),都会自动重启该容器。
  • --user $(id -u):$(id -g):指定容器运行的用户和用户组。如果是生产环境,则需要严格按照实际的环境信息来配置运行的权限
  • -p 2379:2379:将容器的 etcd 客户端端口(2379)映射到宿主机的 2379 端口。
  • -p 2380:2380:将容器的 etcd 节点间通信端口(2380)映射到宿主机的 2380 端口。
  • -e ETCD_ROOT_PASSWORD="123456":初始化 root 用户的密码。(需要根据实际环境配置)
  • -v /configPath/etcd.yaml:/opt/bitnami/etcd/conf/etcd.yaml:自定义的 etcd 配置文件传递给容器,容器将使用该配置文件启动 etcd 服务。( configPath 需要根据实际环境配置)
  • -v /dataPath/data:/bitnami/etcd:自定义数据目录,etcd 容器中使用该数据目录启动服务。( dataPath 需要根据实际环境配置)
  • bitnami/etcd:latest:使用的 etcd 镜像名称和版本信息。

验证

检查 etcd 容器是否成功启动:

$ docker ps
CONTAINER ID   IMAGE                 COMMAND                   CREATED         STATUS         PORTS                                                                                      NAMES
956e2cb3227e   bitnami/etcd:latest   "/opt/bitnami/script…"   3 minutes ago   Up 3 minutes   0.0.0.0:2379->2379/tcp, [::]:2379->2379/tcp, 0.0.0.0:2380->2380/tcp, [::]:2380->2380/tcp   etcd

使用 etcdctl 工具验证 etcd 是否正常运行:

$ docker exec -it etcd etcdctl --user root:123456 --endpoints=:2379 put testK testV
OK
$ docker exec -it etcd etcdctl --user root:123456 --endpoints=:2379 get testK
testK
testV

认证配置

添加用户并设置密码

使用 etcdctl 工具添加用户并设置密码。例如,添加一个名为 root 的用户:

etcdctl user add root

系统会提示输入密码,输入两次相同的密码完成设置。

创建角色

首先,需要创建一个角色(如果尚未创建)。例如,创建一个名为 root 的角色:

etcdctl role add root

为角色授予权限

接下来,为角色授予权限。例如,授予 root 角色对所有键的读写权限:

etcdctl role grant-permission root readwrite --prefix /
  • --prefix / 表示对所有键(包括子路径)授予权限。
  • 如果只想授予对特定键的权限,可以指定键名,例如:
etcdctl role grant-permission root readwrite /specific-key

为用户分配角色

最后,将角色分配给用户。例如,为用户 root 分配 root 角色:

etcdctl user grant-role root root
  • 第一个 root 是用户名。
  • 第二个 root 是角色名。

开启认证功能

启用 etcd 认证功能:

$ etcdctl auth enable
Authentication Enabled

服务重启

配置文件修改后,需要重启 etcd 服务以使配置生效:

sudo systemctl restart etcd

验证

  • 验证:不输入用户名密码报错
$ etcdctl put testK testV
{**** "error":"rpc error: code = InvalidArgument desc = etcdserver: user name is empty"}
  • 验证:输入用户名密码,但是密码错误报错
$ etcdctl --user root:1234567 put testK testV
{**** "error":"rpc error: code = InvalidArgument desc = etcdserver: authentication failed, invalid user ID or password"}
  • 验证:输入正确的用户名密码,可以正常访问
$ etcdctl --user root:123456 put testK testV
OK
$ etcdctl --user root:123456 get testK
testK
testV

🌺🌺🌺撒花!

如果本文对你有帮助,就点关注或者留个👍
如果您有任何技术问题或者需要更多其他的内容,请随时向我提问。
在这里插入图片描述

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

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

相关文章

EmbodiedSAM:在线实时3D实例分割,利用视觉基础模型实现高效场景理解

2025-02-12&#xff0c;由清华大学和南洋理工大学的研究团队开发 一种名为 EmbodiedSAM&#xff08;ESAM&#xff09;的在线3D实例分割框架。该框架利用2D视觉基础模型辅助实时3D场景理解&#xff0c;解决了高质量3D数据稀缺的难题&#xff0c;为机器人导航、操作等任务提供了高…

信创-人大金仓数据库创建

一. 官文 资源下载地址 https://download.kingbase.com.cn/xzzx/index.htm 下载安装文件 下载授权文件 产品文档地址&#xff1a;https://help.kingbase.com.cn/v8/index.html 二. 概念 2.1 体系结构 ‌ 实例结构 ‌&#xff1a;由数据库文件和 KingbaseES 实例组成。数据…

HCIA-AI人工智能笔记3:数据预处理

统讲解数据预处理的核心技术体系&#xff0c;通过Python/Pandas与华为MindSpore双视角代码演示&#xff0c;结合特征工程优化实验&#xff0c;深入解析数据清洗、标准化、增强等关键环节。 一、数据预处理技术全景图 graph TD A[原始数据] --> B{数据清洗} B --> B1[缺…

G-Star 校园开发者计划·黑科大|开源第一课之 Git 入门

万事开源先修 Git。Git 是当下主流的分布式版本控制工具&#xff0c;在软件开发、文档管理等方面用处极大。它能自动记录文件改动&#xff0c;简化合并流程&#xff0c;还特别适合多人协作开发。学会 Git&#xff0c;就相当于掌握了一把通往开源世界的钥匙&#xff0c;以后参与…

WEB攻防-PHP反序列化-字符串逃逸

目录 前置知识 字符串逃逸-减少 字符串逃逸-增多 前置知识 1.PHP 在反序列化时&#xff0c;语法是以 ; 作为字段的分隔&#xff0c;以 } 作为结尾&#xff0c;在结束符}之后的任何内容不会影响反序列化的后的结果 class people{ public $namelili; public $age20; } var_du…

把生产队的大模型Grok 3 beta用来实现字帖打磨

第一个版本&#xff0c;就是简单的田字格&#xff0c;Grok 3 beta 思考了15s就得到了html前端代码&#xff0c;javascript; 然而还不完美&#xff1b; 第二个版本&#xff0c;进一步&#xff0c;通过pinyin项目给汉字加上注音&#xff0c;米字格和四线格&#xff1b;&#xff…

windows+ragflow+deepseek实战之一excel表查询

ragflows平台部署参考文章 Win10系统Docker+DeepSeek+ragflow搭建本地知识库 ragflow通过python实现参考这篇文章 ragflow通过python实现 文章目录 背景效果1、准备数据2、创建知识库3、上传数据并解析4、新建聊天助理5、测试会话背景 前面已经基于Win10系统Docker+DeepSeek+…

【架构】单体架构 vs 微服务架构:如何选择最适合你的技术方案?

文章目录 ⭐前言⭐一、架构设计的本质差异&#x1f31f;1、代码与数据结构的对比&#x1f31f;2、技术栈的灵活性 ⭐二、开发与维护的成本博弈&#x1f31f;1、开发效率的阶段性差异&#x1f31f;2、维护成本的隐形陷阱 ⭐三、部署与扩展的实战策略&#x1f31f;1、部署模式的本…

C#实现分段三次Hermite插值

目录 一、Hermite插值介绍 1、功能说明 2、数学方法 二、代码实现 1、CubicHermiteInterpolator类封装 2、应用示例 三、导数值的获取方式 1、数学方法介绍 2、代码应用示例 四、其它封装的分段三次Hermite插值类 1、方式一 &#xff08;1&#xff09;封装代码 &…

重要重要!!fisher矩阵元素有什么含义和原理; Fisher 信息矩阵的形式; 得到fisher矩阵之后怎么使用

fisher矩阵元素有什么含义和原理 目录 fisher矩阵元素有什么含义和原理一、对角线元素( F i , i F_{i,i} Fi,i​)的含义与原理二、非对角线元素( F i , j F_{i,j} Fi,j​)的含义与原理Fisher 信息矩阵的形式矩阵的宽度有位置权重数量决定1. **模型参数结构决定矩阵维度**2.…

docker速通

docker 镜像操作搜索镜像拉取镜像查看镜像删除镜像 容器操作!查看容器运行容器run命令详细介绍 启动容器停止容器重启容器查看容器状态查看容器日志删除容器进入容器 保存镜像提交保存加载 分享社区登录命名推送 docker存储目录挂载卷映射查看所有容器卷创建容器卷查看容器卷详…

Python、MATLAB和PPT完成数学建模竞赛中的地图绘制

参加数学建模比赛时&#xff0c;很多题目——诸如统计类、数据挖掘类、环保类、建议类的题目总会涉及到地理相关的情景&#xff0c;往往要求我们制作与地图相关的可视化内容。如下图&#xff0c;这是21年亚太赛的那道塞罕坝的题目&#xff0c;期间涉及到温度、降水和森林覆盖率…

DeepSeek R1 本地部署指南 (3) - 更换本地部署模型 Windows/macOS 通用

0.准备 完成 Windows 或 macOS 安装&#xff1a; DeepSeek R1 本地部署指南 (1) - Windows 本地部署-CSDN博客 DeepSeek R1 本地部署指南 (2) - macOS 本地部署-CSDN博客 以下内容 Windows 和 macOS 命令执行相同&#xff1a; Windows 管理员启动&#xff1a;命令提示符 CMD ma…

k8s中service概述(二)NodePort

NodePort 是 Kubernetes 中一种用于对外暴露服务的 Service 类型。它通过在集群的每个节点上开放一个静态端口&#xff08;NodePort&#xff09;&#xff0c;使得外部用户可以通过节点的 IP 地址和该端口访问集群内部的服务。以下是关于 NodePort Service 的详细说明&#xff1…

Linux系统崩溃破案实录

现代计算环境中&#xff0c;系统的稳定性和可靠性至关重要。然而&#xff0c;即使是最优化的系统也可能会由于硬件故障、软件漏洞或配置错误而崩溃。为了解决这一问题&#xff0c;Linux系统提供了强大的内核崩溃转储机制&#xff0c;本文介绍如何收集和分析崩溃日志&#xff0c…

tcping 命令的使用,ping IP 和端口

1. ‌Windows系统安装‌ ‌下载tcping工具‌&#xff1a;根据系统位数&#xff08;32位或64位&#xff09;下载对应的tcping.exe文件。‌安装步骤‌&#xff1a; 将下载的tcping.exe文件复制到C:\Windows\System32目录下。如果下载的是64位版本&#xff0c;需将文件名改为tcpi…

深度学习框架PyTorch——从入门到精通(6.1)自动微分

使用torch.autograd自动微分 张量、函数和计算图计算梯度禁用梯度追踪关于计算图的更多信息张量梯度和雅可比乘积 在训练神经网络时&#xff0c;最常用的算法是反向传播。在该算法中&#xff0c;参数&#xff08;模型权重&#xff09;根据损失函数的梯度相对于给定参数进行调整…

阶跃星辰开源300亿参数视频模型Step-Video-TI2V:运动可控+102帧长视频生成

阶跃星辰&#xff08;StepFun&#xff09;正式开源其新一代图生视频模型 Step-Video-TI2V &#xff0c;该模型基于300亿参数的Step-Video-T2V训练&#xff0c;支持文本与图像联合驱动生成长达102帧的高质量视频&#xff0c;在运动控制与场景适配性上实现突破。 核心亮点 …

HeyGem.ai 全离线数字人生成引擎加入 GitCode:开启本地化 AIGC 创作新时代

在人工智能技术飞速演进的时代&#xff0c;数据隐私与创作自由正成为全球开发者关注的焦点。硅基智能旗下开源项目 HeyGem.ai 近日正式加入 GitCode&#xff0c;以全球首个全离线数字人生成引擎的颠覆性技术&#xff0c;重新定义人工智能生成内容&#xff08;AIGC&#xff09;的…

VSCODE右下角切换环境没用

VSCODE惦记右下角python版本&#xff0c;切换别的虚拟环境时&#xff0c;始终切换不了&#xff0c;同时右下角弹出&#xff1a; Client Pylance: connection to server is erroring. 取消继承环境也改了。https://www.cnblogs.com/coreylin/p/17509610.html 还是不行&#xf…