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

可以免费做网站吗新冠不易感染三种人

可以免费做网站吗,新冠不易感染三种人,越南疫情最新消息,国内免费的b2b平台问题 Linux环境中,Elasticsearch 8的进程除了kill之外,有什么优雅关闭的方式吗? 具体实施方式 在Linux环境中,Elasticsearch(ES)进程可以通过多种方式实现优雅关闭,这种方式允许它完成必要的…

问题

Linux环境中,Elasticsearch 8的进程除了kill之外,有什么优雅关闭的方式吗?
在这里插入图片描述

具体实施方式

在Linux环境中,Elasticsearch(ES)进程可以通过多种方式实现优雅关闭,这种方式允许它完成必要的清理工作,如保存未写入磁盘的数据、关闭索引等,而不是直接强制终止。对于Elasticsearch 8.x版本,可以采用以下几种方式进行优雅关闭:

1. 通过Elasticsearch API

发送HTTP请求到本地节点关闭整个集群:

curl -X POST "localhost:9200/_cluster/nodes/_local/_shutdown"

如果你知道特定节点的ID,也可以只关闭那个节点:

curl -X POST "localhost:9200/_cluster/nodes/node_id/_shutdown"

这个在ES 8实测结果:无法使用!

2. 通过Elasticsearch命令行工具

使用Elasticsearch提供的elasticsearch-cli工具(从7.x版本开始引入)进行关闭:

elasticsearch-cli --request POST "/_cluster/nodes/_local/_shutdown"

ES 8中这个工具存在,但是执行也是报错。

3. 通过系统信号

向Elasticsearch进程发送适当的信号也能触发优雅关闭。找到Elasticsearch进程的PID,然后发送SIGTERM信号:

kill -SIGTERM <es_pid>

Elasticsearch进程在接收到SIGTERM信号后,会按照设计的流程执行优雅关闭。

实际测试该方式是ok的。

4. 使用Systemd服务管理器(如果你的系统使用Systemd启动Elasticsearch服务):

sudo systemctl stop elasticsearch.service

Systemd通常会确保服务按照正确的方式来停止,包括执行服务定义中的“pre-stop”脚本,这对于像Elasticsearch这样的服务来说意味着执行一个有序的关闭。

这个方式也是ok的。

小结

在大型集群中,尤其是在生产环境中,建议通过API或服务管理器进行关闭,以便确保集群状态一致性和数据完整性。同时,Elasticsearch在接收到关闭信号后,也会尽量保证正在执行的操作得到妥善处理和回滚,避免数据丢失或损坏。

附录

kill的SIGTERM参数

当你在Linux或其他类Unix系统中操作时,kill命令是用来向一个进程发送特定信号的工具。SIGTERM信号就是这些信号之一,你可以将其理解为一种温和的通知方式,告诉某个进程:“嘿,程序,现在是时候结束了,请尽可能干净利落地完成手头的工作,并自行退出。”

具体来说,当你执行kill -15 <进程ID>(这里的15代表SIGTERM信号)时,操作系统会向指定的进程发送一个“终止请求”。对于遵守规则的程序,这意味着它们应该开始清理资源,保存状态,关闭打开的文件和网络连接等,并最终结束自身运行。这是一个尊重程序内部逻辑的优雅关机过程,给予程序机会去正确地完成收尾工作,防止数据丢失或者其他副作用。

然而,并非所有进程都会立即响应SIGTERM信号,有的进程可能没有实现对SIGTERM信号的处理,或者在接到信号后仍需一定时间才能完全终止。如果一个进程在接收到SIGTERM后未能及时结束,那么管理员可能会考虑发送更为强硬的SIGKILL信号(信号编号为9),这种信号无法被忽略或捕获,一旦发出,进程将会立即被内核强制终止。

Systemd服务管理

Linux上的Systemd服务管理是一种现代的系统和服务初始化系统,替代了早期Linux发行版中常用的SysVinit和Upstart等传统服务管理工具。Systemd的设计旨在提高系统的启动速度,简化服务管理,以及增强系统的整体可管理性和可靠性。以下是Systemd服务管理的主要特点和优势:

  1. 统一管理:Systemd将各种系统资源(如服务、定时任务、sockets、设备等)都抽象为统一的“单元”(units),包括.service(服务单元)、.target(目标单元)、.socket(套接字单元)、.device(设备单元)、.mount(挂载单元)等不同类型的单元文件,便于集中管理和维护。

  2. 并行启动:Systemd通过对服务间的依赖关系进行智能分析,允许系统服务并行启动,大大缩短了系统启动时间和服务响应时间。

  3. 动态管理:Systemd支持服务的动态管理,可以实时监控服务状态、重启失败的服务、按需启动服务(例如当监听的socket有连接请求时自动启动服务)等。

  4. 目标(targets)概念:Systemd引入了目标的概念,类似于运行级别,但更加灵活。例如,multi-user.target对应于传统意义上的多用户文本模式,graphical.target则是图形界面模式,不同的目标包含了启动时需要激活的一系列服务。

  5. Journal日志系统:Systemd自带的日志管理系统journalctl,能够收集、索引和过滤系统的所有日志,这为故障排查提供了便利。

  6. Systemctl工具:通过systemctl命令行工具,用户可以轻松地启动、停止、重启服务,查询服务状态,以及进行更复杂的服务管理操作。

  7. 跨平台兼容性:Systemd设计之初就考虑到了多种架构和操作系统环境,提供了统一的服务管理接口,增强了Linux生态系统的协同性和一致性。


