Tidb监控代理

tidb监控代理

大部分场景下,数据库位于内网。tidb监控通常也部署在内网通过堡垒机访问不方便,想个办法把他拿出来。

centos部署docker

 sudo yum install -y yum-utils 
  device-mapper-persistent-data 
  lvm2
sudo yum-config-manager 
    --add-repo 
    https://download.docker.com/linux/centos/docker-ce.repo
 yum install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker

部署docker-compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
  • docker-compose.yml
#  distribute.search.leju.com 

version: '2'

services:    
  distribute:
    image: nginx:1.17
    volumes:
        - ./conf.d:/etc/nginx/conf.d
    network_mode: "host"
    container_name: grafanaproxy

  • conf.d/grafanaproxy.conf
  server {
  # 监听80端口号
  listen 3000;
  # 监听访问的域名
  # 根据访问路径配置
  location /{
  # 把请求转发到 内网grafana服务器
  proxy_pass http://10.0.1.10:3000;
   }
  }

启动服务

docker-compose up -d

通过浏览器访问代理服务器

 http://${proxyip}:3000
3 个赞

感谢分享:+1:

许久不灌水了:grinning:

欢迎贾老师来灌水:laughing: