配置CentOS-镜像源163
网址:CentOS镜像使用帮助
首先备份/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载对应版本repo文件
运行以下命令生成缓存
yum clean all yum makecache
安装OPENJDK及PYTHON
yum install java-1.8.0-openjdk.x86_64 yum install java-1.8.0-openjdk-devel.x86_64 yum install python
注:请确保python是2.7版本
安装MySQL
卸载CentOS7系统自带mariadb
//检查系统中有无安装过mysql rpm -qa|grep mysql //查询所有mysql 对应的文件夹,全部删除 whereis mysql find / -name mysql # 查看系统自带的Mariadb # rpm -qa|grep mariadb mariadb-libs-5.5.44-2.el7.centos.x86_64 # 卸载系统自带的Mariadb # rpm -e --nodeps mariadb-libs-5.5.44-2.el7.centos.x86_64 # 删除etc目录下的my.cnf ,一定要删掉,等下再重新建,之前我将就用这个文件,后面改配置各种不生效 # rm /etc/my.cnf
以Yum方式安装MySQL
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm yum -y install mysql57-community-release-el7-10.noarch.rpm yum -y install mysql-community-server systemctl start mysqld.service systemctl status mysqld.service systemctl enable mysqld # 查看初始密码 grep "password" /var/log/mysqld.log # 登录mysql mysql -uroot -p
# 修改密码规则 mysql> set global validate_password_policy=0; mysql> set global validate_password_length=1; # 修改本地root密码 mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password'; # 设置远程登录 mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'daasan7ujm^YHN' WITH GRANT OPTION; mysql> flush privileges;
配置mysql默认编码为utf-8
vim /etc/my.cnf character_set_server=utf8 init_connect='SET NAMES utf8' systemctl restart mysqld
mysql> show variables like '%character%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+
解压及配置安装 datax
上传DataX及DataWeb文件
# 解压文件 tar -zxvf datax.tar.gz tar -zxvf datax-web-2.1.2.tar.gz
安装
# 执行bin目录下的install.sh install.sh root@localhost datax-web-2.1.2]# bin/install.sh 2021-05-19 19:24:10.002 [INFO] (2242) Creating directory: [/home/datax-web-2.1.2/bin/../modules]. 2021-05-19 19:24:10.007 [INFO] (2242) ####### Start To Uncompress Packages ###### 2021-05-19 19:24:10.010 [INFO] (2242) Uncompressing.... Do you want to decompress this package: [datax-admin_2.1.2_1.tar.gz]? (Y/N)y 2021-05-19 19:24:12.380 [INFO] (2242) Uncompress package: [datax-admin_2.1.2_1.tar.gz] to modules directory Do you want to decompress this package: [datax-executor_2.1.2_1.tar.gz]? (Y/N)y 2021-05-19 19:24:15.999 [INFO] (2242) Uncompress package: [datax-executor_2.1.2_1.tar.gz] to modules directory 2021-05-19 19:24:16.284 [INFO] (2242) ####### Finish To Umcompress Packages ###### Scan modules directory: [/home/datax-web-2.1.2/bin/../modules] to find server under dataxweb 2021-05-19 19:24:16.289 [INFO] (2242) ####### Start To Install Modules ###### 2021-05-19 19:24:16.291 [INFO] (2242) Module servers could be installed: [datax-admin] [datax-executor] Do you want to confiugre and install [datax-admin]? (Y/N)y 2021-05-19 19:24:18.710 [INFO] (2242) Install module server: [datax-admin] Start to make directory 2021-05-19 19:24:18.739 [INFO] (2289) Start to build directory 2021-05-19 19:24:18.742 [INFO] (2289) Creating directory: [/home/datax-web-2.1.2/modules/datax-admin/bin/../logs]. 2021-05-19 19:24:18.791 [INFO] (2289) Directory or file: [/home/datax-web-2.1.2/modules/datax-admin/bin/../conf] has been exist 2021-05-19 19:24:18.794 [INFO] (2289) Creating directory: [/home/datax-web-2.1.2/modules/datax-admin/bin/../data]. end to make directory Start to initalize database 2021-05-19 19:24:18.838 [INFO] (2289) Scan out mysql command, so begin to initalize the database Do you want to initalize database with sql: [/home/datax-web-2.1.2/bin/db/datax_web.sql]? (Y/N)y Please input the db host(default: 127.0.0.1): # 连接地址 Please input the db port(default: 3306): # port Please input the db username(default: root): # 用户 Please input the db password(default: ): hzsw@123 # 密码 Please input the db name(default: dataxweb) mysql: [Warning] Using a password on the command line interface can be insecure. Do you want to confiugre and install [datax-executor]? (Y/N)y 2021-05-19 19:26:24.587 [INFO] (2242) Install module server: [datax-executor] 2021-05-19 19:26:24.618 [INFO] (2373) Start to build directory 2021-05-19 19:26:24.621 [INFO] (2373) Creating directory: [/home/datax-web-2.1.2/modules/datax-executor/bin/../logs]. 2021-05-19 19:26:24.668 [INFO] (2373) Directory or file: [/home/datax-web-2.1.2/modules/datax-executor/bin/../conf] has been exist 2021-05-19 19:26:24.671 [INFO] (2373) Creating directory: [/home/datax-web-2.1.2/modules/datax-executor/bin/../data]. 2021-05-19 19:26:24.713 [INFO] (2373) Creating directory: [/home/datax-web-2.1.2/modules/datax-executor/bin/../json]. 2021-05-19 19:26:24.755 [INFO] (2242) ####### Finish To Install Modules ######
查看安装
jps -l
配置 datax
# datax-executor 相关配置 # 将datax bin目录下的datax.py文件位置添加到 datax-web-2.1.2配置文件 cd /home/datax-web-2.1.2/modules/datax-executor/bin vim env.properties ## PYTHON脚本执行位置 #PYTHON_PATH=/home/hadoop/install/datax/bin/datax.py PYTHON_PATH=/home/datax/bin/datax.py # dataX-admin相关配置 cd /home/datax-web-2.1.2/modules/datax-admin/bin vim env.properties #JAVA_HOME="" WEB_LOG_PATH=${BIN}/../logs WEB_CONF_PATH=${BIN}/../conf DATA_PATH=${BIN}/../data SERVER_PORT=9527 # port #PID_FILE_PATH=${BIN}/dataxadmin.pid # mail account MAIL_USERNAME="" # 邮件 可以不写 MAIL_PASSWORD="" # 密码 #debug #REMOTE_DEBUG_SWITCH=true #REMOTE_DEBUG_PORT=7003
datax相关配置
# 查看数据库连接配置文件 cd /home/datax-web-2.1.2/modules/datax-admin/conf vim bootstrap.properties #Database DB_HOST=127.0.0.1 DB_PORT=3306 DB_USERNAME=root DB_PASSWORD=hzsw@123456 DB_DATABASE=dataxweb # 相关配置文件,log等配置 cd /home/datax-web-2.1.2/modules/datax-admin/ vim application.yml # 查看操作文档 cd /home/datax-web-2.1.2 vim README.md
运行
# 运行 cd /home/datax-web-2.1.2/bin/ ./start-all.sh 2021-05-20 09:44:02.335 [INFO] (11248) Try To Start Modules In Order 2021-05-20 09:44:02.343 [INFO] (11256) ####### Begin To Start Module: [datax-admin] ###### 2021-05-20 09:44:02.351 [INFO] (11264) load environment variables 2021-05-20 09:44:02.662 [INFO] (11264) java 2021-05-20 09:44:02.665 [INFO] (11264) Waiting DATAX-ADMIN to start complete ... 2021-05-20 09:44:02.810 [INFO] (11264) DATAX-ADMIN start success 2021-05-20 09:44:02.819 [INFO] (11596) ####### Begin To Start Module: [datax-executor] ###### 2021-05-20 09:44:02.828 [INFO] (11604) load environment variables 2021-05-20 09:44:03.192 [INFO] (11604) java 2021-05-20 09:44:03.196 [INFO] (11604) Waiting DATAX-EXEXUTOR to start complete ... 2021-05-20 09:44:03.353 [INFO] (11604) DATAX-EXEXUTOR start success [root@localhost bin]# jps -l 11493 com.wugui.datax.admin.DataXAdminApplication 11894 com.wugui.datax.executor.DataXExecutorApplication 12061 sun.tools.jps.Jps
开启端口
firewall-cmd --zone=public --add-port=9527/tcp --permanent firewall-cmd --reload
访问
http://ip:9527/index.html 默认管理员用户名:admin 密码:123456