diff --git a/操作文档/10、Doris部署.md b/操作文档/10、Doris部署.md new file mode 100644 index 00000000..0eb2602d --- /dev/null +++ b/操作文档/10、Doris部署.md @@ -0,0 +1,236 @@ +### 一、下载$JDK17$ + +```shell +# 下载wget +yum install wget -y + +# 进入工作目录 +cd /usr/local + +# 下载文件 +wget https://download.oracle.com/java/17/archive/jdk-17.0.10_linux-x64_bin.tar.gz + +# 解压+移动 +tar -xzvf jdk-17.0.10_linux-x64_bin.tar.gz && mv jdk-17.0.10 /usr/local/jdk17 && rm -rf jdk-17.0.10_linux-x64_bin.tar.gz + +# 配置 +echo 'export JAVA_HOME=/usr/local/jdk17' | sudo tee -a /etc/profile && \ +echo 'export PATH=$JAVA_HOME/bin:$PATH' | sudo tee -a /etc/profile +source /etc/profile + +# 检查 +java -version 2>&1 | grep "17.0.10" +``` + + + +### 二、系统检查 + +**关闭 $swap$ 分区** + +```shell +# 临时关闭 +swapoff -a + +# 永久关闭 +sed -i '/swap/s/^/#/' /etc/fstab +``` + +**关闭防火墙** + +```shell +systemctl stop firewalld +systemctl disable firewalld +systemctl status firewalld +``` + + + +**配置 $chrony$ 服务** + +```shell +# 安装与启动 +dnf install -y chrony +systemctl enable --now chronyd + +vi /etc/chrony.conf +# 添加内容 +server ntp.aliyun.com iburst +server time.cloudflare.com iburst + +# chrony验证 +timedatectl status +chronyc tracking | grep "Leap status" +``` + +**设置系统最大打开文件句柄数** + +```shell +# 临时生效 +ulimit -n 65535 + +# 永久生效 +vi /etc/security/limits.conf + +# 增加以下内容 +* soft nofile 1048576 +* hard nofile 1048576 +* soft nproc 65535 +* hard nproc 65535 +root soft nofile 1048576 +root hard nofile 1048576 +``` + +**修改虚拟内存区域数量为** + +```shell +sysctl -w vm.max_map_count=2000000 +``` + +**关闭透明大页** + +```shell +echo never > /sys/kernel/mm/transparent_hugepage/enabled +echo never > /sys/kernel/mm/transparent_hugepage/defrag +``` + +**执行生效** + +``` +sysctl -p +``` + +## 三、部署$doris$ + +**1、解压安装包** + +```shell +cd /usr/local +# 下载 +wget https://apache-doris-releases.oss-accelerate.aliyuncs.com/apache-doris-3.0.5-bin-x64.tar.gz +# 解压 +tar -xzvf apache-doris-3.0.5-bin-x64.tar.gz +# 迁移目录 +mv apache-doris-3.0.5-bin-x64 doris && rm -rf apache-doris-3.0.5-bin-x64.tar.gz +``` + +**2、部署$FE$** + +```shell +# 创建目录 +mkdir -p /usr/local/doris/doris-meta +mkdir -p /usr/local/doris/doris-storage +``` + +修改$FE$配置文件 + +```shell +vi /usr/local/doris/fe/conf/fe.conf +# 增加内容 +JAVA_HOME=/usr/local/jdk17 + +#网段按照实际情况,如服务器的IP是10.10.14.250,那么网关就是10.10.14.0 +priority_networks = 10.10.14.0/24 + +#元数据存储目录 +meta_dir = /usr/local/doris/doris-meta +``` + +**3、启动$FE$** + +```shell +# 加上--daemon 后台启动 +/usr/local/doris/fe/bin/start_fe.sh --daemon +``` + +> **备注**: + +```shell +# 如果有问题,到下面的路径查看日志 +/usr/local/doris/fe/log +``` + +**4、验证 $FE$ 状态** + +```shell +# 安装MySQL客户端核心组件 +dnf install mysql -y + +# 验证安装 +mysql --version # 查看版本信息 + +# 通过 MySQL 客户端连接 看是否能连接成功 +mysql -h 127.0.0.1 -P 9030 -uroot +``` + +![](https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/BlogImages/202505091305243.png) + +**5、部署$BE$** + +```shell +# 增加配置信息 +vi /usr/local/doris/be/conf/be.conf + +JAVA_HOME=/usr/local/jdk17 +priority_networks = 10.10.14.0/24 +storage_root_path = /usr/local/doris/doris-storage +``` + +**6、启动$BE$** + +```shell +# 后台启动命令 +/usr/local/doris/be/bin/start_be.sh --daemon +``` + + + +## 四、集群管理 + +**1、将$BE$添加到$FE$** + +```shell +# 使用 MySQL 客户端连接 FE +mysql -h 127.0.0.1 -P 9030 -uroot + +# 添加 BE 节点 +ALTER SYSTEM ADD BACKEND "127.0.0.1:9050"; + +# 修改密码 +SET PASSWORD FOR 'root' = PASSWORD('DsideaL147258369'); +``` + +**2、验证节点状态** + +```shell +SHOW PROC '/backends'\G +-- 检查 `Alive` 字段为 `true` +``` + +![](https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/BlogImages/202505091312869.png) + +**3、创建数据库** + +```sql +create database yltcharge; +``` + +### 五、参考文档 + +[单机安装及部署Doris3.0.2(最新最全超级详细图文解说)](https://blog.csdn.net/weixin_36467887/article/details/146401005) + +​ + +### 六、配置$CDC$需要$JDK21$ + +```shell +# 进入工作目录 +cd /usr/local + +# 下载文件 +wget https://download.oracle.com/java/21/archive/jdk-21.0.7_linux-x64_bin.tar.gz + +# 解压+移动 +tar -xzvf jdk-21.0.7_linux-x64_bin.tar.gz && mv jdk-21.0.7 /usr/local/jdk21 && rm -rf jdk-21.0.7_linux-x64_bin.tar.gz +``` + diff --git a/操作文档/2、安装Mysql5.7.md b/操作文档/2、安装Mysql5.7.md new file mode 100644 index 00000000..cf152091 --- /dev/null +++ b/操作文档/2、安装Mysql5.7.md @@ -0,0 +1,221 @@ +### 安装$Mysql$ $5.7$​ + +```shell +yum install lrzsz -y +mkdir /usr/local -p +cd /usr/local +rz -be 选择 mysql-5.7.42-el7-x86_64.tar.gz +tar -zxf mysql-5.7.42-el7-x86_64.tar.gz +mv mysql-5.7.42-el7-x86_64 mysql +rm -rf mysql-5.7.42-el7-x86_64.tar.gz + +vi /etc/profile +#添加如下内容 +export PATH=/usr/local/mysql/bin:$PATH +#然后source生效 +source /etc/profile + +#添加用户并授权相关 +useradd mysql +id mysql +mkdir /data/mysql -p +chown -R mysql:mysql /usr/local/mysql/* +chown -R mysql:mysql /data/* + +其中: +/usr/local/mysql/是MySQL软件所在目录。 +/data/mysql是将来存放MySQL数据的目录。 + +#安装依赖包 +yum install libaio -y +#初始化数据库 +mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql + + +#配置文件 + +vi /etc/my.cnf + +[mysqld] +basedir = /usr/local/mysql +datadir = /data/mysql +skip-external-locking +skip-name-resolve +back_log = 100 +max_connections = 2048 +max_connect_errors = 30 +table_open_cache = 2048 +open_files_limit = 16384 +max_allowed_packet = 16M +read_buffer_size = 8M +read_rnd_buffer_size = 32M +sort_buffer_size = 2M +join_buffer_size = 2M +thread_cache_size = 16 +query_cache_size = 128M +query_cache_limit = 4M +slow_query_log = 1 +long_query_time = 2 +lower_case_table_names = 1 +innodb_file_per_table = 1 +max_allowed_packet = 64M +server-id = 1 +log-bin = mysql-bin +expire_logs_days = 7 +binlog_format = ROW + +innodb_data_file_path = ibdata1:10M:autoextend +innodb_buffer_pool_size = 2G +innodb_write_io_threads = 8 +innodb_read_io_threads = 8 +innodb_flush_log_at_trx_commit = 2 +innodb_log_buffer_size = 16M +innodb_log_file_size = 170M +innodb_lock_wait_timeout = 60 +``` + + + +#### 管理MySQL_etc/init.d + +```shell +mkdir /etc/init.d -p +cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld +``` + + + +#### 重定向文件 + +``` +ln -s /usr/lib64/libncurses.so.6.2 /usr/lib64/libncurses.so.5 +ln -s /usr/lib64/libtinfo.so.6.2 /usr/lib64/libtinfo.so.5 + +#启动、重启命令 +service mysqld start +service mysqld restart +``` + + + +#### 重置密码 + +``` +/etc/init.d/mysqld stop + +mysqld_safe --user=mysql --skip-grant-tables --skip-networking & +mysql +update mysql.user set authentication_string=PASSWORD("DsideaL147258369") where user='root' and host='localhost'; + +flush privileges; + +GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'DsideaL147258369' WITH GRANT OPTION; + +flush privileges; +exit + +/etc/init.d/mysqld restart +mysql -uroot -pDsideaL147258369 +``` + + + +现在用Navicat Prenium就可以远程访问到数据库了。 + +``` +YLT项目中使用的用户名:ycharge,密码:ycharge 需要创建 +CREATE USER 'ycharge'@'%' IDENTIFIED BY 'ycharge'; +GRANT all privileges ON yltcharge.* TO 'ycharge'@'%'; +FLUSH PRIVILEGES; +``` + + + +#### 创建使用账号 + +```sql +GRANT ALL PRIVILEGES ON *.* TO ycharge@"%" IDENTIFIED BY "ycharge"; +flush privileges; +``` + + + +$/etc/my.cnf$ + +``` +[mysqld] +user=mysql +basedir=/usr/local/mysql +datadir=/usr/local/db/mysql_bkdata +log-bin=/usr/local/mysql/binlog +binlog_format=row +server_id=1 +port=22066 +socket=/tmp/mysql.sock + + +default-time-zone='Asia/Shanghai' + +lower_case_table_names=1 +max_connections = 2048 +max_connect_errors = 30 +table_open_cache = 2048 +open_files_limit = 16384 +max_allowed_packet = 16M +read_buffer_size = 8M +read_rnd_buffer_size = 32M +sort_buffer_size = 2M +join_buffer_size = 2M +thread_cache_size = 16 +query_cache_size = 128M +server_id=1 + +port=22066 +socket=/tmp/mysql.sock + + +default-time-zone='Asia/Shanghai' + +lower_case_table_names=1 +max_connections = 2048 +max_connect_errors = 30 +table_open_cache = 2048 +open_files_limit = 16384 +max_allowed_packet = 16M +read_buffer_size = 8M +read_rnd_buffer_size = 32M +sort_buffer_size = 2M +join_buffer_size = 2M +thread_cache_size = 16 +query_cache_size = 128M +query_cache_limit = 4M +slow_query_log = 1 +long_query_time = 2 +innodb_file_per_table = 1 +max_allowed_packet = 64M + +innodb_data_file_path = ibdata1:10M:autoextend +innodb_buffer_pool_size = 2G +innodb_write_io_threads = 8 +innodb_read_io_threads = 8 +innodb_flush_log_at_trx_commit = 2 +innodb_log_buffer_size = 16M +innodb_log_file_size = 170M +innodb_lock_wait_timeout = 60 + +#sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION + +sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION + +[mysql] +socket=/tmp/mysql.sock +``` + + + +### 挂载磁盘 + +``` +mount /dev/sdb1 /usr/local/db +``` + diff --git a/操作文档/9、安装RocketMQ5.3.2.md b/操作文档/9、RocketMQ5.3.2.md similarity index 100% rename from 操作文档/9、安装RocketMQ5.3.2.md rename to 操作文档/9、RocketMQ5.3.2.md