docker的安装以及docker中nginx配置

news/2024/5/19 7:31:46

机器 test3 192.168.23.103

1机器初始化配置

1.1关闭防火墙,清空防火墙规则

systemctl stop firewalld
iptables -F
setenforce 0

1.2部署时间同步

yum install ntp ntpdate -y

1.3安装基础软件包

yum install -y wget net-tools nfs-utils lrzsz gcc gcc-c++ make cmake libxml2-devel openssl-devel curl curl-devel unzip sudo ntp libaio-devel wget vim ncurses-devel autoconf automake zlib-devel python-devel epel-release openssh-server socat ipvsadm conntrack

1.4构建docker-ce源

https://developer.aliyun.com/mirror/
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
yum makecache fast
yum -y install docker-ce
1.5启动docker
systemctl  restart docker && systemctl enable docker

2.docker的配置

2.1要是想要docker能被其他服务器访问,要是想要docker相互之间通信没有问题,需要修改内核参数,开启包转发功能,内核参数修改,br_netfilter 模块用于将桥接流量转发至iptables链,
[root@test3 ~]# modprobe br_netfilter
模块可以通过这个命令看有没有开启
[root@test3 ~]# lsmod |grep br_netfilter
br_netfilter           22256  0 
bridge                151336  1 br_netfilter[root@test3 ~]# cat > /etc/sysctl.d/docker.conf << EOF
> net.bridge.bridge-nf-call-ip6tables = 1
> net.bridge.bridge-nf-call-iptables = 1 
> net.ipv4.ip_forward = 1
> EOF
具体功能如下
Docker 安装后出现:WARNING: bridge-nf-call-iptables is disabled 的解决办法: 
net.bridge.bridge-nf-call-ip6tables = 1 
net.bridge.bridge-nf-call-iptables = 1net.ipv4.ip_forward = 1: 
将 Linux 系统作为路由或者 VPN 服务就必须要开启 IP 转发功能。当 linux 主机有多个网卡时一个网卡收
到的信息是否能够传递给其他的网卡 ,如果设置成 1 的话 可以进行数据包转发,可以实现 VxLAN 等功
能。不开启会导致 docker 部署应用无法访问。使模块生效
[root@test3 ~]#  sysctl -p /etc/sysctl.d/docker.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1重启后模块失效,下面是开机自动加载模块的脚本 
在/etc/新建 rc.sysinit 文件 
cat /etc/rc.sysinit 
#!/bin/bash 
for file in /etc/sysconfig/modules/*.modules ; do 
[ -x $file ] && $file 
donecat /etc/sysconfig/modules/br_netfilter.modules 
modprobe br_netfilter 增加权限
chmod 755 /etc/sysconfig/modules/br_netfilter.modules这样即使重启也会加载模块 

配置阿里云镜像加速器地址

https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors 

在这里插入图片描述

docker镜像相关的操作

从dockerhub上查找镜像
[root@test3 ~]# docker search centos
NAME                               DESCRIPTION                                     STARS     OFFICIAL
centos                             DEPRECATED; The official build of CentOS.       7721      [OK]
kasmweb/centos-7-desktop           CentOS 7 desktop for Kasm Workspaces            43        
bitnami/centos-base-buildpack      Centos base compilation image                   0         
dokken/centos-7                    CentOS 7 image for kitchen-dokken               10        
dokken/centos-8                    CentOS 8 image for kitchen-dokken               6         
spack/centos7                      CentOS 7 with Spack preinstalled                2         
dokken/centos-6                    EOL: CentOS 6 image for kitchen-dokken          0         
atlas/centos7-atlasos              ATLAS CentOS 7 Software Development OS          3         
ustclug/centos                     Official CentOS Image with USTC Mirror          0         
spack/centos6                      CentOS 6 with Spack preinstalled                1         
dokken/centos-stream-8                                                             5         
eclipse/centos_jdk8                CentOS, JDK8, Maven 3, git, curl, nmap, mc, …   5         
dokken/centos-stream-9                                                             10        
corpusops/centos-bare              https://github.com/corpusops/docker-images/     0         
corpusops/centos                   centos corpusops baseimage                      0         
eclipse/centos_go                  Centos + Go                                     0         
spack/centos-stream                                                                2         
fnndsc/centos-python3              Source for a slim Centos-based Python3 image…   0         
eclipse/centos_spring_boot         Spring boot ready image based on CentOS         0         
openmicroscopy/centos-systemd-ip   centos/systemd with iproute, for testing mul…   0         
eclipse/centos                     CentOS based minimal stack with only git and…   1         
eclipse/centos_nodejs              CentOS based nodejs4 stack                      0         
eclipse/centos_vertx               CentOS + vertx                                  0         
eclipse/centos_wildfly_swarm       CentOS, WildFly, Swarm                          0         
dockette/centos                    My Custom CentOS Dockerfiles                    1         解释说明
NAME: 镜像仓库的名称
DESCRIPTION:镜像的描述
STARS:类似 github 里面的star,表示点赞,喜欢的意思
OFFICIAL:是否 docker 官方发布

拉取镜像

[root@test3 ~]# docker pull centos

查看有哪些镜像

[root@test3 ~]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
centos       latest    5d0da3dc9764   2 years ago   231MB

把镜像做成离线压缩包

[root@test3 ~]# ls
anaconda-ks.cfg
[root@test3 ~]# docker save -o centos.tar.gz centos
[root@test3 ~]# ls
anaconda-ks.cfg  centos.tar.gz

解压

[root@test3 ~]# docker load -i centos.tar.gz 
Loaded image: centos:latest

删除镜像

docker rmi -f centos:latest

容器相关的操作

以交互式启动并运行容器
[root@test3 ~]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
centos       latest    5d0da3dc9764   2 years ago   231MB
[root@test3 ~]# docker run --name=hello -it centos /bin/bash
[root@573ed31d77d8 /]# #docker run 运行并创建容器
--name 容器的名字
-i 交互式
-t 分配终端
centos:启动docker 需要的镜像
bin/bash 说明你的shell 类型为bash   bash是一种最常用的shell 是大多数 linux 发行版默认的shell 此外还有 c shell 等其他的shell#在起一个终端看一下   docker ps 是查看正在运行的容器
[root@test3 ~]# docker ps
CONTAINER ID   IMAGE     COMMAND       CREATED         STATUS         PORTS     NAMES
573ed31d77d8   centos    "/bin/bash"   6 seconds ago   Up 5 seconds             hello
CONTAINER ID:容器的idIMAGE:容器使用的镜像COMMAND:容器运行的命令STATUS:容器启动的时间PORTS : 容器的名字#以守护式进程方式启动容器
[root@test3 ~]# docker run --name=hello1 -itd centos /bin/bash
ae2fe03e778aa2fbd0b9ba2ac412ff3b2f17eaf04772028e1ab4670fd9bdd7fe
d 表示后台运行#进入hello1的容器
[root@test3 ~]# docker exec -it hello1 /bin/bash
[root@ae2fe03e778a /]# #我们退出会发现 容器他依然运行
[root@test3 ~]# docker exec -it hello1 /bin/bash
[root@ae2fe03e778a /]# exit
exit
[root@test3 ~]# docker ps
CONTAINER ID   IMAGE     COMMAND       CREATED         STATUS         PORTS     NAMES
ae2fe03e778a   centos    "/bin/bash"   3 minutes ago   Up 3 minutes             hello1
[root@test3 ~]# docker ps 会列出正在运行的容器
docker ps -a 会列出正在运行的和已经停止的容器全部都列出来#查看容器日志
[root@test3 ~]# docker logs hello1
[root@test3 ~]# 运行和停止容器
[root@test3 ~]# docker stop hello1
hello1
[root@test3 ~]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
[root@test3 ~]# docker ps -a
CONTAINER ID   IMAGE     COMMAND       CREATED          STATUS                     PORTS     NAMES
ae2fe03e778a   centos    "/bin/bash"   7 minutes ago    Exited (0) 8 seconds ago             hello1
573ed31d77d8   centos    "/bin/bash"   26 minutes ago   Exited (0) 8 minutes ago             hello
[root@test3 ~]# docker start hello1
hello1
[root@test3 ~]# docker ps
CONTAINER ID   IMAGE     COMMAND       CREATED         STATUS         PORTS     NAMES
ae2fe03e778a   centos    "/bin/bash"   8 minutes ago   Up 2 seconds             hello1
[root@test3 ~]# docker rm -f hello
hello
[root@test3 ~]# docker ps -a
CONTAINER ID   IMAGE     COMMAND       CREATED         STATUS          PORTS     NAMES
ae2fe03e778a   centos    "/bin/bash"   8 minutes ago   Up 48 seconds             hello1

docker部署nginx

[root@test3 ~]# docker run --name nginx -p 80 -itd centos
3bd4aa598dd007dc8aba6f43f67d9bd5610e885b724910679edb2694325c8a78
-p 把容器断端口 随机在物理机映射一个端口#进入容器
[root@test3 ~]# docker exec -it nginx /bin/bash
[root@3bd4aa598dd0 /]# 
#此时安装你会发现他会报错
[root@3bd4aa598dd0 /]# yum install wget
Failed to set locale, defaulting to C.UTF-8
CentOS Linux 8 - AppStream                                                                                                                                                         78  B/s |  38  B     00:00    
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
[root@3bd4aa598dd0 /]# #解决,删除/etc/yum.repos.d/所有文件,把阿里云的镜像重写进去
[root@3bd4aa598dd0 /]# rm -rf /etc/yum.repos.d/* 
[root@3bd4aa598dd0 yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed
100  2495  100  2495    0     0  25202      0 --:--:-- --:--:-- --:--:-- 25202#此时下载就可以了
[root@3bd4aa598dd0 yum.repos.d]# yum install nginx vim -y
Failed to set locale, defaulting to C.UTF-8
CentOS-8.5.2111 - Base - mirrors.aliyun.com                                                                                                                                       1.2 MB/s | 4.6 MB     00:03    
CentOS-8.5.2111 - Extras - mirrors.aliyun.com                                                                                                                                      64 kB/s |  10 kB     00:00    
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com                                                                                                                                  2.1 MB/s | 8.4 MB     00:04    
Dependencies resolved.
==================================================================================================================================================================================================================Package                                                  Architecture                        Version                                                                Repository                              Size
==================================================================================================================================================================================================================
Installing:nginx                                                    x86_64                              1:1.14.1-9.module_el8.0.0+184+e34fea82                                 AppStream                              570 k
Upgrading:#在容器里更改配置文件,重启nginx
[root@3bd4aa598dd0 yum.repos.d]# echo 'docker is nginx' > /usr/share/nginx/html/index.html 
[root@3bd4aa598dd0 yum.repos.d]# /usr/sbin/nginx          #在宿主机上通过 docker ps 可以查看把容器的 80 端口映射到宿主机的那个端口上,可以看出映射到宿主机的32768端口
[root@test3 ~]# docker ps
CONTAINER ID   IMAGE     COMMAND       CREATED        STATUS        PORTS                                     NAMES
3bd4aa598dd0   centos    "/bin/bash"   23 hours ago   Up 23 hours   0.0.0.0:32768->80/tcp, :::32768->80/tcp   nginx#访问测试,或者直接请求容器的ip也行
[root@test3 ~]# curl 127.0.0.1:32768
docker is nginx
[root@test3 ~]# curl 172.17.0.3
docker is nginx#流量走向
访问物理节点ip:port(容器在物理节点映射的端口) ——>   容器 ip:port (容器里部署的服务器端口) ——> 就可以访问到容器里部署的应用了

直接运行nginx

[root@test3 ~]# docker pull nginx 
Using default tag: latest
latest: Pulling from library/nginx
a2abf6c4d29d: Pull complete 
a9edb18cadd1: Pull complete 
589b7251471a: Pull complete 
186b1aaa4aa6: Pull complete 
b4df32aa5a72: Pull complete 
a0bcbecc962e: Pull complete 
Digest: sha256:0d17b565c37bcbd895e9d92315a05c1c3c9a29f762b011a10c54a66cd53c9b31
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest#运行nginx
[root@test3 ~]# docker run -d -p 28877:80 nginx
0c0313595bf4632610ae2692a7d8b1efd6321b996c61209d0e8e9f9493881a92-p 28877:80 将宿主机的 28877端口映射到容器的80端口上指定版本# 查询centos镜像版本,也可以在浏览器上访问,看看有哪些版本
curl -s https://registry.hub.docker.com/v1/repositories/centos/tags  |   jq# 领导让你 基于mysql5.7 部署个镜像curl -s https://registry.hub.docker.com/v1/repositories/mysql/tags  |   jq#查看容器ip
[root@test3 ~]# docker inspect nginx|grep IPAddress"SecondaryIPAddresses": null,"IPAddress": "172.17.0.3","IPAddress": "172.17.0.3",

对外访问nginx1.19.7,直接访问宿主机的80端口就能看到nginx

[root@test3 ~]# docker pull nginx:1.19.7
1.19.7: Pulling from library/nginx
45b42c59be33: Pull complete 
8acc495f1d91: Pull complete 
ec3bd7de90d7: Pull complete 
19e2441aeeab: Pull complete 
f5a38c5f8d4e: Pull complete 
83500d851118: Pull complete 
Digest: sha256:f3693fe50d5b1df1ecd315d54813a77afd56b0245a404055a946574deb6b34fc
Status: Downloaded newer image for nginx:1.19.7
docker.io/library/nginx:1.19.7
[root@test3 ~]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
nginx        latest    605c77e624dd   2 years ago   141MB
centos       latest    5d0da3dc9764   2 years ago   231MB
nginx        1.19.7    35c43ace9216   3 years ago   133MB
[root@test3 ~]# netstat -tunlp|grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      6937/nginx: master  
[root@test3 ~]# systemctl stop nginx
[root@test3 ~]# netstat -tunlp|grep 80
[root@test3 ~]# docker run -d -p 80:80 35c43ace9216
474c65449759c39c108f020bbe54c37f781620b9968f22f0896427dc597a3585#批量停止正在运行中的容器
[root@test3 ~]# docker ps -q
474c65449759
0c0313595bf4
3bd4aa598dd0
[root@test3 ~]# docker stop $(docker ps -q)
474c65449759
0c0313595bf4
3bd4aa598dd0

docker创建镜像

[root@test3 ~]# docker ps -a
CONTAINER ID   IMAGE          COMMAND                  CREATED      STATUS                  PORTS     NAMES
474c65449759   35c43ace9216   "/docker-entrypoint.…"   2 days ago   Exited (0) 2 days ago             flamboyant_agnesi
0c0313595bf4   nginx          "/docker-entrypoint.…"   4 days ago   Exited (0) 2 days ago             gifted_pasteur
3bd4aa598dd0   centos         "/bin/bash"              5 days ago   Exited (0) 2 days ago             nginx
[root@test3 ~]# docker --help|grep commexec        Execute a command in a running containercommit      Create a new image from a container's changes
Run 'docker COMMAND --help' for more information on a command.
[root@test3 ~]# docker commit 3bd linux0224.cc
sha256:b8dad6dbee789f541fb34736ee4f55708f9685a7dcec3c45ce7340f7d3d70bea
[root@test3 ~]# docker images
REPOSITORY     TAG       IMAGE ID       CREATED          SIZE
linux0224.cc   latest    b8dad6dbee78   26 seconds ago   368MB
nginx          latest    605c77e624dd   2 years ago      141MB
centos         latest    5d0da3dc9764   2 years ago      231MB
nginx          1.19.7    35c43ace9216   3 years ago      133MB
[root@test3 ~]# docker image ls
REPOSITORY     TAG       IMAGE ID       CREATED          SIZE
linux0224.cc   latest    b8dad6dbee78   42 seconds ago   368MB
nginx          latest    605c77e624dd   2 years ago      141MB
centos         latest    5d0da3dc9764   2 years ago      231MB
nginx          1.19.7    35c43ace9216   3 years ago      133MB
[root@test3 ~]# docker run -it linux0224.cc bash
[root@bc873f3b5d4f /]#

http://www.mrgr.cn/p/15368801

相关文章

【MySQL】A01、性能优化-语句分析

1、数据库优化方向 A、SQL及索引优化 根据需求写出良好的SQL&#xff0c;并创建有效的索引&#xff0c;实现某一种需求可以多种写法&#xff0c;这时候我们就要选择一种效率最高的写法。这个时候就要了解sql优化 B、数据库表结构优化 根据数据库的范式&#xff0c;设计表结构&…

分析 MyBatis/MyBatis-Plus 慢 SQL 的分析组件 --SQL 慢镜️‍♀️

大家好&#xff01;我是聪ζ&#x1f331;我做了一个分析 MyBatis/MyBatis-Plus 慢 SQL 的分析组件 --SQL 慢镜&#x1f575;️‍♀️ GitHub仓库地址&#x1f680;: https://github.com/lhccong/sql-slow-mirror 点点 star 我的朋友们✨ 背景&#x1f9ca;&#xff1a; 大家…

串口服务器可以直接连接工业路由器吗

串口服务器可以直接连接工业路由器吗 在工业物联网的架构中,串口服务器和工业路由器都是不可或缺的重要组件。串口服务器的主要功能是将串口通信转换为网络通信,实现数据的远程传输和管理;而工业路由器则负责在工业环境中提供稳定、可靠的网络连接,确保数据的顺畅传输。那么…

Excel为批注设置图片背景 出现Bad Request - Request Too long

Excel为批注设置图片背景 打开EXCEL 点击文件 点选项 点击信任中心 点击信任中心设置 点击隐私选项 点击隐私设置 取消全部勾选关闭EXCEL 重新打开再操作,在填充效果中 选图片出现 点脱机工作 就可以正常先图片了

Composer初次接触

php一直都是简单处理一下单片机的后台服务&#xff0c;没什么深入研究 今天安装一个 php composer.phar require qiniu/php-sdkComposer完全不懂&#xff0c;照着一试&#xff0c;就报错了 - topthink/think-installer v1.0.12 requires composer-plugin-api ^1.0 -> found…

串口服务器和光纤交换机有什么不同

串口服务器与光纤交换机在功能和应用上存在显著区别。串口服务器主要实现串口设备与以太网设备之间的数据转换与传输,适用于远程监控、数据采集等场景;而光纤交换机则专注于高速光纤网络中的数据交换,为大型企业或数据中心提供稳定、高效的数据传输服务。简而言之,串口服务…

掘金、聚宽和米筐各量化平台优缺点

1、聚宽和米筐的商业模式主要是卖数据,掘金有自己做实盘, 2、聚宽有策略商城可以卖策略,掘金社区不太活跃 3、平台都有相关书籍,可以对照,有源码,掘金《》, 4、以python为例,掘金易用性较好,API文档清晰,windows客户端做的比较好, 策略都在本地运行, 很好的python代码…

parallels desktop19.3最新版本软件新功能详细介绍

Parallels Desktop是一款运行在Mac电脑上的虚拟机软件&#xff0c;它允许用户在Mac系统上同时运行多个操作系统&#xff0c;比如Windows、Linux等。通过这款软件&#xff0c;Mac用户可以轻松地在同一台电脑上体验不同操作系统的功能和应用程序&#xff0c;而无需额外的硬件设备…

source 1.5 中不支持 lambda 表达式, Deployment failed repository element

1、java:[400,90] 错误: -source 1.5 中不支持 lambda 表达式 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project原因是未指定版本,默认用jdk 1.5在编译 <plugins><!-- 指定maven编译的jdk版本,如…

算法刷题day46

目录 引言一、树的重心二、毕业旅行问题三、高精度乘法 引言 今天复习了一下高精度的所有模板&#xff0c;包括加法、减法、乘法、除法&#xff0c;因为自己当时在蓝桥杯的时候没有看出来那个题使用高精度&#xff0c;因为对于一个数的大小和一个数的长度&#xff0c;自己有时…

微软Phi-3,3.8亿参数能与Mixtral 8x7B和GPT-3.5相媲美,量化后还可直接在IPhone中运行

Phi-3系列 Phi-3是一系列先进的语言模型,专注于在保持足够紧凑以便在移动设备上部署的同时,实现高性能。Phi-3系列包括不同大小的模型:Phi-3-mini(38亿参数) - 该模型在3.3万亿个令牌上进行训练,设计得足够小,可以在现代智能手机上运行。尽管体积紧凑,它的性能却可与更…

postgresql中两张表的聚合函数合并到一列或一行,做除法,并保留两位小数

--两张表的无关数据合并到一张表 SELECT A.name, B.name FROM (select o.name, row_number() over(order by name) from tb_org as o) A FULL JOIN (select r.name, row_number() over(order by r.name) from tb_region as r) B ON A.row_number = B.row_number;这里是利用了…

Git - 在PyCharm/Idea中集成使用Git

文章目录 Git - 在PyCharm/Idea中集成使用Git1.新建GitHub仓库2.将仓库与项目绑定3.在PyCharm中使用Git4.新建Gitee仓库5.将仓库与项目绑定6.在IDEA中使用Git Git - 在PyCharm/Idea中集成使用Git 本文详细讲解了如何在 PyCharm 或 Idea 中配置 Gitee 或 GitHub 仓库&#xff0…

在阿里云服务器上安装python3.6.3

阿里云服务器试用 1、先进到服务器列表2、进入远程连接客户端使用账号密码进行连接即可用xshell或putty连接了 ============================================================================= 一般系统中默认是python2,下面是python3安装流程 一、下载 https://www.python.…

Computer Basics 10 - Setting Up a Computer

Setting up a computer Настройка компьютера So you have a new computer and youre ready to set it up. This may seem like an overwhelming /ˌəʊvəˈwelmɪŋ/ and complicated /ˈkɒmplɪkeɪtɪd/ task, but its actually a lot easier than y…

图像处理之模板匹配(C++)

图像处理之模板匹配&#xff08;C&#xff09; 文章目录 图像处理之模板匹配&#xff08;C&#xff09;前言一、基于灰度的模板匹配1.原理2.代码实现3.结果展示 总结 前言 模板匹配的算法包括基于灰度的匹配、基于特征的匹配、基于组件的匹配、基于相关性的匹配以及局部变形匹…

分布式版本控制工具 Git 的使用方式

文章目录 Git简介下载安装基本使用起始配置Git 的三个区域基本操作流程查看仓库状态删除&#xff08;撤销暂存区&#xff09;差异对比查看版本日志版本回退修改提交日志分支概念&#xff1a;创建分支与切换分支合并分支&#xff08;快速合并&#xff09;合并分支&#xff08;提…

Pandas 2.2 中文官方教程和指南(一)

原文:pandas.pydata.org/docs/安装原文:pandas.pydata.org/docs/getting_started/install.html安装 pandas 的最简单方法是作为Anaconda发行版的一部分安装,这是一个用于数据分析和科学计算的跨平台发行版。Conda包管理器是大多数用户推荐的安装方法。 还提供了从源代码安装…

Pandas 2.2 中文官方教程和指南(十三)

原文:pandas.pydata.org/docs/写时复制(CoW)原文:pandas.pydata.org/docs/user_guide/copy_on_write.html注意 写时复制将成为 pandas 3.0 的默认设置。我们建议现在就启用它以从所有改进中受益。 写时复制首次引入于版本 1.5.0。从版本 2.0 开始,大部分通过 CoW 可能实现…

Pandas 2.2 中文官方教程和指南(十七)

原文:pandas.pydata.org/docs/重复标签原文:pandas.pydata.org/docs/user_guide/duplicates.htmlIndex对象不需要是唯一的;你可以有重复的行或列标签。这一点可能一开始会有点困惑。如果你熟悉 SQL,你会知道行标签类似于表上的主键,你绝不希望在 SQL 表中有重复项。但 pan…