Ubuntu 14.04 MySQL 安装配置 For Cloudera Manages 5

本文详细介绍如何在Ubuntu系统中安装MySQL服务器,并配置相关参数以优化性能。包括安装过程、配置文件编辑、服务管理及创建必要的数据库和用户权限设置。

MySQL 安装配置




1.1 安装MySQL

使用root用户安装 mysql,命令如下:

root@CDH-01:~# apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mysql-server is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 464 not upgraded.
root@CDH-01:~# 


1.2 停 MySQL 服务

安装MySql成功后,mysql服务会自动启动,接下来我们将要配置mysql,则需要停止mysql服务。
root@CDH-01:~# service mysql stop

1.3 配置MySQL

1,Move old InnoDB log files /var/lib/mysql/ib_logfile0 and/var/lib/mysql/ib_logfile1 out of/var/lib/mysql/ to a backup location (移除旧的日志文件到备份目录)

2,添加配置文件

root@CDH-01:~# vi /etc/mysql/conf.d/mysql_cloudera_manager.cnf

写入:
[mysqld]
transaction-isolation = READ-COMMITTED
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links = 0

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 = 550
#expire_logs_days = 10
#max_binlog_size = 100M

#log_bin should be on a disk with enough free space. Replace '/var/lib/mysql/mysql_binary_log' with an appropriate path for your system
#and chown the specified folder to the mysql user.
log_bin=/var/lib/mysql/mysql_binary_log

# For MySQL version 5.1.8 or later. Comment out binlog_format for older versions.
binlog_format = mixed

read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
join_buffer_size = 8M

# InnoDB settings
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

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

sql_mode=STRICT_ALL_TABLES


1.4 启动mysql服务

root@CDH-01:~# service mysql start


1.5 安装mysql JDBC驱动

root@CDH-01:~# apt-get install libmysql-java
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libmysql-java is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 464 not upgraded.
root@CDH-01:~# 


1.6 创建Cloudera-Manages-Server 需要用到的数据库表 for MySql。

Creating Databases for Activity Monitor, Reports Manager, Hive Metastore Server, Sentry Server, Cloudera Navigator AuditServer, and Cloudera Navigator Metadata Server


登录mysql

root@CDH-01:~# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 584
Server version: 5.5.47-0ubuntu0.14.04.1-log (Ubuntu)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

执行创建数据库脚本语句。
create database amon DEFAULT CHARACTER SET utf8;
grant all on amon.* TO 'amon'@'localhost' IDENTIFIED BY 'amon_password';
grant all on amon.* TO 'amon'@'%' IDENTIFIED BY 'amon_password';
create database smon DEFAULT CHARACTER SET utf8;
grant all on smon.* TO 'smon'@'localhost' IDENTIFIED BY 'smon_password';
grant all on smon.* TO 'smon'@'%' IDENTIFIED BY 'smon_password';
create database rman DEFAULT CHARACTER SET utf8;
grant all on rman.* TO 'rman'@'localhost' IDENTIFIED BY 'rman_password';
grant all on rman.* TO 'rman'@'%' IDENTIFIED BY 'rman_password';
create database hmon DEFAULT CHARACTER SET utf8;
grant all on hmon.* TO 'hmon'@'localhost' IDENTIFIED BY 'hmon_password';
grant all on hmon.* TO 'hmon'@'%' IDENTIFIED BY 'hmon_password';
create database hive DEFAULT CHARACTER SET utf8;
grant all on hive.* TO 'hive'@'localhost' IDENTIFIED BY 'hive_password';
grant all on hive.* TO 'hive'@'%' IDENTIFIED BY 'hive_password';
create database oozie;
grant all privileges on oozie.* to 'oozie'@'localhost' identified by 'oozie';
grant all privileges on oozie.* to 'oozie'@'%' identified by 'oozie';

至此 MySql安装配置完毕。




【2024亚太杯ABCD题】亚太地区大学生数学建模竞赛(思路、代码、论文持续更新中.......)内容概要:本文档为2024及2025年亚太地区大学生数学建模竞赛(APMCM)的备赛资源汇总,涵盖A、B、C、D四道赛题的思路解析、MATLAB/Python代码实现及论文写作指导,内容持续更新。资源涉及多个技术方向,包括无人机回收系统动力学建模(高斯原理)、非线性模型预测控制(MPC)、储能系统经济性优化、可重构电池故障诊断、电力系统机组组合的量子优化、裂纹检测、卡尔曼滤波目标跟踪、路径规划(UGV/UAV协同)、MIMO通信系统、天线物理边界计算等。同时提供大量科研技术支持,覆盖机器学习与深度学习(如LSTM、CNN、Transformer等在负荷、光伏、风电预测中的应用)、图像处理、信号处理、雷达追踪、电力系统优化、车间调度、元胞自动机模拟等多个领域,并附有智能优化算法(如粒子群、遗传算法、新型群智算法)在各类工程问题中的实现案例。; 适合人群:具备一定数学建模基础、熟练掌握MATLAB或Python编程的高校本科生、研究生,尤其是准备参加亚太杯、全国大学生数学建模竞赛或其他科研项目的参赛者与科研人员。; 使用场景及目标:①为亚太杯数学建模竞赛提供完整的解题思路、代码支持与论文参考,帮助快速构建高质量解决方案;②作为科研项目的技术参考资料,
内容概要:本文档为“澎湃创想”人像摄影工作室的启动与运营体系搭建项目管理计划书,旨在赣州市章贡区创建一家定位高端、个性化艺术人像摄影的工作室。项目采用预测型生命周期,通过WBS分解为场地建设、设备采购、团队组建、系统搭建和正式开业五大工作包,明确范围、进度与成本三大基线。项目总工期控制在D+45天内,成本基线为28万元,关键路径为场地装潢(31.6天)。通过S曲线、EVM等工具进行成本与进度控制,并设定年销售额35万元的盈亏平衡点。项目重点管理质量、风险与干系人,采用RACI矩阵明确6人核心团队职责,识别十大风险并制定应对策略,尤其关注市场竞争与人才流失问题。; 适合人群:具备项目管理基础知识,从事创业项目策划、小型文化创意企业运营或项目执行的相关人员,尤其是摄影、艺术类初创企业负责人及项目管理者。; 使用场景及目标:①用于指导人像摄影工作室从零到一的系统化筹建与运营管理;②学习如何运用WBS、PDM、EVM、风险矩阵等PMI工具进行实际项目规划与控制;③掌握初创企业在资源有限条件下如何进行成本控制、进度管理和风险应对。; 阅读建议:此计划书结构完整,涵盖十大知识领域,建议结合项目管理知识体系(如PMBOK)进行对照学习,重点关注其基线制定、风险应对策略与干系人管理方法,并可在实际创业项目中参考其执行与监控机制。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值