首页 > 其他分享 >部署:部署obagent

部署:部署obagent

时间:2023-04-26 14:00:55浏览次数:48  
标签:ok 部署 obd 8088 obagent 192.168 admin

1. 创建监控用户

[admin]# obclient -h127.0.0l -P2881 -D -uroot@sys -p -A
obclient [sys]> grant select on oceanbase.* to monitor identified by 'OceanBase010';

2. 更新配置文件

参考obagent配置文件:https://github.com/oceanbase/obdeploy/blob/master/example/obagent/obagent-only-example.yaml

编辑obagent.yaml配置文件

[admin]# vi obagent.yaml 
obagent:
  servers:
    - 192.168.1.71
    - 192.168.1.72
    - 192.168.1.73
  global:
    home_path: /home/admin/obagent
    monagent_http_port: 8088
    mgragent_http_port: 8089
    log_path: log/monagent.log
    mgragent_log_level: info
    mgragent_log_max_size: 30
    mgragent_log_max_days: 30
    mgragent_log_max_backups: 15
    monagent_log_level: info
    monagent_log_max_size: 200
    monagent_log_max_days: 30
    monagent_log_max_backups: 15
    http_basic_auth_user: admin
    http_basic_auth_password: OceanBase010
    pprof_basic_auth_user: admin
    pprof_basic_auth_password: OceanBase010
    monitor_user: monitor
    monitor_password: OceanBase010
    sql_port: 2881
    rpc_port: 2882
    cluster_name: observer 
    cluster_id: 1
    ob_monitor_status: active
  192.168.1.71:
    zone_name: zone1
  192.168.1.72:
    zone_name: zone2
  192.168.1.73:
    zone_name: zone3

3. 部署obagent集群

部署命令:obd cluster deploy 集群名称 -c 配置文件

[admin]# obd cluster deploy obagent -c obagent.yaml
+---------------------------------------------------------------------------+
|                                  Packages                                 |
+------------+---------+---------+------------------------------------------+
| Repository | Version | Release | Md5                                      |
+------------+---------+---------+------------------------------------------+
| obagent    | 1.3.0   | 22.el7  | d57fbb4962b2fbecb6282358c59295fdfba4d6ac |
+------------+---------+---------+------------------------------------------+
Repository integrity check ok
Parameter check ok
Open ssh connection ok
Cluster status check ok
Initializes obagent work home ok
Remote obagent-1.3.0-22.el7-d57fbb4962b2fbecb6282358c59295fdfba4d6ac repository install ok
Remote obagent-1.3.0-22.el7-d57fbb4962b2fbecb6282358c59295fdfba4d6ac repository lib check ok
obagent deployed
Trace ID: 3bd4feb8-e26b-11ed-aa21-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace 3bd4feb8-e26b-11ed-aa21-000c29501e19

4. 查看集群状态,obagent集群状态为“deployed”

[admin]# obd cluster list
+----------------------------------------------------------------+
|                          Cluster List                          |
+----------+-----------------------------------+-----------------+
| Name     | Configuration Path                | Status (Cached) |
+----------+-----------------------------------+-----------------+
| observer | /home/admin/.obd/cluster/observer | running         |
| obagent  | /home/admin/.obd/cluster/obagent  | deployed        |
+----------+-----------------------------------+-----------------+
Trace ID: 92c2982a-e26b-11ed-9865-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace 92c2982a-e26b-11ed-9865-000c29501e19

5. 启动obagent集群(obagent使用8088、8089端口)

[admin]# obd cluster start obagent
Get local repositories ok
Search plugins ok
Open ssh connection ok
Load cluster param plugin ok
Check before start obagent ok
Start obagent ok
obagent program health check ok
Connect to Obagent ok
+-----------------------------------------------------------------+
|                             obagent                             |
+--------------+--------------------+--------------------+--------+
| ip           | mgragent_http_port | monagent_http_port | status |
+--------------+--------------------+--------------------+--------+
| 192.168.1.71 | 8089               | 8088               | active |
| 192.168.1.72 | 8089               | 8088               | active |
| 192.168.1.73 | 8089               | 8088               | active |
+--------------+--------------------+--------------------+--------+
obagent running
Trace ID: aa3d0670-e26b-11ed-9c91-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace aa3d0670-e26b-11ed-9c91-000c29501e19

