Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Offline installation of CDH-cdh5.8.3 and binary deployment Mysql5.7 tutorial

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Let's learn about offline installation of CDH-cdh5.8.3 and binary deployment of Mysql5.7 tutorials, I believe you will benefit a lot after reading, the text is not much, hope that offline installation of CDH-cdh5.8.3 and binary deployment of Mysql5.7 tutorials this short content is what you want.

1. Check whether the system has installed mysql. It needs to be uninstalled clean.

# rpm-qa | grep-I mysql

Mysql-server-5.1.71-1.el6.x86_64

Mysql-5.1.71-1.el6.x86_64

Mysql-devel-5.1.71-1.el6.x86_64

Qt-mysql-4.6.2-26.el6_4.x86_64

Mysql-libs-5.1.71-1.el6.x86_64

Perl-DBD-MySQL-4.013-3.el6.x86_64

# rpm-e mysql-server-5.1.71-1.el6.x86_64-- nodeps

# rpm-e mysql-5.1.71-1.el6.x86_64-- nodeps

# rpm-e mysql-devel-5.1.71-1.el6.x86_64-- nodeps

# rpm-e qt-mysql-4.6.2-26.el6_4.x86_64-- nodeps

# rpm-e mysql-libs-5.1.71-1.el6.x86_64-- nodeps

# rpm-e perl-DBD-MySQL-4.013-3.el6.x86_64-- nodeps

two。 Create mysql user groups and users, data directories and their user directories

# userdel mysql # Delete a user

# groupdel mysql # Delete user group name

# mkdir / home/mysql # create a folder mysql under the home folder

# mkdir / home/mysql/data # create a folder data under the mysql folder

# groupadd mysql # create a user group named mysql

# useradd-g mysql-d / home/mysql mysql # create users under user groups

The following warning will be issued

Useradd: warning: the home directory already exists.

Not copying any file from skel directory into it.

The processing is as follows:

# cp / etc/skel/.bash_profile / home/mysql

# cp / etc/skel/.bashrc / home/mysql

# cp / etc/skel/.bash_logout / home/mysql

3. Decompression software

# tar-xvf mysql-5.7.17-linux-glibc2.5-x86_64.tar

# cd mysql-5.7.17-linux-glibc2.5-x86_64

# mv * / home/mysql

4. Initialize the mysql database

#. / bin/mysqld-user=mysql-basedir=/home/mysql-datadir=/home/mysql/data-initialize-lc_messages_dir=/home/mysql/share-lc_messages=en_US

Note: mysql_install_db is no longer in use in version 5.7

[ERROR] Can't find error-message file'/ home/mysql/share/errmsg.sys'. Check error- message file location and 'lc-messages-dir' configuration directive.

Because no this is related to two system variables, lc_messages_dir andlc_messages, the normal default is no problem. Let's specify it explicitly here. Reinitialize

5. Check if the mysql service can be started

Just now I used / home/mysql as the installation directory basedir of mysql, and the following error occurred when starting the service:

[root@cdh2 mysql] #. / support-files/mysql.server start

. / support-files/mysql.server: line 271: cd: / usr/local/mysql: No such file or directory

Starting MySQLCouldn't find MySQL server (/ usr/local/mysql/ [failed] ld_safe)

From the above, we can see that the default installation directory for mysql's tar.gz installation package is / usr/local/mysql.

At this point, we need to modify the basedir and datadir directory paths of the / support-files/mysql.server file to the basedir and datadir paths of the mysql where our environment is located.

# vim support-files/mysql.server

-

...

Basedir=/home/mysql

Datadir=/home/mysql/data

...

-

#. / support-files/mysql.server start

Start Starting MySQL.. OK!

6. Create a soft connection

# ln-s / home/mysql/bin/mysql / usr/bin/mysql

7. Create a profile

Default generated my.cnf backup

# mv / etc/my.cnf / etc/my.cnf.bak

Enter the mysql installation directory to support the file directory

# cd / home/mysql/support-files

Copy the profile template to the new mysql profile

# cp my-default.cnf / etc/my.cnf

Set the encoding, you can modify the new configuration file options as needed, do not modify the configuration options, and mysql runs according to the default configuration parameters.

# vim / etc/my.cnf

[mysqld]

Basedir = / home/mysql

Datadir = / home/mysql/data

# key_buffer = 16m

Key_buffer_size = 32m

Max_allowed_packet = 32m

Thread_stack = 256K

Thread_cache_size = 64

Query_cache_limit = 8m

Query_cache_size = 64m

Query_cache_type = 1

Max_connections = 5505

# log_bin=/home/mysql/mysql_binary_log

Sql_mode=STRICT_TRANS_TABLES

Binlog_format = mixed

Read_buffer_size = 2m

Read_rnd_buffer_size = 16m

Sort_buffer_size = 8m

Join_buffer_size = 8m

Innodb_file_per_table = 1

Innodb_flush_log_at_trx_commit = 2

Innodb_log_buffer_size = 64m

Innodb_buffer_pool_size = 4G

Innodb_thread_concurrency = 8

Innodb_flush_method = O_DIRECT

Innodb_log_file_size = 512m

Log-error=/var/log/mysqld.log

Pid-file=/var/run/mysqld/mysqld.pid

8. Configure mysql service boot to start automatically

# mkdir / var/run/mysqld

# chown-R mysql:mysql / var/run/mysqld

Comment out log_bin and set server_id when needed

Comment out key_buffer and keep key_buffer_size

# cp / home/mysql/support-files/mysql.server / etc/init.d/mysqld # copy the startup file to / etc/init.d/ and repeat the command as mysqld

# chmod 755 / etc/init.d/mysqld # increase execution permissions

# chkconfig-- list mysqld # check that there is no mysqld in the list of startup items

# chkconfig-- add mysqld # add mysqld if not:

# chkconfig mysqld on # use this command to set boot:

9. Initialize the mysql user root password

# mysql-u root-p

Enter the previous random password

Mysql > SET PASSWORD = PASSWORD ('123456'); 123456 in # PASSWORD ()

Mysql > ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER

Mysql > flush privileges

10. Authorize all hosts to log in using root

Grant all on *. * to 'root'@'%' identified by' 123456'

11. Create a mysql database

Hive database

Create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci

-- Cluster monitoring database

Create database amon DEFAULT CHARSET utf8 COLLATE utf8_general_ci

-- hue database

Create database hue DEFAULT CHARSET utf8 COLLATE utf8_general_ci

-- oozie database

Create database oozie DEFAULT CHARSET utf8 COLLATE utf8_general_ci

-reports manager

Create database rman DEFAULT CHARSET utf8 COLLATE utf8_general_ci

After reading this article on offline installation of CDH-cdh5.8.3 and binary deployment of Mysql5.7, many readers will want to know more about it. For more industry information, you can follow our industry information section.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report