Linux学习-基于CentOS7的MariaDB数据库的安装
一、实验环境:
系统:CentOS7.6,关闭了防火墙与SELINUX
数据库版本:mariadb-10.2.25(二进制安装与源码安装)
二、安装方法:
1、yum源安装
(1) 配置yum源,官方yum源下载太慢,用国内的镜像源吧
[root@centos7 ~]# cat /etc/yum.repos.d/mariadb.repo
# MariaDB 10.2 CentOS repository list - created -- : UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = https://mirrors.tuna.tsinghua.edu.cn/mariadb/yum/10.2/centos7-amd64/
gpgcheck=
(2) 开始安装
[root@centos7 ~]# yum install -y MariaDB-server MariaDB-client
(3) 启动服务
[root@centos7 ~]# systemctl start mariadb
[root@centos7 ~]# ss -nlt
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN *: *:*
LISTEN *: *:*
LISTEN 192.168.122.1: *:*
LISTEN *: *:*
LISTEN 127.0.0.1: *:*
LISTEN 127.0.0.1: *:*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*
[root@centos7 ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 10.2.-MariaDB MariaDB Server Copyright (c) , , Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
(4) 设置mysql密码,可以用/usr/bin/mysqladmin -u root password 'new-password' 设置,或使用安全脚本设置,以下为用脚本设置
[root@centos7 ~]# /usr/bin/mysql_secure_installation
#使用脚本交互式设置
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here. Enter current password for root (enter for none):
OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation. Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success! By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment. Remove anonymous users? [Y/n] y
... Success! Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y
... Success! By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment. Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success! Reloading the privilege tables will ensure that all changes made so far
will take effect immediately. Reload privilege tables now? [Y/n] y
... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB
installation should now be secure. Thanks for using MariaDB!
2、源码安装
(1) 先下载文件到服务器
[root@centos7 ~]# ll mariadb-10.2..tar.gz
-rw-r--r-- root root Nov : mariadb-10.2..tar.gz
(2) 安装相应的包
[root@centos7 ~]# yum install -y bison bison-devel zlib-devel libcurl-devel libarchive-devel boost-devel gcc gcc-c++ cmake ncurses-devel gnutls-devel libxml2-devel openssl-devel libevent-devel libaio-devel
(3) 新建mysql用户和数据目录
[root@centos7 ~]# useradd -r -s /sbin/nologin -d /data/mysql mysql
[root@centos7 ~]# mkdir /data/mysql
[root@centos7 ~]# chown mysql:mysql /data/mysql
[root@centos7 ~]# tar -zxvf mariadb-10.2..tar.gz
(4) cmake编译安装
[root@centos7 ~]# cd mariadb-10.2./
[root@centos7 mariadb-10.2.]# cmake . \
> -DCMAKE_INSTALL_PREFIX=/app/mysql \
> -DMYSQL_DATADIR=/data/mysql/ \
> -DSYSCONFDIR=/etc/ \
> -DMYSQL_USER=mysql \
> -DWITH_INNOBASE_STORAGE_ENGINE= \
> -DWITH_ARCHIVE_STORAGE_ENGINE= \
> -DWITH_BLACKHOLE_STORAGE_ENGINE= \
> -DWITH_PARTITION_STORAGE_ENGINE= \
> -DWITHOUT_MROONGA_STORAGE_ENGINE= \
> -DWITH_DEBUG= \
> -DWITH_READLINE= \
> -DWITH_SSL=system \
> -DWITH_ZLIB=system \
> -DWITH_LIBWRAP= \
> -DENABLED_LOCAL_INFILE= \
> -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock \
> -DDEFAULT_CHARSET=utf8 \
> -DDEFAULT_COLLATION=utf8_general_ci
[root@centos7 mariadb-10.2.]# make && make install
#提示:如果出错,执行rm -f CMakeCache.txt
#如果出错信息中有CXX等错误信息,可能是需要安装libdb-cxx-devel这个包,可以安装后 yum -install -y libdb-cxx-devel 再试一次
cmake . \
-DCMAKE_INSTALL_PREFIX=/app/mysql \
-DMYSQL_DATADIR=/data/mysql/ \
-DSYSCONFDIR=/etc/ \
-DMYSQL_USER=mysql \
-DWITH_INNOBASE_STORAGE_ENGINE= \
-DWITH_ARCHIVE_STORAGE_ENGINE= \
-DWITH_BLACKHOLE_STORAGE_ENGINE= \
-DWITH_PARTITION_STORAGE_ENGINE= \
-DWITHOUT_MROONGA_STORAGE_ENGINE= \
-DWITH_DEBUG= \
-DWITH_READLINE= \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DWITH_LIBWRAP= \
-DENABLED_LOCAL_INFILE= \
-DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
编译代码
(5) 安装完成后,配置环境变量
[root@centos7 mariadb-10.2.]# echo 'PATH=/app/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
[root@centos7 mariadb-10.2.]# . /etc/profile.d/mysql.sh
[root@centos7 mariadb-10.2.]# echo $PATH
/app/mysql/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
(6) 初始化数据库,生成数据库文件
[root@centos7 bin]# cd /app/mysql/
[root@centos7 mysql]# scripts/mysql_install_db --datadir=/data/mysql --user=mysql
Installing MariaDB/MySQL system tables in '/data/mysql' ...
OK To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands: './bin/mysqladmin' -u root password 'new-password'
'./bin/mysqladmin' -u root -h centos7.localdomain password 'new-password' Alternatively you can run:
'./bin/mysql_secure_installation' which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers. See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions. You can start the MariaDB daemon with:
cd '.' ; ./bin/mysqld_safe --datadir='/data/mysql' You can test the MariaDB daemon with mysql-test-run.pl
cd './mysql-test' ; perl mysql-test-run.pl Please report any problems at http://mariadb.org/jira The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
(7) 准备配置文件与启动脚本
[root@centos7 mysql]# cp /app/mysql/support-files/my-huge.cnf /etc/my.cnf
[root@centos7 mysql]# cp /app/mysql/support-files/mysql.server /etc/init.d/mysqld
(8) 启动服务
[root@centos7 mysql]# chkconfig --add mysqld
[root@centos7 mysql]# service mysqld start
[root@centos7 mysql]# ss -ntlp|grep
LISTEN ::: :::* users:(("mysqld",pid=,fd=))
3、二进制程序包安装
(1) 先下载二进制程序包到服务器
[root@centos7 ~]# ll mariadb-10.2.-linux-x86_64.tar.gz
-rw-r--r-- root root Nov : mariadb-10.2.-linux-x86_64.tar.gz
(2) 新建mysql用户与数据目录
[root@centos7 ~]# useradd -r -s /sbin/nologin -d /data/mysql mysql
[root@centos7 ~]# mkdir /data/mysql
[root@centos7 ~]# chown mysql:mysql /data/mysql/
(3) 准备二进制程序
[root@centos7 ~]# tar -zxvf mariadb-10.2.-linux-x86_64.tar.gz -C /usr/local
[root@centos7 ~]# cd /usr/local/
[root@centos7 local]# ln -sv mariadb-10.2.-linux-x86_64 mysql
‘mysql’ -> ‘mariadb-10.2.-linux-x86_64’
[root@centos7 local]# chown -R root:mysql /usr/local/mysql
(4) 准备配置文件
[root@centos7 mysql]# mkdir /etc/mysql
[root@centos7 mysql]# cp support-files/my-large.cnf /etc/mysql/my.cnf
[root@centos7 mysql]# vim /etc/mysql/my.cnf
#在[mysqld]中添加下面三个选项:
datadir = /data/mysql
innodb_file_per_table = on
skip_name_resolve = on #禁止主机名解析,建议使用
(5) 初始化数据库,生成数据库文件
[root@centos7 ~]# cd /usr/local/mysql
[root@centos7 mysql]# ./scripts/mysql_install_db --datadir=/data/mysql --user=mysql
Installing MariaDB/MySQL system tables in '/data/mysql' ...
-- :: [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
-- :: [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: : Table 'mysql.gtid_slave_pos' doesn't exist
OK To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands: './bin/mysqladmin' -u root password 'new-password'
'./bin/mysqladmin' -u root -h centos7.localdomain password 'new-password' Alternatively you can run:
'./bin/mysql_secure_installation' which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers. See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions. You can start the MariaDB daemon with:
cd '.' ; ./bin/mysqld_safe --datadir='/data/mysql' You can test the MariaDB daemon with mysql-test-run.pl
cd './mysql-test' ; perl mysql-test-run.pl Please report any problems at http://mariadb.org/jira The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
(6) 准备服务脚本,并启动服务
[root@centos7 mysql]# cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
[root@centos7 mysql]# chkconfig --add mysqld
[root@centos7 mysql]# service mysqld start
Starting mysqld (via systemctl): [ OK ]
(7) 配置PATH变量
[root@centos7 mysql]# echo 'PATH=/usr/local/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
[root@centos7 mysql]# . /etc/profile.d/mysql.sh
[root@centos7 mysql]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 10.2.-MariaDB-log MariaDB Server Copyright (c) , , Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
(8) 安装后数据库是没有密码的,可以使用安全初始化脚本修改密码
[root@centos7 mysql]# /usr/local/mysql/bin/mysql_secure_installation
#或用以下命令,前提是PATH变量已配好
[root@centos7 mysql]# mysql_secure_installation
三、多实例的配置
以二进制程序包进行配置
(1) 先下载二进制程序包到服务器
[root@centos7 ~]# ll mariadb-10.2.-linux-x86_64.tar.gz
-rw-r--r-- root root Nov : mariadb-10.2.-linux-x86_64.tar.gz
(2) 新建mysql用户与数据目录
[root@centos7 ~]# useradd -r -s /sbin/nologin -d /data/mysql mysql
[root@centos7 ~]# mkdir -pv /mysql/{,,}/{etc,data,bin,log,socket,pid}
[root@centos7 ~]# tree /mysql
/mysql
├──
│ ├── bin
│ ├── data
│ ├── etc
│ ├── log
│ ├── pid
│ └── socket
├──
│ ├── bin
│ ├── data
│ ├── etc
│ ├── log
│ ├── pid
│ └── socket
└──
├── bin
├── data
├── etc
├── log
├── pid
└── socket directories, files
[root@centos7 ~]# chown -R mysql:mysql /mysql
(3) 解压二进制程序包并初始化生成数据库文件到各实例目录
[root@centos7 ~]# tar -zxvf mariadb-10.2.-linux-x86_64.tar.gz -C /usr/local
[root@centos7 ~]# cd /usr/local/
[root@centos7 local]# ln -sv mariadb-10.2.-linux-x86_64 mysql
[root@centos7 local]# chown -R root:mysql /usr/local/mysql/
[root@centos7 mysql]# cd /usr/local/mysql/
[root@centos7 mysql]# ./scripts/mysql_install_db --datadir=/mysql//data/ --user=mysql
[root@centos7 mysql]# ./scripts/mysql_install_db --datadir=/mysql//data/ --user=mysql
[root@centos7 mysql]# ./scripts/mysql_install_db --datadir=/mysql//data/ --user=mysql
(4) 准备各实例的配置文件
[root@centos7 mysql]# pwd
/usr/local/mysql
[root@centos7 mysql]# cp support-files/my-huge.cnf /mysql//etc/my.cnf
[root@centos7 mysql]# vim /mysql//etc/my.cnf
[root@centos7 mysql]# grep -vE '#|^$' /mysql//etc/my.cnf
[client]
port = #修改点
socket = /mysql//socket/mysql.sock
[mysqld]
port = #修改点
datadir =/mysql//data #修改点 没有则添加
socket = /mysql//socket/mysql.sock #修改点
skip-external-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache =
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size =
query_cache_size = 32M
thread_concurrency =
log-bin=mysql-bin
server-id = #修改点
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe] #修改点 没有则添加
log-error = /mysql//log/mariadb.log #修改点 没有则添加
pid-file = /mysql//pid/mariadb.pid #修改点 没有则添加
[root@centos7 mysql]# cp /mysql//etc/my.cnf /mysql//etc/
[root@centos7 mysql]# cp /mysql//etc/my.cnf /mysql//etc/
[root@centos7 mysql]# sed -i 's/3306/3307/g' /mysql//etc/my.cnf
[root@centos7 mysql]# sed -i 's/3306/3308/g' /mysql//etc/my.cnf
[root@centos7 mysql]# sed -ir 's/^server-id.*/server-id = 2/' /mysql//etc/my.cnf
[root@centos7 mysql]# sed -ir 's/^server-id.*/server-id = 3/' /mysql//etc/my.cnf
(5) 准备启动服务脚本
[root@centos7 mysql]# cd /mysql//bin/
[root@centos7 bin]# vim mysqld
[root@centos7 bin]# cat mysqld
#!/bin/bash port= #端口号记得要改
mysql_user="root" #数据库用户名
mysql_pwd="" #数据库密码,因初始化时是没有密码的,此外先为空,后续记得改
cmd_path="/usr/local/mysql/bin" #命令路径
mysql_basedir="/mysql"
mysql_sock="${mysql_basedir}/${port}/socket/mysql.sock" function_start_mysql()
{
if [ ! -e "$mysql_sock" ];then
printf "Starting MySQL...\n"
${cmd_path}/mysqld_safe --defaults-file=${mysql_basedir}/${port}/etc/my.cnf &> /dev/null &
else
printf "MySQL is running...\n"
exit
fi
} function_stop_mysql()
{
if [ ! -e "$mysql_sock" ];then
printf "MySQL is stopped...\n"
exit
else
printf "Stoping MySQL...\n"
${cmd_path}/mysqladmin -u ${mysql_user} -p${mysql_pwd} -S ${mysql_sock} shutdown
fi
} function_restart_mysql()
{
printf "Restarting MySQL...\n"
function_stop_mysql
sleep
function_start_mysql
} case $ in
start)
function_start_mysql
;;
stop)
function_stop_mysql
;;
restart)
function_restart_mysql
;;
*)
printf "Usage: ${mysql_basedir}/${port}/bin/mysqld {start|stop|restart}\n"
esac [root@centos7 bin]# cp mysqld /mysql//bin/
[root@centos7 bin]# cp mysqld /mysql//bin/
[root@centos7 bin]# sed -i 's/3306/3307/g' /mysql//bin/mysqld
[root@centos7 bin]# sed -i 's/3306/3308/g' /mysql//bin/mysqld
[root@centos7 bin]# chown -R mysql:mysql /mysql
[root@centos7 bin]# chmod +x /mysql/{,,}/bin/mysqld
[root@centos7 bin]# /mysql//bin/mysqld start
Starting MySQL...
[root@centos7 bin]# /mysql//bin/mysqld start
Starting MySQL...
[root@centos7 bin]# /mysql//bin/mysqld start
Starting MySQL...
[root@centos7 bin]# ss -nlt | grep *
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*
(6) 配置PATH变量,使用mysql客户端测试
[root@centos7 bin]# cd /usr/local/mysql/
[root@centos7 mysql]# echo 'PATH=/usr/local/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
[root@centos7 mysql]# . /etc/profile.d/mysql.sh
#使用不同端口socket文件连接不同的实例
[root@centos7 mysql]# mysql -S /mysql//socket/mysql.sock
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 10.2.-MariaDB-log MariaDB Server Copyright (c) , , Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> status
--------------
mysql Ver 15.1 Distrib 10.2.-MariaDB, for Linux (x86_64) using readline 5.1 Connection id:
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: MariaDB
Server version: 10.2.-MariaDB-log MariaDB Server
Protocol version:
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /mysql//socket/mysql.sock
Uptime: min sec Threads: Questions: Slow queries: Opens: Flush tables: Open tables: Queries per second avg: 0.004
--------------
(7) 关闭数据库与修改数据库登录密码
[root@centos7 mysql]# /mysql//bin/mysqld stop
#关闭数据库时,因密码为空,所以关闭时提示输入密码,直接回车即可
Stoping MySQL...
Enter password:
[root@centos7 mysql]# ss -ntl | grep * #可以看到是关闭了的
LISTEN ::: :::*
LISTEN ::: :::* #修改数据库登录密码,注意,需要启动后执行下面命令
[root@centos7 mysql]# mysqladmin -S /mysql//socket/mysql.sock password 'centos'
#以下已将密码修改为centos,记得还要改下启动脚本中的mysql_pwd的值
[root@centos7 mysql]# vim /mysql//bin/mysqld
[root@centos7 mysql]# grep '^mysql_pwd' /mysql//bin/mysqld
mysql_pwd="centos"
[root@centos7 mysql]# /mysql//bin/mysqld stop
#有密码后,关闭进不提示输密码了
Stoping MySQL...
[root@centos7 mysql]# ss -ntl | grep * #可以看到3307已经关闭了
LISTEN ::: :::*
Linux学习-基于CentOS7的MariaDB数据库的安装的更多相关文章
- Linux学习-基于CentOS7的MariaDB数据库的主从复制
一.MySQL主从复制原理 主从同步过程中主服务器有一个工作线程I/O dump thread,从服务器有两个工作线程I/O thread和SQL thread: 主服务器: dump Thread: ...
- Linux学习-基于CentOS7的LAMP环境实现多虚拟主机
一.实验环境 系统:CentOS7.6 主机:两台(一台也可以),一台实现apache+php-fpm (192.168.214.17),一台实现mysql服务器 (192.168.214.27) 软 ...
- Linux学习-基于CentOS7的ProxySQL实现读写分离
一.实验环境 主机:3台,一台ProxySQL(192.168.214.37),两台主从复制,master(192.168.214.17),slave(192.168.214.27) 系统:CentO ...
- Linux学习-基于CentOS7的MySQL5.7的GTID复制
一.GTID复制简介 GTID (global transaction id)全局事务标识符,MySQL5.6版本开始支持,GTID复制不像传统的复制方式(导步复制.半同步复制)需要找到binlog和 ...
- Linux学习之CentOS6下Mysql数据库的安装与配置
转自:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得搭建好j ...
- Linux学习之CentOS--CentOS6.下Mysql数据库的安装与配置
跟着配置,顺利配置完成 http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html
- Ubuntu 下 Mariadb 数据库的安装和目录迁移
Ubuntu 下 Mariadb 数据库的安装和目录迁移 1.简介 本文主要是 Ubuntu 下 Mariadb 数据库的安装和目录迁移,同样适用于 Debian 系统:Ubuntu 20.0.4 M ...
- 基于Linux系统的MariaDB数据库的安装配置
数据库是指长期存储在计算机内.有组织的和可共享的数据集合.表是数据库存储数据的基本单位,一个表由若干个字段组成 MariaDB 数据库管理系统是 MySQL 的一个分支,主要由开源社区在维护,采用 G ...
- Docker(Linux)学习笔记以及Redis/MariaDB的容器使用后台全自动启动
1:Docker安装,由于Docker后续pull镜像的服务器默认是在国外的,速度实在是太慢,这里使用阿里云的镜像 阿里云的Docker CE 镜像源站进行安装 docker ===========U ...
随机推荐
- Python selenium 三种等待方式详解(必会)
很多人在群里问,这个下拉框定位不到.那个弹出框定位不到…各种定位不到,其实大多数情况下就是两种问题:1 有frame,2 没有加等待.殊不知,你的代码运行速度是什么量级的,而浏览器加载渲染速度又是什么 ...
- 阶段1 语言基础+高级_1-3-Java语言高级_08-JDK8新特性_第2节 Stream流式思想概述_3_流式思想概述
- value_counts()函数
value_counts函数用于统计dataframe或series中不同数或字符串出现的次数 ascending=True时,按升序排列. normalize=True时,可计算出不同字符出现的频率 ...
- MySQL Cluster 与 MongoDB 复制群集分片设计及原理
分布式数据库计算涉及到分布式事务.数据分布.数据收敛计算等等要求 分布式数据库能实现高安全.高性能.高可用等特征,当然也带来了高成本(固定成本及运营成本),我们通过MongoDB及MySQL Clus ...
- windows和linux中查看端口占用情况并kill掉对应进程
好几次在不同的情况下遇到 需要查看端口信息 并且kill掉对应进程的情况 相关的参数总是记不全 在这里记录下 以后查看方便 windows中查看正在使用端口的信息netstat -ano|findst ...
- Java日志使用slf4j 配置log4j后,有日志文件 但日志文件内容为空
SLF4J的全称是Simple Logging Facade for Java,即简单日志门面. SLF4J并不是具体的日志框架,而是作为一个简单门面服务于各类日志框架,如java.util.logg ...
- 实列+JVM讲解类的实列化顺序
刨根问底---类的实列化顺序 开篇三问 1什么是类的加载,类的加载和类的实列有什么关系,什么时候类加载 2类加载会调用构造函数吗,什么时候调用构造函数 3什么是实列化对象,实列化的对象有什么东西. 我 ...
- mysql 多表查询 以及 concat 、concat_ws和 group_concat
left join(左联接) 返回包括左表中的所有记录和右表中联结字段相等的记录right join(右联接) 返回包括右表中的所有记录和左表中联结字段相等的记录inner join(等值连接) 只返 ...
- python为什么人们喜欢学习呢?
软件的质和量. 既有量的积累也有质的区别.继承一定的前人研究基础. 基本上来说,python更加的注重可读性,一致性,可移植性,其中软件的质量也是比较的讲究的. python支持开发的高级重用机制,例 ...
- VS2015+QT环境配置后,Lauch Qt Designer打开失败,无法打开*.ui文件
最近在VS2015上配置QT时出现了这个问题,遂百度其解决方法,解决之后记录下来.第一步: 在[解决方案资源管理器]中,右击你的 xxx.ui文件,选择[打开方式],此时列表中默认值是[ Qt des ...