大数据之数据采集项目总结——hadoop,hive,openresty,frcp,nginx,flume

news2024/10/6 12:33:09

1、前期准备

在这里插入图片描述

2、数据收集

1、开启openresty,nginx和frcp内网穿透

在这里插入图片描述

2、编辑并启动定时器

在这里插入图片描述

3、查看是否收集到了数据

在这里插入图片描述

数据收集阶段结束,进入下一个阶段

2、将收集到的切分好的数据上传到hdfs

使用的工具:flume
flume像一个管道一样,将文件数据上传到hdfs上
需要配置好source ,channel 和 sink
source:spooling(监视目录中的新文件,一有新文件产生便上传)
channel:memory (速度快)
sink:hdfs

1、使用flume

编写配置文件

vim /opt/installs/flume1.9.0/conf/job/collect-app_spooling_memory_hdfs.conf

# 内容
a1.sources.source1.type = spooldir
a1.sources.source1.spoolDir = /opt/apps/collect-app/datas
a1.sources.source1.fileSuffix = .COMPLETED
a1.sources.source1.fileHeader = true
a1.sources.source1.includePattern = ^collect-app-access.*.log
a1.sources.source1.deserializer.maxLineLength = 5120

a1.sources.source1.interceptors = i1
a1.sources.source1.interceptors.i1.type = demo.DcInterceptor$Builder

# channel
a1.channels.channel1.type = memory
a1.channels.channel1.capacity = 10000
a1.channels.channel1.transactionCapacity = 10000
a1.channels.channel1.byteCapacityBufferPercentage = 20
a1.channels.channel1.byteCapacity = 800000

# sink
a1.sinks.sink1.type = hdfs
a1.sinks.sink1.hdfs.path = hdfs://datacollection:8020/sources/news/%{ctime}
a1.sinks.sink1.hdfs.filePrefix = news-%Y%m%d_%H
a1.sinks.sink1.hdfs.fileSuffix = .gz
a1.sinks.sink1.hdfs.codeC = gzip
a1.sinks.sink1.hdfs.batchSize = 100
a1.sinks.sink1.hdfs.fileType = CompressedStream
a1.sinks.sink1.hdfs.writeFormat = Text
a1.sinks.sink1.hdfs.useLocalTimeStamp = true
a1.sinks.sink1.hdfs.threadsPoolSize = 10
a1.sinks.sink1.hdfs.idleTimeout = 60

## 目录滚动
a1.sinks.sink1.hdfs.round = true
a1.sinks.sink1.hdfs.roundValue = 24
a1.sinks.sink1.hdfs.roundUnit = hour

## 文件滚动
a1.sinks.sink1.hdfs.rollInterval = 600
a1.sinks.sink1.hdfs.rollSize = 1048576
a1.sinks.sink1.hdfs.rollCount = 0

a1.sources.source1.channels = channel1
a1.sinks.sink1.channel = channel1

编写一个自定义过滤器
在pom.xml中添加依赖

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>flume-test</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>

    <dependencies>
        <!-- https://mvnrepository.com/artifact/org.apache.flume/flume-ng-core -->
        <dependency>
            <groupId>org.apache.flume</groupId>
            <artifactId>flume-ng-core</artifactId>
            <version>1.9.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.48</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <!-- 禁止生成 dependency-reduced-pom.xml-->
                    <createDependencyReducedPom>false</createDependencyReducedPom>
                </configuration>
                <executions>
                    <!-- Run shade goal on package phase -->
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <relocations>
                                <relocation>
                                    <!-- 解决包冲突 进行转换-->
                                    <pattern>com.google.protobuf</pattern>
                                    <shadedPattern>shaded.com.google.protobuf</shadedPattern>
                                </relocation>
                            </relocations>
                            <artifactSet>
                                <excludes>
                                    <exclude>log4j:*</exclude>
                                </excludes>
                            </artifactSet>
                            <filters>
                                <filter>
                                    <!-- Do not copy the signatures in the META-INF folder.
                                    Otherwise, this might cause SecurityExceptions when using the JAR. -->
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/*.SF</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                            <transformers>
                                <!-- 某些jar包含具有相同文件名的其他资源(例如属性文件)。 为避免覆盖,您可以选择通过将它们的内容附加到一个文件中来合并它们-->
                                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                    <resource>reference.conf</resource>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>mainclass</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

Java代码:

package demo;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPath;
import com.google.common.collect.Lists;
import org.apache.commons.codec.binary.Base64;
import org.apache.flume.Context;
import org.apache.flume.Event;
import org.apache.flume.interceptor.Interceptor;

import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class DcInterceptor implements Interceptor {
    /**
     * 初始化方法,当拦截器初始化的时候调用一次
     */
    public void initialize() {}

    /**
     * 处理单条数据
     * @param event 一条数据
     *
     * jksflkdsfjklasdjlfkas-fjaskfasdfjkasdflasdfljkasdlk
     */
    public Event intercept(Event event) {
        //1. 获取数据本身
        String text = new String(event.getBody());
        //2. 切割
        String[] textArray = text.split("-");

        byte[] body = null;
        //3. 判断
        if (textArray.length == 2) {
            try {
                //4. 获取到解码的字符串
                String meta = new String(Base64.decodeBase64(textArray[0]));
                String content = new String(Base64.decodeBase64(textArray[1]));

                //5. 将json的字符串转换为json的对象:ctime、project、ip
                JSONObject jsonMeta = JSONObject.parseObject(meta);

                //6. 获取到字段: ctime: 111111.111
                String ctime = JSONPath.eval(jsonMeta, "$.ctime").toString();
                DateFormat fmt = new SimpleDateFormat("yyyyMMdd");
                ctime = fmt.format(Double.parseDouble(ctime)); // 20220622

                //7. 将ctime的字段插入到flume的event的header中
                event.getHeaders().put("ctime", ctime);

                //8. 解析content
                JSONObject jsonContent = JSONObject.parseObject(content);

                //9. 将jsonContent和jsonMeta对象合并为一个json对象
                //{"project":"news","ip":"127.0.0.1","ctime":1589781236541}
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("ctime", JSONPath.eval(jsonMeta, "$.ctime"));
                jsonObject.put("project", JSONPath.eval(jsonMeta, "$.project"));
                jsonObject.put("content",JSONPath.eval(jsonContent, "$.content"));

                //10. 复制body数组
                body = jsonObject.toString().getBytes();
            }catch (Exception e) {
                e.printStackTrace();
                return null;
            }
        }
        //11. 设置event的值
        event.setBody(body);
        return event;
    }

    /**
     * 自动被调用
     */
    public List<Event> intercept(List<Event> list) {
        //1. 创建数组返回这个结果
        ArrayList<Event> inter = Lists.newArrayListWithCapacity(list.size());
        //2. 遍历
        for(Event event : list) {
            Event e = intercept(event);
            if (e != null) inter.add(e);
        }
        return inter;
    }

    /**
     * 临死之前调用一次
     */
    public void close() {}

    /**
     * 申明Builder,这个方法会在flume拦截器创建的时候自动被调用
     */
    public static class Builder implements Interceptor.Builder {
        public Interceptor build() {
            return new DcInterceptor();
        }
        public void configure(Context context) {}
    }
}

经过clean——compile——package后上传至Linux的flume安装文件夹的lib目录下
在这里插入图片描述

启动flume:

flume-ng agent -n a1 -c ../conf/job -f collect_spooling_memory_hdfs.conf

出现下图中的日志说明文件上传成功:
在这里插入图片描述
查看hdfs:
在这里插入图片描述
在Linux中通过命令解压查看hdfs上的数据

hdfs dfs -cat /sources/news/20230703/news-20230703_00.1688397220377.gz | gzip -d

在这里插入图片描述

