Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 3195f28

Browse files
committed
Updated my.cnf
1 parent 06ae5e9 commit 3195f28

File tree

2 files changed

+51
-30
lines changed

2 files changed

+51
-30
lines changed

scripts/cms_mysql.sh

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -202,35 +202,8 @@ wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
202202
rpm -ivh mysql-community-release-el7-5.noarch.rpm
203203
yum install mysql-server -y
204204
log "->Tuning"
205-
echo -e "transaction_isolation = READ-COMMITTED\n\
206-
read_buffer_size = 2M\n\
207-
read_rnd_buffer_size = 16M\n\
208-
sort_buffer_size = 8M\n\
209-
join_buffer_size = 8M\n\
210-
thread_stack = 256K\n\
211-
thread_cache_size = 64\n\
212-
max_connections = 700\n\
213-
key_buffer_size = 32M\n\
214-
max_allowed_packet = 32M\n\
215-
log_bin=/var/lib/mysql/mysql_binary_log\n\
216-
server_id=1\n\
217-
binlog_format = mixed\n\
218-
\n\
219-
# InnoDB Settings\n\
220-
innodb_file_per_table = 1\n\
221-
innodb_flush_log_at_trx_commit = 2\n\
222-
innodb_log_buffer_size = 64M\n\
223-
innodb_thread_concurrency = 8\n\
224-
innodb_buffer_pool_size = 4G\n\
225-
innodb_flush_method = O_DIRECT\n\
226-
innodb_log_file_size = 512M\n\
227-
\n\
228-
[mysqld_safe]\n\
229-
log-error=/var/log/mysqld.log
230-
pid-file=/var/run/mysqld/mysqld.pid \n\
231-
\n\
232-
sql_mode=STRICT_ALL_TABLES\n\
233-
" >> /etc/my.cnf
205+
wget https://github.com/oracle-quickstart/oci-cloudera/blob/master/scripts/my.cnf
206+
mv my.cnf /etc/my.cnf
234207
log "->Start"
235208
systemctl enable mysqld
236209
systemctl start mysqld
@@ -262,7 +235,7 @@ for DATABASE in "scm" "amon" "rman" "hue" "metastore" "sentry" "nav" "navms" "oo
262235
else
263236
USER=${DATABASE}
264237
fi
265-
echo -e "CREATE DATABASE ${DATABASE};" >> /etc/mysql/cloudera.sql
238+
echo -e "CREATE DATABASE ${DATABASE} DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;" >> /etc/mysql/cloudera.sql
266239
echo -e "CREATE USER \'${USER}\'@'%' IDENTIFIED BY \'${pw}\';" >> /etc/mysql/cloudera.sql
267240
echo -e "GRANT ALL on ${DATABASE}.* to \'${USER}\'@'%';" >> /etc/mysql/cloudera.sql
268241
echo "${USER}:${pw}" >> /etc/mysql/mysql.pw

scripts/my.cnf

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[mysqld]
2+
datadir=/var/lib/mysql
3+
socket=/var/lib/mysql/mysql.sock
4+
transaction-isolation = READ-COMMITTED
5+
# Disabling symbolic-links is recommended to prevent assorted security risks;
6+
# to do so, uncomment this line:
7+
symbolic-links = 0
8+
9+
key_buffer_size = 32M
10+
max_allowed_packet = 16M
11+
thread_stack = 256K
12+
thread_cache_size = 64
13+
14+
max_connections = 550
15+
#expire_logs_days = 10
16+
#max_binlog_size = 100M
17+
18+
#log_bin should be on a disk with enough free space.
19+
#Replace '/var/lib/mysql/mysql_binary_log' with an appropriate path for your
20+
#system and chown the specified folder to the mysql user.
21+
log_bin=/var/lib/mysql/mysql_binary_log
22+
23+
#In later versions of MySQL, if you enable the binary log and do not set
24+
#a server_id, MySQL will not start. The server_id must be unique within
25+
#the replicating group.
26+
server_id=1
27+
28+
binlog_format = mixed
29+
30+
read_buffer_size = 2M
31+
read_rnd_buffer_size = 16M
32+
sort_buffer_size = 8M
33+
join_buffer_size = 8M
34+
35+
# InnoDB settings
36+
innodb_file_per_table = 1
37+
innodb_flush_log_at_trx_commit = 2
38+
innodb_log_buffer_size = 64M
39+
innodb_buffer_pool_size = 4G
40+
innodb_thread_concurrency = 8
41+
innodb_flush_method = O_DIRECT
42+
innodb_log_file_size = 512M
43+
44+
[mysqld_safe]
45+
log-error=/var/log/mysqld.log
46+
pid-file=/var/run/mysqld/mysqld.pid
47+
48+
sql_mode=STRICT_ALL_TABLES

0 commit comments

Comments
 (0)