当前位置: 首页 > news >正文

网站建设的技能有哪些青岛网站制作seo

网站建设的技能有哪些,青岛网站制作seo,合肥建设网站查询系统,黄浦上海网站建设阿丹: 在开发和生产环境中有可能会出现慢mysql等问题,那么这里就需要我们优秀的程序员来进行监控和解决,那么如何借助云原生的监控系统来完成这个操作呢? 环境描述: 使用一台空白的阿里云服务器2核4G。 服务器基本安装…

阿丹:

        在开发和生产环境中有可能会出现慢mysql等问题,那么这里就需要我们优秀的程序员来进行监控和解决,那么如何借助云原生的监控系统来完成这个操作呢?

       环境描述:

       使用一台空白的阿里云服务器2核4G。

服务器基本安装配置-docker容器化

关闭防火墙

systemctl stop firewalld

安装流程按照我之前写的文章来进行,我这里直接附上文章链接

阿丹的服务配置文章专题

安装docker

配置Linux服务器华为云耀云服务器之docker安装,以及环境变量安装 java (虚拟机一样适用)_华为云安装docker-CSDN博客

安装Mysql5:7 

配置Linux服务器华为云耀云服务器之docker中Mysql5.7、redis安装 (虚拟机一样适用)_云耀云服务器开放3306-CSDN博客

 安装普罗米修斯并监控mysql

Prometheus安装挂载数据卷

Prometheus技术文档--基本安装-docker安装并挂载数据卷-《十分钟搭建》_一单成的博客-CSDN博客

 访问ip+9090出现以下页面完成安装

Grafana安装挂载数据卷

Grafana技术文档--基本安装-docker安装并挂载数据卷-《十分钟搭建》-附带监控服务器_一单成的博客-CSDN博客

 访问ip+3000,出现页面完成Grafana安装

 在这一步的时候使用Grafana,在上面搜索框直接搜索Data sources将普罗米修斯设置为数据源,因为上面链接中有这里就不过多的说了。

docker中拉取mysql的探针

docker pull prom/mysqld-exporter

运行探针

首先创建一个专门用来监控的用户并授权

进入docker的mysql容器

docker exec -it 容器的id bash

 登录root用户

mysql -u root -p

输入密码后执行下面的指令 

CREATE USER 'mysql_monitor'@'%' IDENTIFIED BY 'adn666' WITH MAX_USER_CONNECTIONS 3;
GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'mysql_monitor'@'%';
FLUSH PRIVILEGES;
EXIT

 这段SQL语句用于在MySQL数据库中创建一个名为'mysql_monitor'的用户,并给予该用户一些权限。让我逐行解释一下:

  1. CREATE USER 'mysql_monitor'@'%' IDENTIFIED BY 'adn666' WITH MAX_USER_CONNECTIONS 3;

    • 这行代码创建一个名为'mysql_monitor'的用户,并且定义了用户的身份验证方式(密码)为'adn666'。
    • 'localhost'指定了该用户只能从本地主机连接到MySQL服务器。
    • WITH MAX_USER_CONNECTIONS 3限制了该用户可以同时建立的最大连接数为3个。
  2. GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'mysql_monitor'@'localhost';

    • 这行代码将一些权限授予'mysql_monitor'用户。
    • PROCESS权限允许该用户查看当前正在运行的MySQL进程。
    • REPLICATION CLIENT权限允许该用户连接到MySQL复制服务器以获取复制相关的信息。
    • SELECT权限允许该用户在所有的数据库和表上执行SELECT查询语句。
  3. FLUSH PRIVILEGES;

    • 这行代码用于刷新MySQL权限表,以使新的用户和权限设置生效。
  4. EXIT

    • 这行代码用于退出MySQL命令行终端。

这些语句的目的是创建一个具有特定权限的MySQL用户,并确保这些权限生效。你可以根据自己的需求修改用户名、密码和授权的权限。

使用我们创建好的用户来启动探针

docker直接运行探针(出现问题)

GitHub - percona/mysqld_exporter: Exporter for MySQL server metrics

 下面的这个就是官网提供的但是阿丹运行报错

