在Linux/redhat中安装amazon-ssm-agent及注意事项

操作系统:Red Hat Enterprise Linux Server release 7.9 (Maipo)

 

首先说明一下SSM是什么、引用官网的说明:

 

AWS Systems Manager Agent (SSM Agent) is Amazon software that can be installed and configured on an EC2 instance
an on-premises server, or a virtual machine (VM). SSM Agent makes it possible for Systems Manager to update, manage
and configure these resources. The agent processes requests from the Systems Manager service in the AWS Cloud
and then runs them as specified in the request. SSM Agent then sends status and execution information back to the
Systems Manager service by using the Amazon Message Delivery Service (service prefix: ec2messages).

 

 

在此笔者记录一下在RHEL 7.X中安装 SSM Agent 的过程

1、下载并安装,需要将下面的region替换自己所处的region,也可以直接yum跟上url进行安装,不过建议分为两步执行:

[root@qq-5201351 ~]# wget https://s3.region.amazonaws.com/amazon-ssm-region/latest/linux_amd64/amazon-ssm-agent.rpm
[root@qq-5201351 ~]# rpm -ivh amazon-ssm-agent.rpm

2、启动并设置为开机启动(一般上面安装后也就默认启动了)

[root@qq-5201351 ~]# systemctl restart amazon-ssm-agent
[root@qq-5201351 ~]# systemctl enable amazon-ssm-agent

3、实例的role下的策略需要有【AmazonSSMManagedInstanceCore 】

      然后再去AWS Systems Manager界面下的节点管理中就可以看到刚才安装了amazon-ssm-agent的主机了

 

总结一下,安装SSM-Agent的几点注意事项:

 

1.需要在实例客户端上安装 amazon-ssm-agent并启动

2.检查实例有绑定的role中有没有 AmazonSSMManagedInstanceCore

3.ssm-agent所在的实例,注册到ssm控制台,需要通过外网,对于有的环境访问是走的第4步的方法

4.也有特殊的环境,访问ssm控制台外网,是通过Endpoint,需要在相应的Endpoint中接口的安全组上放行上面实例的IP或CIDR,

   笔者在项目中是只放行HTTPS/TCP/443端口,即可正常注册到SSM控制台

 

 

 

 

 

尊重别人的劳动成果 转载请务必注明出处:https://www.cnblogs.com/5201351/p/14181029.html

 

上一篇:A + B Problem


下一篇:Golang Gin 框架之分组路由(五)