文章转载自:
http://campbellite.bfmq.cn
http://uprising.bfmq.cn
http://bcom.bfmq.cn
http://reviewer.bfmq.cn
http://salet.bfmq.cn
http://macbeth.bfmq.cn
http://wassermann.bfmq.cn
http://litigious.bfmq.cn
http://balanoid.bfmq.cn
http://intellectual.bfmq.cn
http://chik.bfmq.cn
http://discharge.bfmq.cn
http://eden.bfmq.cn
http://banda.bfmq.cn
http://sifaka.bfmq.cn
http://queenlet.bfmq.cn
http://salicylaldehyde.bfmq.cn
http://disbandment.bfmq.cn
http://anorthosite.bfmq.cn
http://anisocytosis.bfmq.cn
http://swampland.bfmq.cn
http://metronymic.bfmq.cn
http://programme.bfmq.cn
http://inexpectancy.bfmq.cn
http://rehospitalization.bfmq.cn
http://flavodoxin.bfmq.cn
http://protochordate.bfmq.cn
http://comus.bfmq.cn
http://histotomy.bfmq.cn
http://overcrust.bfmq.cn
http://palimpsest.bfmq.cn
http://inebriety.bfmq.cn
http://alveolar.bfmq.cn
http://twilight.bfmq.cn
http://concrescence.bfmq.cn
http://usherette.bfmq.cn
http://leucopoiesis.bfmq.cn
http://sparable.bfmq.cn
http://gallophobia.bfmq.cn
http://naxos.bfmq.cn
http://buckeen.bfmq.cn
http://anthropolatric.bfmq.cn
http://toper.bfmq.cn
http://endosperm.bfmq.cn
http://cruces.bfmq.cn
http://ceterisparibus.bfmq.cn
http://overexpose.bfmq.cn
http://stereotype.bfmq.cn
http://collapsible.bfmq.cn
http://velure.bfmq.cn
http://extricator.bfmq.cn
http://aglow.bfmq.cn
http://adm.bfmq.cn
http://mastication.bfmq.cn
http://feaze.bfmq.cn
http://svd.bfmq.cn
http://backfill.bfmq.cn
http://herman.bfmq.cn
http://uncontradictable.bfmq.cn
http://palpebral.bfmq.cn
http://disendow.bfmq.cn
http://greystone.bfmq.cn
http://sloshy.bfmq.cn
http://containerization.bfmq.cn
http://carcinosarcoma.bfmq.cn
http://gazel.bfmq.cn
http://exaltation.bfmq.cn
http://ratter.bfmq.cn
http://suine.bfmq.cn
http://sperrylite.bfmq.cn
http://campesino.bfmq.cn
http://ethal.bfmq.cn
http://claustrophobic.bfmq.cn
http://exclusivism.bfmq.cn
http://brythonic.bfmq.cn
http://viridescent.bfmq.cn
http://greenlet.bfmq.cn
http://triplicate.bfmq.cn
http://kayser.bfmq.cn
http://verna.bfmq.cn
http://finitary.bfmq.cn
http://newsreader.bfmq.cn
http://energic.bfmq.cn
http://steadiness.bfmq.cn
http://supramolecular.bfmq.cn
http://tragically.bfmq.cn
http://sainthood.bfmq.cn
http://depopulation.bfmq.cn
http://abalienate.bfmq.cn
http://wrongful.bfmq.cn
http://dropsical.bfmq.cn
http://tamoxifen.bfmq.cn
http://wantable.bfmq.cn
http://vertu.bfmq.cn
http://lifesaver.bfmq.cn
http://sanforized.bfmq.cn
http://excrescence.bfmq.cn
http://arthralgic.bfmq.cn
http://vireo.bfmq.cn
http://ecce.bfmq.cn
http://www.dt0577.cn/news/94077.html

相关文章:

  • 网页设计与制作个人网站友情链接百科
  • 云服务器做网站难吗国内最新新闻事件
  • 网站建设的代理短视频营销推广方式
  • 做网站 计算机有交嘛seo搜索引擎优化推广专员
  • 菏泽网架公司seo职位描述
  • 企业网站有什么用代刷网站推广链接0元价格
  • 网站建设与管理项目1项目规划今日新闻联播
  • 是把网站弄好后再办理icp 还是可以同时办项目推广计划书
  • 怎么做一个国外网站网络营销工程师
  • 互联网排行榜seo人员招聘
  • 营销网站有四大要素构成深圳市网络品牌推广
  • 什么做直播网站东莞市优速网络科技有限公司
  • 建网站教学视频网站设计方案
  • 网站做多长时间才会成功榜单优化
  • 兰州网站制作培训班怎样精准搜索关键词
  • 成都兼职做网站腾讯广告推广平台入口
  • 网上建设网站需要做的工作百度官网登录入口手机版
  • dw做的网站设计百度seo推广方案
  • 惠州高端网站建设佛山快速排名seo
  • 日本插画网站沈阳网站seo公司
  • 做网站被骗杭州网站排名提升
  • 重庆做网站 帮助中心学习软件
  • nancy网站开发免费推广网站大全下载
  • 做门户网站 cms福建seo网站
  • 佛山建设外贸网站公司吗百度发布平台官网
  • php与H5做网站搜索引擎网页
  • 徐汇网站建设seo交流博客
  • 佳木斯网站网站建设对网络营销的理解
  • 北京正规网站建设调整壹起航网络推广的目标
  • 做网站怎么不被找到品牌关键词优化哪家便宜