复制其中的数据:
{"ctime":1688393544569,
"project":"news",
"content":{
	"distinct_id":"1544",
	"event":"AppPageView",
	"type":"track",
	"uuid":"7583344f-8059-4763-b2d1-b4d56be4880c",
	"properties":{
		"element_page":"注册登录页",
		"screen_width":"1080",
		"app_version":"2.2",
		"os":"Windows",
		"battery_level":"17",
		"device_id":"MEIYAXXXXXA8667F3D4EBD",
		"client_time":"2023-07-03 22:11:19",
		"action_type":"",
		"ip":"106.94.118.3",
		"is_charging":"1",
		"manufacturer":"",
		"article_id":"",
		"carrier":"中国电信",
		"screen_height":"1152",
		"imei":"418324002819",
		"model":"Unknown",
		"network_type":"4G",
		"element_name":""
		}
	}
}

{"ctime":1688393601776,
"project":"news",
"content":{
	"distinct_id":"4115",
	"type":"profile_set",
	"uuid":"14513e1e-b4fd-486f-a50b-aad00183738d",
	"properties":{
		"gender":"女",
		"nick_name":"沈音华Harris*0273",
		"mobile":"86-13594019409",
		"name":"盛采珊",
		"signup_time":1688393536000,
		"email":"KellyRussel0436@hotmail.com",
		"age":"45"
		}
	}
}

4、hdfs上的数据导入到hive表中

1、将两个解析JSON需要用到的jar包导入到hdfs上

创建文件夹:hdfs dfs -mkdir -p /common/lib
将两个文件上传至hdfs的这个/common/lib目录下面
hdfs dfs -put json-serde-1.3.8-jar-with-dependencies.jar /common/lib
hdfs dfs -put json-udf-1.3.8-jar-with-dependencies.jar /common/lib

2、编辑.hiverc文件,每次启动beeline时导入这两个jar包

[root@hadoop ~]# vi ~/.hiverc
add jar hdfs:///common/lib/json-udf-1.3.8-jar-with-dependencies.jar;
add jar hdfs:///common/lib/json-serde-1.3.8-jar-with-dependencies.jar;

##7.beeline需要手动指定这个文件的位置
beeline -i ~/.hiverc

3、启动metastore 和hiveserver2服务

命令:

hive --service metastore &
hive -- service hiveserver2

在这里插入图片描述

4、在hive中创建分区表:

创建表:

CREATE EXTERNAL TABLE if not exists ods_news.news(project string,ctime string,content struct<distinct_id:string,event:string,properties:struct<model:string,network_type:string,is_charging:string,app_version:string,element_name:string,element_page:string,carrier:string,os:string,imei:string,battery_level:string,screen_width:string,screen_height:string,device_id:string,client_time:string,ip:string,manufacturer:string>>) PARTITIONED BY(logday string) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' LOCATION '/sources/news/';

在这里插入图片描述
添加分区列:

# ${exec_date} 是指传进来的日期,一般今天导入昨天的数据,昨天导入前天的数据
alter table ods_news.news drop if exists partition(logday='${exec_date}');alter table ods_news.news add partition(logday='${exec_date}') location 'hdfs://${B_HOST}:8020/sources/news/${exec_date}';
# 这两句修改表的HQL语句意思是:如果存在以某日期为分区字段的分区列,则删除。再新增一个以${exec_date}为名的分区列,并指定它在hdfs上的分区路径。
alter table ods_news.news drop if exists partition(logday='20230703');alter table ods_news.news add partition(logday='20230703') location 'hdfs://datacollection:8020/sources/news/20230703';

在这里插入图片描述
查看数据:

select * from news limit 3;

在这里插入图片描述