6. 查看集群状态,obagent集群状态为“running”

[admin]# obd cluster list
+----------------------------------------------------------------+
|                          Cluster List                          |
+----------+-----------------------------------+-----------------+
| Name     | Configuration Path                | Status (Cached) |
+----------+-----------------------------------+-----------------+
| observer | /home/admin/.obd/cluster/observer | running         |
| obagent  | /home/admin/.obd/cluster/obagent  | running         |
+----------+-----------------------------------+-----------------+
Trace ID: d650fabe-e26b-11ed-a7a5-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace d650fabe-e26b-11ed-a7a5-000c29501e19

7. obagent部署启动后会生成的prometheus.yaml配置文件,对4个“job_name”部分中“basic_auth”、“static_configs”稍作修改即可被使用

[admin]# cat /home/admin/obagent/conf/prometheus_config/prometheus.yaml
global:
  scrape_interval:     1s
  evaluation_interval: 10s

rule_files:
  - "rules/*rules.yaml"

scrape_configs:
  - job_name: prometheus
    metrics_path: /metrics
    scheme: http
    static_configs:
      - targets:
          - 'localhost:9090'
  - job_name: node
    basic_auth:
      username: admin
      password: OceanBase010
    metrics_path: /metrics/node/host
    scheme: http
    static_configs:
      - targets:
          - 192.168.1.71:8088
          - 192.168.1.72:8088
          - 192.168.1.73:8088
  - job_name: ob_basic
    basic_auth:
      username: admin
      password: OceanBase010
    metrics_path: /metrics/ob/basic
    scheme: http
    static_configs:
      - targets:
          - 192.168.1.71:8088
          - 192.168.1.72:8088
          - 192.168.1.73:8088
  - job_name: ob_extra
    basic_auth:
      username: admin
      password: OceanBase010
    metrics_path: /metrics/ob/extra
    scheme: http
    static_configs:
      - targets:
          - 192.168.1.71:8088
          - 192.168.1.72:8088
          - 192.168.1.73:8088
  - job_name: agent
    basic_auth:
      username: admin
      password: OceanBase010
    metrics_path: /metrics/stat
    scheme: http
    static_configs:
      - targets:
          - 192.168.1.71:8088
          - 192.168.1.72:8088
          - 192.168.1.73:8088

8. 安装prometheus

[admin]# wget https://github.com/prometheus/prometheus/releases/download/v2.43.0/prometheus-2.43.0.linux-amd64.tar.gz
[admin]# tar -zxvf prometheus-2.43.0.linux-amd64.tar.gz
[admin]# cd prometheus-2.43.0.linux-amd64
[admin]# ./prometheus --config.file="/home/admin/obagent/conf/prometheus_config/prometheus.yaml"

浏览器访问:http://192.168.1.71:9090/graph

9. 安装Grafana

[admin]# wget https://dl.grafana.com/enterprise/release/grafana-enterprise-9.4.7-1.x86_64.rpm
[admin]# sudo rpm -ivh grafana-enterprise-9.4.7-1.x86_64.rpm
[admin]# sudo /bin/systemctl start grafana-server.service

