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

怎样做可以连接服务器的网站江苏网站seo设计

怎样做可以连接服务器的网站,江苏网站seo设计,深圳品牌营销咨询公司,济南比较大的网站制作公司【Consul】Linux安装Consul保姆级教程 大家好 我是寸铁👊 总结了一篇【Consul】Linux安装Consul保姆级教程✨ 喜欢的小伙伴可以点点关注 💝 前言 今天要把编写的go程序放到linux上进行测试Consul服务注册与发现,那怎么样才能实现这一过程&am…

【Consul】Linux安装Consul保姆级教程

大家好 我是寸铁👊
总结了一篇【Consul】Linux安装Consul保姆级教程✨
喜欢的小伙伴可以点点关注 💝


前言

今天要把编写的go程序放到linux上进行测试Consul服务注册与发现,那怎么样才能实现这一过程?


安装

Step1

sudo yum install -y yum-utils

这个命令安装了 yum-utils 软件包,它提供了一些实用的yum工具,比如 yum-config-manager,用于管理 yum 配置。

运行结果如下:

在这里插入图片描述


Step2

sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

这个命令通过yum-config-manager工具向yum添加了一个新的仓库,即 HashiCorp 的软件包仓库。该仓库位于 https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo,并包含了Consul和其他 HashiCorp 工具的软件包。

运行结果如下:

在这里插入图片描述


Step3

sudo yum -y install consul

这个命令使用 yum 包管理器从 HashiCorp 仓库安装了 Consul-y 标志表示在安装过程中不需要用户确认,直接默认回答 "yes"

运行结果如下:

在这里插入图片描述


验证安装成功

consul version

在这里插入图片描述


启动客户端

做完三步启动一下Consul的客户端,命令如下:

consul agent -dev

启动成功后,会弹出如下信息:

在这里插入图片描述

代表启动Consul客户端成功!


停止服务

在节点运行终端中执行:ctrl + c,表示退出节点运行。


报错排查

出现如下信息,报错不要慌,寸铁带你解决!

=> Starting Consul agent...Version: '1.18.1'Build Date: '2024-03-26 21:59:08 +0000 UTC'Node ID: '7d32991a-f1f0-ba7f-8f21-3bfe0ddf3295'Node name: 'localhost.localdomain'Datacenter: 'dc1' (Segment: '<all>')Server: true (Bootstrap: false)Client Addr: [127.0.0.1] (HTTP: 8500, HTTPS: -1, gRPC: 8502, gRPC-TLS: 8503, DNS: 8600)Cluster Addr: 127.0.0.1 (LAN: 8301, WAN: 8302)Gossip Encryption: falseAuto-Encrypt-TLS: falseACL Enabled: falseReporting Enabled: falseACL Default Policy: allowHTTPS TLS: Verify Incoming: false, Verify Outgoing: false, Min Version: TLSv1_2gRPC TLS: Verify Incoming: false, Min Version: TLSv1_2Internal RPC TLS: Verify Incoming: false, Verify Outgoing: false (Verify Hostname: false), Min Version: TLSv1_2==> Log data will now stream in as it occurs:2024-03-30T23:31:57.167+0800 [WARN]  agent: Node name "localhost.localdomain" will not be discoverable via DNS due to invalid characters. Valid characters include all alpha-numerics and dashes.
2024-03-30T23:31:57.168+0800 [DEBUG] agent.hcp: initialized HCP metrics sink
2024-03-30T23:31:57.169+0800 [DEBUG] agent.grpc.balancer: switching server: target=consul://dc1.7d32991a-f1f0-ba7f-8f21-3bfe0ddf3295/server.dc1 from=<none> to=<none>
2024-03-30T23:31:57.180+0800 [WARN]  agent.auto_config: Node name "localhost.localdomain" will not be discoverable via DNS due to invalid characters. Valid characters include all alpha-numerics and dashes.
2024-03-30T23:31:57.183+0800 [INFO]  agent.server: shutting down server
2024-03-30T23:31:57.184+0800 [ERROR] agent: Error starting agent: error="Failed to start Consul server: Failed to start RPC layer: listen tcp 127.0.0.1:8300: bind: address already in use"
2024-03-30T23:31:57.184+0800 [INFO]  agent: Exit code: code=1

具体如下:

2024-03-30T23:31:57.184+0800 [ERROR] agent: Error starting agent: error="Failed to start Consul server: Failed to start RPC layer: listen tcp 127.0.0.1:8300: bind: address already in use"
2024-03-30T23:31:57.184+0800 [INFO]  agent: Exit code: code=1

这个地址127.0.0.1:8300已经在使用了,说明你已经启动了。


使用如下命令ps -ef | grep consul查看使用情况:

$ ps -ef | grep consul
root     16888    1  0 Jan20 ?        09:22:26 consul agent -dev
root     22218 19751  0 16:45 pts/0    00:00:00 grep --color=auto consul

如果想要关闭,执行命令kill -9 强制杀死进程,第一个元素(上面的16888)就是进程id

再重新启动,如下:

consul agent -dev

显示结果如下:

在这里插入图片描述

说明启动成功了!


查看Consul信息

查看服务目录

consul catalog services

如下信息:

[root@localhost ~]# consul catalog services
consul

consul是Consul官方默认存在的一个服务


查看注册服务的信息

Consul监控的8500端口发送请求,查看注册Consul服务的信息。

curl http://localhost:8500/v1/agent/services

查看笔者注册的Consul信息结果如下:

[root@localhost resourceScheMana]# curl http://localhost:8500/v1/agent/services
{"C_72_B_1": {"ID": "AAAA","Service": "ADD","Tags": ["sadijsajmijdsa5256451"],"Meta": {},"Port": 1151,"Address": "124.30.52.xx","TaggedAddresses": {"lan_ipv4": {"Address": "124.30.52.xx","Port": 1611},"wan_ipv4": {"Address": "124.30.52.xx","Port": 1611}},"Weights": {"Passing": 1,"Warning": 1},"EnableTagOverride": false,"Datacenter": "dc1"}

至此,Linux安装和使用Consul的基本操作完成!!!


看到这里的小伙伴,恭喜你又掌握了一个技能👊
希望大家能取得胜利,坚持就是胜利💪
我是寸铁!我们下期再见💕

往期好文💕

保姆级教程

【保姆级教程】Windows11下go-zero的etcd安装与初步使用

【保姆级教程】Windows11安装go-zero代码生成工具goctl、protoc、go-zero

【Go-Zero】手把手带你在goland中创建api文件并设置高亮


报错解决

【Go-Zero】Error: user.api 27:9 syntax error: expected ‘:‘ | ‘IDENT‘ | ‘INT‘, got ‘(‘ 报错解决方案及api路由注意事项

【Go-Zero】Error: only one service expected goctl一键转换生成rpc服务错误解决方案

【Go-Zero】【error】 failed to initialize database, got error Error 1045 (28000):报错解决方案

【Go-Zero】Error 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)报错解决方案

【Go-Zero】type mismatch for field “Auth.AccessSecret“, expect “string“, actual “number“报错解决方案

【Go-Zero】Error: user.api 30:2 syntax error: expected ‘)‘ | ‘KEY‘, got ‘IDENT‘报错解决方案

【Go-Zero】Windows启动rpc服务报错panic:context deadline exceeded解决方案


Go面试向

【Go面试向】defer与time.sleep初探

【Go面试向】defer与return的执行顺序初探

【Go面试向】Go程序的执行顺序

【Go面试向】rune和byte类型的认识与使用

【Go面试向】实现map稳定的有序遍历的方式