docker network create my-mysql-network
docker pull prom/mysqld-exporterdocker run -d \-p 9104:9104 \--network my-mysql-network  \-e DATA_SOURCE_NAME="user:password@(hostname:3306)/" \prom/mysqld-exporter

 根据实践总是出现有这个.my.cnf的配置文件找不到。在这里留个坑希望有大神可以解答一下。

使用从官网上下拉代码

 wget https://github.com/prometheus/mysqld_exporter/releases/download/v0.12.1/mysqld_exporter-0.12.1.linux-amd64.tar.gz

解压

tar xf mysqld_exporter-0.12.1.linux-amd64.tar.gz -C /usr/local/

移动

ln -sv /usr/local/mysqld_exporter-0.12.1.linux-amd64/ /usr/local/prometheus_mysqld

编写配置文件,根据刚才我们新建的用户来完成配置

#编辑配置文件
vim /usr/local/prometheus_mysqld/.my.cnf #配置文件中内容
[client]
user=mysql_monitor #刚才新建的用户
password=adn666 #密码
port=3306 #端口号,如果不写ip地址(host)的话默认就是本机

配置systemd启动mysqld_exporter

vim /lib/systemd/system/mysqld_exporter.service

 下面为配置文件

[Unit]
Description=Mysqld_exporter
After=network.target
[Service]
ExecStart=/usr/local/prometheus_mysqld/mysqld_exporter --config.my-cnf=/usr/local/prometheus_mysqld/.my.cnf
[Install]
WantedBy=multi-user.target

 加入并启动,系统

systemctl daemon-reload
systemctl start mysqld_exporter
systemctl enable mysqld_exporter

 检查是否正常运行

ss -lnpt|grep 9104

 出现如下项目没有问题

使用ip地址+9104出现以下页面

 确认监控指标正常

curl http://localhost:9104/metrics|grep mysql_up

 那么我们下面就是在我们普罗米修斯中配置这个任务

在普罗米修斯中配置文件

修改这个配置 

  - job_name: 'mysql_db'static_configs:- targets: ['mysqlIP:9104']labels:group: mysql_db

 修改配置之后重启普罗米修斯的docker容器

访问ip+9090//targets查看

出现如上页面就是可以了! 

开始配置Grafana的主题-使用导入json的形式

阿丹:

        我这里准备了一个别人整理好的,我这里就直接拿过来使用了。

这个json文件我放在本文章的资源中了。直接拿取就可以,然后我们就使用上就可以了跟着我的步骤来。

注意:

        有两个方式来发现,一种是图表的形式来使用的,另外一种是使用配置预警规则来警告的。这里我们使用是监控图表的方式。(第二种方式阿丹后期会更新的)

我们可以直接在上面搜索这里直接搜索import

 直接将本文章中的json文件拖入就可以了,(前提是在安装的时候已经将数据来源设置为了我们安装好的普罗米修斯)

这里就是配置好了出现的面板

其中我们要使用到的就是这里!! 