| news          
| 1688393474539  
| {"distinct_id":"1621",
"event":"AppPageView",
	"properties":{
	"model":"iPad Air2",
	"network_type":"2G",
	"is_charging":"0",
	"app_version":"1.2",
	"element_name":"",
	"element_page":"活动页",
	"carrier":"中国联通",
	"os":"",
	"imei":"263504420203",
	"battery_level":"20",
	"screen_width":"1024",
	"screen_height":"768",
	"device_id":"FIBERHOMEdeb4ad27bf2d",
	"client_time":"2023-07-03 22:10:09",
	"ip":"121.76.68.177",
	"manufacturer":"Apple"
	}
} 
| 20230703     |

观察上面的数据,我们如果想要查询carrier字段的值,我们需要select news.properties.carrier,查询的时候有些费劲,我们可以创建一个news_parquet表将news表中的数据查询出来,插入到news_parquet表中。
把上面的需求编写成一个脚本:news_parquet.sh

#!/bin/bash
# desc:将news表的数据导出到news_parquet表中

##1. 申明变量
B_HOST=datacollection
B_PORT=10000
B_USER=root
HIVE_HOME=/opt/installs/hive3.1.2

##2. 导入的日期
exec_date=$1
# 在执行脚本时,传入了参数,则exec_date为传入日期的前一天,否则,exec_date为当前日期的前一天
if [ "${exec_date}" ]; then
	exec_date=`date -d "${exec_date} 1 days ago" +%Y%m%d`
else
	exec_date=`date -d "1 days ago" +%Y%m%d`
fi

echo "news_parquet.sh exec_date is ${exec_date}"

##3. 建表的SQL
CREATE_TABLE_SQL="create external table if not exists ods_news.news_parquet(
event string,
ctime string,
distinct_id string,
model string,
network_type string,
is_charging string,
app_version string,
element_name string,
element_page string,
carrier string,
os string,
imei string,
battery_level string,
screen_width string,
screen_height string,
device_id string,
client_time string,
ip string,
manufacturer string
)
partitioned by(logday string)
stored as parquet
location '/sources/news-parquet'"
# hdfs 上需要有news-parquet这个目录
echo "${CREATE_TABLE_SQL}"

# 在不进入beeline的情况下执行创建表的SQL语句
${HIVE_HOME}/bin/beeline -i ~/.hiverc -n ${B_USER} -p 123456 -u jdbc:hive2://${B_HOST}:${B_PORT} -e "${CREATE_TABLE_SQL}"

##4. 修改表:添加分区
NEWS_PARQUET_SQL="set hive.exec.dynamic.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;
insert overwrite table ods_news.news_parquet partition(logday)
select
content.event,
ctime,
content.distinct_id,
content.properties.model,
content.properties.network_type,
content.properties.is_charging,
content.properties.app_version,
content.properties.element_name,
content.properties.element_page,
content.properties.carrier,
content.properties.os,
content.properties.imei,
content.properties.battery_level,
content.properties.screen_width,
content.properties.screen_height,
content.properties.device_id,
content.properties.client_time,
content.properties.ip,
content.properties.manufacturer,
logday
from ods_news.news
where logday=${exec_date}
"

echo "${NEWS_PARQUET_SQL}"
# 在不进入beeline的情况下执行修改表的SQL语句
${HIVE_HOME}/bin/beeline -i ~/.hiverc -n ${B_USER} -p 123456 -u jdbc:hive2://${B_HOST}:${B_PORT} -e "${NEWS_PARQUET_SQL}"

##5. 结束
echo "executable sql successful"

执行脚本:

sh news_parquet.sh [日期]

创建表成功:创建表成功
查询数据:
在这里插入图片描述

使用DBever查询结果展示:
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/718190.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

三十九、动态规划——线性DP问题-例题题解

线性DP问题的例题状态划分 一、问题&#xff1a;数字三角形1、题目内容2、状态划分1&#xff09;状态编号 f[i][j]2&#xff09;状态划分 3、题解 二、最长上升子序列1、题目内容2、状态划分1&#xff09;状态编号 f[i]2&#xff09;状态划分 3、题解 三、最长公共子序列1、题目…

【二维偏序+双指针】ABC245 E