然后添加prometheus的数据源(http://192.168.1.71:9090)

可以到grafana官网下载OceanBase提交的监控模版:

oceanbase-metrics_rev2.json

host-metrics_rev1.json

 

标签:ok,部署,obd,8088,obagent,192.168,admin
From: https://www.cnblogs.com/haha029/p/17355697.html

相关文章

  • centos7使用docker部署.net 6项目
    由于前阵子购买了腾讯云服务器,现在尝试在linux服务器上使用docker部署.net项目第一步,首先是要在服务器上安装docker,宝塔里边是可以直接安装的,如果是别的话,需要你网上找资料用命令安装,其实也是可以的  第二步,先生成好docker文件,将你的解决方案源代码放到一个指定目录(比如......
  • Jmeter分部式部署(windows)
    1、前提条件关闭调度机和执行机的防火墙所有客户端在同一个子网各个机器在相同的目录下安装相同版本的Jmeter各个机器在相同的目录下安装相同版本的JDK如果脚本涉及读取外部参数化文件,如CSV文件,需要将文件上传到每个执行机2、调度机(master)配置2.1配置jmet......
  • 【ChatGPT】ChatGPT的部署
    1.模型训练:使用大规模训练数据集对ChatGPT模型进行训练,以提高模型的准确性和适用性。训练好的模型可以保存为一个文件,并用于后续的部署。2.模型转换:由于ChatGPT是基于深度学习框架PyTorch实现的,因此需要将PyTorch模型转换为TensorFlowServing支持的格式。这一步可以使用TensorF......
  • 一文搞定nuxt.js搭建到部署(ssr和静态部署)
    一、Nuxt简介uxt是一个更高级别的Node.jsweb开发框架,用于创建Vue应用,可在两种不同模式下开发和部署:通用(SSR)或单页应用(SPA)。此外,您可以在Nuxt中将SSR和SPA部署为静态生成的应用。即使您可以选择SPA模式,Nuxt的全部功能仍在于其通用模式或用于构建通用应用的服务器......
  • 关于在linux-centos7下部署 .net core程序绘图(PDF等)丢失中文字体的解决方案
    关于在linux-centos7下部署.netcore程序绘图(PDF等)丢失中文字体的解决方案说明:1:以下操作基于新系统,如果步骤一,二已经安装则不需要额外安装.需要注意的是,在使用(yuminstall包)的时候如果提示包不存在;需要运行步骤(一:5安装epel,企业版Linux额外包)2:以下()内代表......
  • Sitecore XP 10.3(latest) Docker一键部署
    本文演示通过PowerShell+DockerDesktopforWindows一键部署Sitecore10.3(即Sitecore最新版)Docker开发/测试/演示环境。官方参考 SitecoreXP10.3.0DeveloperWorkstationDeploymentWithDocker演示配置为XPSingle(XP0) 环境准备1,windows10+/WindowsServer2019(Windows......
  • kubeadm部署k8s 1.20.9
    3台CentOS7系统,k8s-masterip172.31.0.140、k8s-node1ip172.31.0.141、k8s-node2ip172.31.0.142在3台主机的hosts文件里添加记录:172.31.0.140   cluster-endpoint配置yum源yuminstall-yyum-utilsyum-config-manager\--add-repo\http://mirrors.aliyun.com/docker-ce......
  • kubernetes 1.27.1最新版集群部署
    kubernetes1.27.1最新版集群部署国内环境官方安装部署文档:https://kubernetes.io/zh-cn/docs/setup/production-environment/tools/kubeadm/install-kubeadm/准备云服务器首先买三台服务器。我用的阿里云服务器。三台服务器如下,然后我用的Tabby连接三台服务器。我以i-bp......
  • [Ubuntu] 节点部署获取镜像报错以及解决方法
    没有启动docker,解决方法启动dockerservicedockerstartservicedockerstatusdockerhub没有该版本在dockerhub查询版本......
  • 使用Dockerfile部署springboot打包jar包
    1、docker下载JDK1.8镜像dockerpulljava:82、编写Dockerfile文件#依赖的父镜像FROMjava:8#作者MAINTAINERdocker-admin#jar包添加到镜像中ADDxxl-job-admin-2.1.2.jarxxl-job-admin.jar#容器暴露的端口即jar程序在容器中运行的端口EXPOSE8080#容器启动之后......