阿里专有云,OCP 运维操作记录推送至 SLS。
详细说明
SLS 创建 project、logstore 并赋权。
##-- 说明: OCP 当前版本 SLS project、logstore 名称固定,需适配创建
project : ali-audit-project
logstore: audit_log
OCP_Meta 配置 SLS 信息。
use ocp;
update config_properties set `value` =$sls_endpoint where `key`='ocp.event.audit.apsara.sls.endpoint';
update config_properties set `value` =$sls_ak where `key`='ocp.event.audit.apsara.sls.access-key';
update config_properties set `value` =$sls_sk where `key`='ocp.event.audit.apsara.sls.access-secret;
轮流重启OCP docker。
docker restart ocp
验证:OCP 执行变更,如修改参数、重启 OceanBase 组件,发送成功日志样例如下。
ocp.log
2025-04-11 16:49:55.604 INFO 8 --- [push-to-sls2,840cf3b4d43b40e2,0a07c949f157] c.o.o.s.a.apsara.AuditEventSLSService : success to send task operation log to SLS, topic: oceanbase-ocp-ops, taskId: 3313238
适用版本
OCP V4.2.2 及之后版本。