E - Wrapping Chocolate (atcoder.jp) 题意&#xff1a; 思路&#xff1a; 因为两个数组都是无序的&#xff0c;因此可以考虑给这两个数组都排个序 将物品和盒子都按照两个维度去排序 我们可以先去枚举物品&#xff0c;然后去选对应的盒子 在选盒子的过程中&#xff0c;注…

【王道·操作系统】第四章 文件管理(下)

一、文件系统 1.1 文件系统的层次结构 用户需要通过操作系统提供的接口发出上述请求——用户接口由于用户提供的是文件的存放路径&#xff0c;因此需要操作系统一层一层地查找目录&#xff0c;找到对应的目录项——文件目录系统不同的用户对文件有不同的操作权限&#xff0c;因…

c++读取字符串字符时出错

这是我做的一个c爬虫程序但是在抓取网页的时候string类型传递出现了问题 以下是图片代码 url的值是 "http://desk.zol.com.cn/" 我不知道为什么数据传递会出问题 请大佬指教

Java 串口通信(RS232/485)

Java 串口通信&#xff08;RS232/485&#xff09; 一.串口通信页面二.串口服务实现1.Java 串口通信配置1.扩展包和依赖库2.Pom配置 2.启动类3.工具包类1.Common2.Crc16Modbus3.SerialUtil 4.WebSocket 配置1.启动配置2.监听配置 5.UI交互类1.串口配置对象2.串口信息获取接口3.R…

HOT39-对称二叉树

leetcode原题链接&#xff1a;对称二叉树 题目描述 给你一个二叉树的根节点 root &#xff0c; 检查它是否轴对称。 示例 1&#xff1a; 输入&#xff1a;root [1,2,2,3,4,4,3] 输出&#xff1a;true示例 2&#xff1a; 输入&#xff1a;root [1,2,2,null,3,null,3] 输出&a…

JVM03-优化垃圾回收

JVM的内存区域中&#xff0c;程序计数器、虚拟机栈和本地方法栈这3个区域是线程私有的&#xff0c;随着线程的创建而创建&#xff0c;销毁而销毁&#xff1b;栈中的栈帧随着方法的进入和退出进行入栈和出栈操作&#xff0c;每个栈帧中分配多少内存基本是在类结构确定下来的时候…

消息中间件面试题详解

RabbitMQ 如何保证消息不丢失 消息的重复消费问题如何解决 rabbitmq中死信交换机&#xff08;RabbitMQ延迟队列有了解吗&#xff09; 延迟队列&#xff1a;进入队列的消息会被延迟消费的队列 场景&#xff1a;超时订单&#xff0c;限时优惠&#xff0c;定时发布 延迟队列 …

【Linux】-第一个小程序(进度条)

&#x1f496;作者&#xff1a;小树苗渴望变成参天大树 &#x1f389;作者宣言&#xff1a;认真写好每一篇博客 &#x1f38a;作者gitee:gitee &#x1f49e;作者专栏&#xff1a;C语言,数据结构初阶,Linux,C 动态规划算法 如 果 你 喜 欢 作 者 的 文 章 &#xff0c;就 给 作…

Activiti modoler 整合后报错 TypeError: Cannot read property ‘namespace‘ of undefined

之前在Demo整合过没问题&#xff0c;结果好不容易整合到现在的项目&#xff0c;结果出现成这个鬼样子……问题找了好久&#xff0c;一直以为是SpringSecurity请求限制没放开&#xff0c;所以找SpringSecurity的debug日志&#xff0c;浏览器请求有没有404、500、502等&#xff0…

将OpenAI和ChatGPT模型与LearnDash线上学习平台结合使用

人工智能革命来了&#xff01;&#xff08;以尽可能最好的方式。&#xff09;了解如何使用 Uncanny Automator 通过 OpenAI 和 ChatGPT 模型为您的线上学习和LearnDash LMS提供动力。 当人们听到“人工智能”这个词时&#xff0c;他们往往会想到流氓机器人、无政府状态的机器人…