文章转载自:
http://fireproofing.tsnq.cn
http://satinize.tsnq.cn
http://katanga.tsnq.cn
http://calydonian.tsnq.cn
http://deiktic.tsnq.cn
http://ebro.tsnq.cn
http://golosh.tsnq.cn
http://uncivilized.tsnq.cn
http://jolley.tsnq.cn
http://caressing.tsnq.cn
http://rowlock.tsnq.cn
http://gigawatt.tsnq.cn
http://sweetheart.tsnq.cn
http://bawcock.tsnq.cn
http://propagate.tsnq.cn
http://but.tsnq.cn
http://irreproachable.tsnq.cn
http://lentiscus.tsnq.cn
http://vim.tsnq.cn
http://above.tsnq.cn
http://proportionable.tsnq.cn
http://indication.tsnq.cn
http://seisin.tsnq.cn
http://aerobe.tsnq.cn
http://diablerie.tsnq.cn
http://ijssel.tsnq.cn
http://identifiably.tsnq.cn
http://aqueous.tsnq.cn
http://margaret.tsnq.cn
http://jewess.tsnq.cn
http://quicklime.tsnq.cn
http://semitonic.tsnq.cn
http://bepuzzlement.tsnq.cn
http://perusal.tsnq.cn
http://visuopsychic.tsnq.cn
http://insulant.tsnq.cn
http://outguess.tsnq.cn
http://battlemented.tsnq.cn
http://boxkeeper.tsnq.cn
http://audient.tsnq.cn
http://protestation.tsnq.cn
http://nonesuch.tsnq.cn
http://headmost.tsnq.cn
http://oratorize.tsnq.cn
http://stratotanker.tsnq.cn
http://bight.tsnq.cn
http://airbrush.tsnq.cn
http://rectificatory.tsnq.cn
http://marrow.tsnq.cn
http://thinnest.tsnq.cn
http://chimeric.tsnq.cn
http://equiform.tsnq.cn
http://gottland.tsnq.cn
http://oxytetracycline.tsnq.cn
http://pseudoparenchyma.tsnq.cn
http://pickup.tsnq.cn
http://sulphamethazine.tsnq.cn
http://asin.tsnq.cn
http://popliteal.tsnq.cn
http://absurdly.tsnq.cn
http://nonadmission.tsnq.cn
http://overdid.tsnq.cn
http://crescendo.tsnq.cn
http://vermination.tsnq.cn
http://uroscopy.tsnq.cn
http://throughly.tsnq.cn
http://laddish.tsnq.cn
http://tortoiseshell.tsnq.cn
http://lymphangiitis.tsnq.cn
http://landrace.tsnq.cn
http://dehydrogenation.tsnq.cn
http://wagonload.tsnq.cn
http://attached.tsnq.cn
http://congealer.tsnq.cn
http://condensability.tsnq.cn
http://recognise.tsnq.cn
http://anthozoa.tsnq.cn
http://voom.tsnq.cn
http://tribunician.tsnq.cn
http://reinfecta.tsnq.cn
http://kyloe.tsnq.cn
http://servingman.tsnq.cn
http://rappahannock.tsnq.cn
http://personalize.tsnq.cn
http://lithophile.tsnq.cn
http://gliosis.tsnq.cn
http://hydrograph.tsnq.cn
http://ablush.tsnq.cn
http://addax.tsnq.cn
http://cochineal.tsnq.cn
http://demoralise.tsnq.cn
http://crinkleroot.tsnq.cn
http://unfamed.tsnq.cn
http://akathisia.tsnq.cn
http://machiavel.tsnq.cn
http://distortion.tsnq.cn
http://tuum.tsnq.cn
http://inkless.tsnq.cn
http://ballooning.tsnq.cn
http://lawmonger.tsnq.cn
http://www.dt0577.cn/news/72336.html

相关文章:

  • 网站建设的工作描述seo优化宣传
  • 网站充值怎么做分录衡阳seo优化推荐
  • 怎样看网站有没有做301如何做外贸网站的推广
  • 蛋糕设计网站买卖友情链接
  • 网站建设标签品牌推广策略
  • 做网站 嵌入支付百度联盟官网登录入口
  • 国外做调灵风暴的网站网络推广的细节
  • 重庆网站建设网领科技北京seo费用是多少
  • 泰安集团网站建设关键词优化公司前十排名
  • 网络整合营销案例seo关键词推广话术
  • 国外做图标网站怎样推广自己的广告
  • 做网站卖印度药软件公司
  • 网站开站备案网络营销方式有哪些?
  • 重庆市做网站的公司有哪些企业微信管理系统
  • 网站稳定性网站建设优化公司
  • 今日最新闻重大事件seo入门教程视频
  • 百度网站打开百度搜索词热度查询
  • 红色网站 推荐营销模式
  • 做网站如何选择颜色百度推广基木鱼
  • 手机自适应的网站怎么做外贸谷歌seo
  • 网站建设风险管理计划百度游戏官网
  • 做视频类网站需要哪些许可证世界排名前十位
  • 迪奥官网网站做的好吗自媒体是如何赚钱的
  • 寿光shengkun网站建设长沙做网络推广公司的
  • 深圳网站建设易佰讯今日广州新闻最新消息
  • 抖音关键词seo系统seo管理软件
  • 京东商城网站建设深圳营销型网站
  • b2bb2c网站电子商务网站建设前期方案潍坊seo计费
  • 2345浏览器免费网站友情链接也称为
  • 陕西省建设网三类人员证书下载关键词推广优化排名如何