新前置机安装配置
数据接入点提供前置对接服务器,其硬件配置要求:CPU六核2.0GHz,内存32G,硬盘1T存储;软件配置要求:操作系统CentOS 7 1611 Everything(完全版),安装完成后,ISO文件需要放置于/home目录下用于制作本地yum源;数据库版本为MySql 5.5.18以上,8.0以下;Java版本为JDK1.8(64位)。数据接入点要求使用商业数据库软件服务的,版权由数据接入点提供。
max_connections=5000?最大链接数
lower_case_table_names=1,表名大小写不敏感
innodb_lock_wait_timeout=1800,锁表等待时间
安装好服务器和mysql后,要求我们设置这几个参数。
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 26
Server version: 5.7.16 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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> select @@max_connections as ‘max Connections’;
+—————–+
| max Connections |
+—————–+
| 151 |
+—————–+
1 row in set (0.00 sec)
mysql> set global max_connections = 5000;
Query OK, 0 rows affected (0.00 sec)
mysql> select @@max_connections as ‘max Connections’;
+—————–+
| max Connections |
+—————–+
| 5000 |
+—————–+
1 row in set (0.00 sec)
mysql> show variables like ‘lower%’;
+————————+——-+
| Variable_name | Value |
+————————+——-+
| lower_case_file_system | OFF |
| lower_case_table_names | 0 |
+————————+——-+
2 rows in set (0.00 sec)
mysql> exit
Bye
[root@localhost ~]# vi /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
~
~
~
~
~
~
~
~
~
~
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
lower_case_table_names = 1
Entering Ex mode. Type “visual” to go to Normal mode.
:wq
“/etc/my.cnf” 28L, 983C written
[root@localhost ~]# systemctl stop mysqld.service
[root@localhost ~]# systemctl start mysqld.service
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.16 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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> show variables like ‘lower%’;
+————————+——-+
| Variable_name | Value |
+————————+——-+
| lower_case_file_system | OFF |
| lower_case_table_names | 1 |
+————————+——-+
2 rows in set (0.00 sec)
mysql> show variables like ‘innodb_lock_wait%’;
+————————–+——-+
| Variable_name | Value |
+————————–+——-+
| innodb_lock_wait_timeout | 50 |
+————————–+——-+
1 row in set (0.01 sec)
mysql> set innodb_lock_wait_timeout=1800;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like ‘innodb_lock_wait%’;
+————————–+——-+
| Variable_name | Value |
+————————–+——-+
| innodb_lock_wait_timeout | 1800 |
+————————–+——-+
1 row in set (0.00 sec)
mysql> exit
Bye
[root@localhost ~]# exit
登出