自学内容网 自学内容网

Centos 7 单机部署 consul

一、下载安装

参考官网文档

Install | Consul | HashiCorp Developer

进入Centos 执行下面命令

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

这种方法安装完成后,会交给Systemctl 管理

使用命令查询软件安装位置

whereis consul

二、启动Consul

启动consul

systemctl start consul

查看consul状态,发现启动是成功了,但是从日志上来看,是有错误发生的

systemctl status consul  

另外UI地址 http://192.168.31.110:8500/ui/dc1/services  也访问不了,经过我的一番探索,明白启动之前需要配置相关启动参数才行

三、配置启动参数

查看 /etc/consul.d/ 目录

ls /etc/consul.d/

 consul.hcl 文件就是consul的配置文件

vim /etc/consul.d/consul.hcl

按照如下图这样配置即可

四、查看服务内存占用情况

上篇文章我们看了Nacos启动啥也不干,占用了700M的内存,现在我们看看consul,仅启动会暂用多少内存

启动consul前内存占用 189M

启动consul后内存占用222M

总共占用内存为 222M - 189M = 33M

总结: 这一对比,内存占用差别真的差太远了,consul完胜!!!


原文地址:https://blog.csdn.net/u010887012/article/details/135610538

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!