龙空技术网

0058-如何在CDH集群的非元数据库节点安装MySQL5.7.12

Hadoop实操 49

前言:

现时兄弟们对“mysql1304”大致比较关怀,姐妹们都想要知道一些“mysql1304”的相关文章。那么小编在网摘上汇集了一些有关“mysql1304””的相关知识,希望你们能喜欢,各位老铁们一起来学习一下吧!

温馨提示:要看高清无码套图,请使用手机打开并单击图片放大查看。

1.文档编写目的

在CDH集群中默认使用的MySQL版本是操作系统自带的版本,一般操作系统自带的MySQL版本都会比较低,对于企业已有应用可能会用较新的MySQL版本,使用集群中安装的MySQL时可能会出现SQL不兼容的问题,那么解决方法一是在集群中安装新版本的MySQL,二是升级集群中老版本的MySQL。本文主要选择第一种方法在集群中安装新版本的MySQL,在RedHat6安装时会遇到mysql-community-libs包冲突的问题,卸载冲突包时会将cloudera-manager-agent包也卸载导致Agent异常,在RedHat7安装时会自动更新mysql-community-libs依赖包,本文档主要讲述基于RedHat7.2系统的CDH集群中的非元数据库节点安装MySQL5.7.12。

内容概述

1.安装前准备

2.安装及配置

3.验证

测试环境

1.操作系统:RedHat7.2

2.采用sudo权限的ec2-user用户操作

前置条件

1.集群运行正常

2.选择非元数据库节点安装MySQL5.7.12

2.安装前准备

1.下载MySQL5.7.12的RPM包

2.将下载的MySQL安装包上传至服务器并解压

[ec2-user@ip-172-31-21-45 mysql5.7.12]$ tar -xvf mysql-5.7.12-1.el7.x86_64.rpm-bundle.tar [root@ip-172-31-26-102 mysql5.7.12]# lltotal 539776-rw-r--r-- 1 ec2-user ec2-user 24991304 Mar 29 2016 mysql-community-client-5.7.12-1.el7.x86_64.rpm-rw-r--r-- 1 ec2-user ec2-user 276736 Mar 29 2016 mysql-community-common-5.7.12-1.el7.x86_64.rpm-rw-r--r-- 1 ec2-user ec2-user 3786120 Mar 29 2016 mysql-community-devel-5.7.12-1.el7.x86_64.rpm-rw-r--r-- 1 ec2-user ec2-user 45150068 Mar 29 2016 mysql-community-embedded-5.7.12-1.el7.x86_64.rpm-rw-r--r-- 1 ec2-user ec2-user 23829224 Mar 29 2016 mysql-community-embedded-compat-5.7.12-1.el7.x86_64.rpm-rw-r--r-- 1 ec2-user ec2-user 124953868 Mar 29 2016 mysql-community-embedded-devel-5.7.12-1.el7.x86_64.rpm-rw-r--r-- 1 ec2-user ec2-user 2237968 Mar 29 2016 mysql-community-libs-5.7.12-1.el7.x86_64.rpm-rw-r--r-- 1 ec2-user ec2-user 2115948 Mar 29 2016 mysql-community-libs-compat-5.7.12-1.el7.x86_64.rpm-rw-r--r-- 1 ec2-user ec2-user 51016520 Mar 29 2016 mysql-community-minimal-debuginfo-5.7.12-1.el7.x86_64.rpm-rw-r--r-- 1 ec2-user ec2-user 158252992 Mar 29 2016 mysql-community-server-5.7.12-1.el7.x86_64.rpm-rw-r--r-- 1 ec2-user ec2-user 116098332 Mar 29 2016 mysql-community-test-5.7.12-1.el7.x86_64.rpm

注意:解压出来的文件中,需要删除mysql-community-server-minimal-5.7.12-1.el7.x86_64.rpm,该RPM包和mysql-community-server-5.7.12-1.el7.x86_64.rpm冲突(一个最简版一个完整版根据需要删除)。

3.安装及配置

1.执行如下命令安装

[ec2-user@ip-172-31-26-102 mysql5.7.12]$ sudo yum -y install mysql-community-*

注意:在安装的过程中mariadb-libs.x86_64会被mysql-community-libs-compat和mysql-community-libs替换。在安装过程中可能会出现无法替换导致包冲突问题,需要手动卸载mariadb-libs.x84_64,因为cloudera-manager-agent服务依赖mariadb-libs.x86_64包,在卸载mariadb-libs.x84_64的时候需要注意,避免将Cloudera-manager-agent服务卸载。

2.启动MySQL服务并添加mysqld到自启动

[ec2-user@ip-172-31-21-45 log]$ sudo service mysqld start[ec2-user@ip-172-31-21-45 log]$ sudo systemctl enable mysqld

3.MySQL的初始密码

MsSQL5.7.12版本安装完成后,已默认设置了初始密码,需要在/var/log/mysqld.log日志文件中查找初始密码。