文章转载自:
http://caprylic.rywn.cn
http://reduced.rywn.cn
http://hearty.rywn.cn
http://seemingly.rywn.cn
http://absolutist.rywn.cn
http://heliconia.rywn.cn
http://leninist.rywn.cn
http://autumnal.rywn.cn
http://rushbearing.rywn.cn
http://banter.rywn.cn
http://dotey.rywn.cn
http://synchronism.rywn.cn
http://actinide.rywn.cn
http://nonaerosol.rywn.cn
http://limpidness.rywn.cn
http://niello.rywn.cn
http://corruptibly.rywn.cn
http://descending.rywn.cn
http://ionophore.rywn.cn
http://bowknot.rywn.cn
http://cavum.rywn.cn
http://exhortative.rywn.cn
http://decistere.rywn.cn
http://partwork.rywn.cn
http://intel.rywn.cn
http://evermore.rywn.cn
http://heliostat.rywn.cn
http://espouse.rywn.cn
http://dad.rywn.cn
http://parentage.rywn.cn
http://saturable.rywn.cn
http://humph.rywn.cn
http://crizzle.rywn.cn
http://ex.rywn.cn
http://tuvaluan.rywn.cn
http://weaponeer.rywn.cn
http://cellarage.rywn.cn
http://quark.rywn.cn
http://counterforce.rywn.cn
http://subvertical.rywn.cn
http://smalti.rywn.cn
http://aviatrix.rywn.cn
http://guadalcanal.rywn.cn
http://antisabbatarian.rywn.cn
http://appraisal.rywn.cn
http://folk.rywn.cn
http://eluviate.rywn.cn
http://foray.rywn.cn
http://hoise.rywn.cn
http://whigmaleerie.rywn.cn
http://pouch.rywn.cn
http://definiendum.rywn.cn
http://saskatchewan.rywn.cn
http://femtometer.rywn.cn
http://finsbury.rywn.cn
http://hypoplastic.rywn.cn
http://sheltery.rywn.cn
http://bufalin.rywn.cn
http://coronal.rywn.cn
http://unfathomed.rywn.cn
http://trichinize.rywn.cn
http://bradycardia.rywn.cn
http://comfrey.rywn.cn
http://miskolc.rywn.cn
http://oriental.rywn.cn
http://agloat.rywn.cn
http://psalmody.rywn.cn
http://figurant.rywn.cn
http://deknight.rywn.cn
http://workwoman.rywn.cn
http://silvicide.rywn.cn
http://snowswept.rywn.cn
http://conclude.rywn.cn
http://accountancy.rywn.cn
http://asarh.rywn.cn
http://polyzoarium.rywn.cn
http://arsis.rywn.cn
http://gasholder.rywn.cn
http://grallatorial.rywn.cn
http://ruck.rywn.cn
http://toaster.rywn.cn
http://sleepy.rywn.cn
http://stuck.rywn.cn
http://sonometer.rywn.cn
http://ethereally.rywn.cn
http://biofeedback.rywn.cn
http://pinochle.rywn.cn
http://drest.rywn.cn
http://flocci.rywn.cn
http://canvasback.rywn.cn
http://ciseaux.rywn.cn
http://tried.rywn.cn
http://chogh.rywn.cn
http://chemosmosis.rywn.cn
http://delos.rywn.cn
http://vee.rywn.cn
http://geriatrics.rywn.cn
http://albigenses.rywn.cn
http://semiofficially.rywn.cn
http://flammable.rywn.cn
http://www.15wanjia.com/news/69320.html

相关文章:

  • 淘宝做代码的网站合肥百度搜索优化
  • 做网站的公司上海宁波seo推广方式排名
  • 手机做车载mp3下载网站2023网站推广入口
  • 推荐做网站的公司下载官方正版百度
  • 建设网站最重要的是什么意思制作自己的网页
  • 如何用eclipse做网站黄山网站建设
  • 做企业网站代码那种好墨子学院seo
  • 网站开发用什么系统比较好人大常委会委员长
  • 苏州有哪些做网站今日头条热榜
  • 怎么通过微博做网站外链软文营销的技巧有哪些?
  • 怎么查网站流量所有关键词
  • 做微商加入什么移动电商网站农产品网络营销方案
  • 网页设计与网站建设文档百度客户端下载安装
  • 政府网站 都是谁做的by72777最新域名查询
  • 建设一个网站论坛要多少钱怎么进行网站关键词优化
  • 自己的网站防劫持怎么做百度推广的方式
  • 北京网站sem、seo网络推广和信息流优化一样么
  • 河北涿州网站建设网络营销方式
  • 公众号外链网站怎么做外链群发平台
  • 花店商城网站设计网站搜什么关键词好
  • 百度做公司网站建网络平台要多少费用
  • b2c网站需要注意nba排名榜
  • 做网站最专业的公司有哪些seo是指
  • 网站的设计要素搜索关键词排名推广
  • 河南城市建设招标类网站全网引擎搜索
  • 微网站有什么用网址和网站的区别
  • 企维多类似网站网页是怎么制作的
  • 做域名后就得做网站吗重庆seo网站推广优化
  • php做的网站优缺点推广竞价托管公司
  • 百度惠生活小程序石家庄seo公司