科技项目验收测试报告包括哪些内容?

科技项目验收测试报告是评估科技项目质量和可靠性的重要文件。通过全面的测试和评估&#xff0c;可以确保项目的质量&#xff0c;提高用户满意度&#xff0c;降低项目风险。 一、科技项目验收测试报告的内容 1. 项目概述&#xff1a;介绍项目的背景、目标和范围&#xff0c;…

从 AI 增强到大模型,企业使用数据的方式又将如何变化?

AI&#xff08;Artificial Intelligence&#xff0c;人工智能&#xff09;的发展不过百年&#xff0c;却已经深刻影响着人们的思维和见解&#xff0c;并逐渐关联到每个人生活和工作的方方面面。从最初的规则引擎和引入统计学方法&#xff0c;到基于知识表示和推理机制的专家系统…

瓴羊QuickBI数据门户帮助企业高效管理和展示数据,使其更加明确易懂

随着信息技术时代的到来&#xff0c;越来越多的企业意识到商业信息是其最宝贵的资产之一。对于获取商业信息&#xff0c;需要专业的数据分析。因此&#xff0c;商业智能BI工具&#xff0c;如瓴羊QuickBI已经成为企业信息化中必不可少的工具。它拥有卓越的数据管理和展示功能&am…

VS2019中WebService实现发布、调用以及问题汇总

VS2019中WebService实现发布、调用以及问题汇总 前言一、WebService是什么&#xff0c;意义有哪些&#xff1f;二、创建二.发布三.访问问题总结1.不是专用连接2.HTTP错误 403.14 - Forbidden3.HTTP 错误 404.3 - Not Found4.应用程序种服务器错误 前言 在对接工厂Mes的过程中&…

图书馆流量监控性能分析案例

前言 图书馆信息中心老师反应&#xff0c;用户反馈系统有访问慢的情况&#xff0c;需要通过流量分析系统来了解图书馆系统的运行情况&#xff0c;此报告专门针对图书馆系统的性能数据做了分析。 图书馆已部署NetInside流量分析系统&#xff0c;使用流量分析系统提供实时和历史…

springboot 整合mybatis plus,使用druid 切换多数据源实现单数据库事务,附赠项目源码地址

项目源码地址 GitHub - liyanlei58/ssm: springboot druid mybatis plus 事务 最近想搭一套spring cloud开发环境&#xff0c;各种不顺利吧&#xff0c;先是spring cloud的组件某些功能不好用&#xff0c;是版本自身的bug。后来又碰到了事务无法回滚&#xff0c;这个搞了好几个…

银河麒麟服务器v10 sp1 安装mysql

可以先用 dpkg --list|grep mysql 查看自己的mysql有哪些依赖&#xff1a; 上图已经是安装后的截图&#xff0c;然后再卸载 sudo apt-get autoremove --purge mysql-common 本文在没有安装之前&#xff0c;只有mysql-common包&#xff0c;再用dpkg --list|grep mysql查看&…

[MySQL]在搭载Linux系统(centos7)的云服务上安装MySQL

[MySQL]MySQL 在 Centos 7环境安装 安装与卸载中&#xff0c;用户全部切换成为root&#xff0c;⼀旦安装&#xff0c;普通用户也能够使用。 文章目录 [MySQL]MySQL 在 Centos 7环境安装1. 卸载不要的环境2. 获取MySQL官方yum源3. 安装mysql yum 源&#xff0c;对比前后yum源4.…

Windows server 下关闭135/139/445端口

一、关闭​ ​135端口​​ 方案一 第一步 运行dcomcnfg&#xff0c;打开“组件服务”→“计算机”&#xff0c;在“我的电脑”上右键点击&#xff0c;选“属性”&#xff1b;然后点默认属性&#xff0c;把“在此计算机上启用分布式COM&#xff08;E&#xff09;”的勾去掉&a…