4.执行mysql_secure_installation脚本初始化MySQL

[ec2-user@ip-172-31-21-45 ~]$ mysql_secure_installation Securing the MySQL server deployment.Enter password for user root: The existing password for the user account root has expired. Please set a new password.New password: Re-enter new password: The 'validate_password' plugin is installed on the server.The subsequent steps will run with the existing configurationof the plugin.Using existing password for root.Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : yNew password: Re-enter new password: Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : yBy default, a MySQL installation has an anonymous user,allowing anyone to log into MySQL without having to havea user account created for them. This is intended only fortesting, and to make the installation go a bit smoother.You should remove them before moving into a productionenvironment.Remove anonymous users? (Press y|Y for Yes, any other key for No) : ySuccess.Normally, root should only be allowed to connect from'localhost'. This ensures that someone cannot guess atthe root password from the network.Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n ... skipping.By default, MySQL comes with a database named 'test' thatanyone can access. This is also intended only for testing,and should be removed before moving into a productionenvironment.Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database...Success. - Removing privileges on test database...Success.Reloading the privilege tables will ensure that all changesmade so far will take effect immediately.Reload privilege tables now? (Press y|Y for Yes, any other key for No) : ySuccess.All done! [ec2-user@ip-172-31-21-45 ~]$ 

5.验证MySQL登录

[ec2-user@ip-172-31-21-45 ~]$ mysql -uroot -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 4Server version: 5.7.12 MySQL Community Server (GPL)…Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> 

4.验证建表SQL

1.创建测试库

[ec2-user@ip-172-31-21-45 ~]$ mysql -uroot -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 5Server version: 5.7.12 MySQL Community Server (GPL)…Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> create database test;Query OK, 1 row affected (0.00 sec)mysql>

2.导入sql

[ec2-user@ip-172-31-21-45 ~]$ mysql -uroot -p test < graph_api_test.sql Enter password: [ec2-user@ip-172-31-21-45 ~]$ 

3.验证表是否创建成功

5.总结

cloudera-manager-agent服务依赖mariadb-libs.x86_64或mysql-libs.x86_64包,如果在卸载mariadb-libs.x86_64或mysql-libs.x86_64包时将相应的依赖包卸载,这样cloudera-manager-agent服务被卸载,就会导致安装节点的Agent服务异常。

在RedHat7操作系统安装的过程中mariadb-libs.x86_64会被mysql-community-libs-compat和mysql-community-libs替换。那么在RedHat6操作系统安装MySQL新版本的时候如何解决依赖包冲突问题及确保Agent服务正常会在后续的文章做详细说明。

醉酒鞭名马,少年多浮夸! 岭南浣溪沙,呕吐酒肆下!挚友不肯放,数据玩的花!

温馨提示:要看高清无码套图,请使用手机打开并单击图片放大查看。

您可能还想看

安装

CENTOS6.5安装CDH5.12.1(一)

CENTOS6.5安装CDH5.12.1(二)

CENTOS7.2安装CDH5.10和Kudu1.2(一)

CENTOS7.2安装CDH5.10和Kudu1.2(二)

如何在CDH中安装Kudu&Spark2&Kafka

如何升级Cloudera Manager和CDH

如何卸载CDH(附一键卸载github源码)

如何迁移Cloudera Manager节点

如何在Windows Server2008搭建DNS服务并配置泛域名解析

安全

如何在CDH集群启用Kerberos

如何在Hue中使用Sentry

如何在CDH启用Kerberos的情况下安装及使用Sentry(一)

如何在CDH启用Kerberos的情况下安装及使用Sentry(二)

如何在CDH未启用认证的情况下安装及使用Sentry

如何使用Sentry管理Hive外部表权限

如何使用Sentry管理Hive外部表(补充)

如何在Kerberos与非Kerberos的CDH集群BDR不可用时复制数据

Windows Kerberos客户端配置并访问CDH

数据科学

如何在CDSW中使用R绘制直方图

如何使用Python Impyla客户端连接Hive和Impala

如何在CDH集群安装Anaconda&搭建Python私有源

如何使用CDSW在CDH中分布式运行所有R代码

如何使用CDSW在CDH集群通过sparklyr提交R的Spark作业

如何使用R连接Hive与Impala

如何在Redhat中安装R的包及搭建R的私有源

如何在Redhat中配置R环境

什么是sparklyr

其他

CDH网络要求(Lenovo参考架构)

大数据售前的中年危机

如何实现CDH元数据库MySQL的主备

如何在CDH中使用HPLSQL实现存储过程

如何在Hive&Impala中使用UDF

Hive多分隔符支持示例

推荐关注Hadoop实操,第一时间,分享更多Hadoop干货,欢迎转发和分享。

原创文章,欢迎转载,转载请注明:转载自微信公众号Hadoop实操

标签: #mysql1304