메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다. 문의사항은 gooper@gooper.com로 메일을 보내주세요.




MySQL 다운로드]
 
1)  사이트 방문하여 소스 다운로드 하기
- 각 OS 버전에 맞게 설치파일을 다운로드를 받을 수 있다.
 
http://dev.mysql.com/downloads/mysql/
(주의) 컴파일용으로 다운받기 위해서는 Platform을 "Source Code"를 선택하고 Compressed TAR Archive 를 다운받는다.)
 
2) wget으로 소스 다운로드 하기
# wget http://downloads.mysql.com/archives/mysql-5.0/mysql-5.0.85.tar.gz
 
[MySQL 리눅스에 간단 설치하기]
 
1) usr/local/src          <-- 여기에 다운로드
2) /usr/local/src 에 압축품 (# tar zxvf mysql-5.0.85.tar.gz )
3) mysql-5.0.85 폴더 생성됨 ( /usr/local/mysql-5.0.85 )
4) ./configure --prefix=/usr/local/mysql
--localstatedir=/usr/local/mysql/data
--with-charset=utf8
--with-innodb
--with-mysqld-user=mysql
--without-debug
--enable-large-files
--with-unix-socket-path=/var/lib/mysql/mysql.sock
--with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static
--without-debug
--without-docs
5) make
6) make install
또는 5) 6) make && make install 같음.
이것으로 설치는 완료 됨.
---------------------------
 
[mysql DBA 생성 및 mysql 설정]
- mysql동작을 root가 아닌 mysql유저가 하도록 하는 것이다. 보안상의 문제
 
1. dba 그룹추가 및 mysql 사용자 추가.
# groupadd dba
# useradd -M -o -r -d /usr/local/mysql -s /sbin/nologin -c "Mysql Server" -u 27 -g dba mysql >/dev/null 2>&1 || :
 
2. 설치된 폴더에 대해 권한을 부여
# chown -R root:dba /usr/local/mysql
# chown -R mysql:dba -R /var/lib/mysql
 
3. 초기 데이터를 생성.
# /usr/local/mysql/bin/mysql_install_db
 
4. data 저장 디렉토리 권한부여
# chown -R mysql:dba /usr/local/mysql/data/mysql
 
5. mysql 권한설정
chown -R mysql.mysql /usr/local/mysql
 
6. mysql 실행.
# /usr/local/mysql/bin/mysqld_safe &

 
7. root 권한 설정
# /usr/local/mysql/bin/mysqladmin -u root password 'new-password'
 
8. 라이브러리에 등록(root 권한으로).
# echo /usr/local/mysql/lib/mysql >> /etc/ld.so.conf && ldconfig
 
9. mysqld 자동 시작을 위해 다음과 같이 스크립트를 복사 및 컨피그 설정.
# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
# chkconfig --add mysqld
# chkconfig --level 35 mysqld on (런레벨 35일때 자동 실행 된다)
 
10  support-files폴더에 있는 my.cnf파일을 /etc/my.cnf로 복사.
# cp /usr/local/src/mysql-5.0.85/support-files/my-huge.cnf /etc/my.cnf
 
11  support-files폴더에 있는 my.cnf파일을 /etc/my.cnf로 복사.
 
12. my.cnf 편집
- 아래와 같이 /etc/my.cnf 파일을 수정한다.
#cat /etc/my.cnf
...
[client]
#password       = your_password
port            = 3306
socket          = /var/lib/mysql/mysql.sock
default-character-set = euckr
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
default-character-set = euckr  # <--여기부터 3라인 추가 또는 수정
language = korean
old_passwords=1
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
...
 

13. mysql 재시작 시

# service mysqld start|stop|restart
또는
/etc/rc.d/init.d/mysqld start
------------------------
 
[기타]
[] mysql path 설정
# vi ~/.bash_profile
PATH=$PATH:/usr/local/mysql/bin 추가
# source ~/.bash_profile

 

가.

/var/lib/mysql 혹은 /usr/local/mysql에 접근할 수 없다는 메세지가 나오면

mkdir mysql한후 sudo mv mysql /var/lib/ 혹은 /usr/local/하여 디렉토리를 만들어주면 현재 계정으로 만들수 있음

 

나. /usr/local/mysql/bin/mysqld_safe &를 수행후 $mysql -u root -p로 들어가서

   create user gooper;을 실행하여 사용자를 만들고 create database hadoop;을 수행하여 hadoop용 database를 생성한다.

  이어서

  grant all privileges on hadoop.* to gooper@'localhost' identified by 'gooper';를 수행하여 gooper계정에게 hadoop데이타베이스의

  권한을 부여한다.

 

다. root의 패스워드 변경

 $mysql  -u root로 들어가서

 mysql>SET PASSWORD FOR root@localhost=PASSWORD('rubberchicken');로 패스워드를 변경함

  (패스워드 변경후에는 $mysql -u root -p로 접근하여 패스워드를 입력해야 접근가능함)

번호 제목 글쓴이 날짜 조회 수
61 small file 한개 파일로 만들기(text file 혹은 parquet file의 테이블) gooper 2022.07.04 76
60 [Cloudera 6.3.4, Kudu]]Service Monitor에서 사용하는 metric중에 일부를 blacklist로 설정하여 모니터링 정보 수집 제외하는 방법 gooper 2022.07.08 31
59 [Kudu]Schema별 혹은 테이블별 사용량(Replica포함) 구하는 방법 gooper 2022.07.14 121
58 [CDP7.1.7]Impala Query의 Memory Spilled 양은 ScratchFileUsedBytes값을 누적해서 구할 수 있다. gooper 2022.07.29 29
57 [kerberos]Kerberos HA구성 참고 페이지 gooper 2022.08.31 15
56 Oracle 12c DB의 LOB타입 컬럼이 있는 테이블을 import할 때 주의 할 사항 gooper 2022.09.14 179
55 [Kerberos인증] /var/log/krb5kdc.log파일 기준으로 인증요청(AS), 티켓확인(TGS)이 진행되는 로그 기록 gooper 2022.09.21 36
54 [impala]쿼리 수행중 발생하는 오류(due to memory pressure: the memory usage of this transaction, Failed to write to server) gooper 2022.10.05 67
53 kerberos연동된 CDH 6.3.4에서 default realm값이 잘못된 상태에서 서비스 기동시 오류 gooper 2022.10.14 36
52 kudu의 내부 table명 변경하는 방법 gooper 2022.11.10 22
51 [oozie]oozie ssh action으로 패스워드 없이 다른 서버에 ssh로그인 하여 shellscript호출하는 설정하는 방법 gooper 2022.11.10 29
50 [Impala 3.2버젼]compute incremental stats db명.테이블명 수행시 ERROR: AnalysisException: Incremental stats size estimate exceeds 2000.00MB. 오류 발생원인및 조치방안 gooper 2022.11.30 697
49 [HA구성 이슈]oozie 2대를 L4로 HA구성했을때 발생하는 이슈 gooper 2023.01.17 17
48 [Kerberos]병렬 kinit 호출시 cache파일이 손상되어 Bad format in credentials cache 혹은 No credentials cache found 혹은 Internal credentials cache error 오류 발생시 gooper 2023.01.20 32
47 [Impala TLS/SSL이슈]RangerAdminRESTClient.java:151] Failed to get response, Error is: TrustManager is not specified gooper 2023.02.02 106
46 [ftgo_application]Unable to infer base url오류 발생시 조치방법 gooper 2023.02.20 1364
45 ./gradlew :composeDown 및 ./gradlew :composeUp 를 성공했을때의 메세지 gooper 2023.02.20 6
44 호출 url현황 gooper 2023.02.21 6
43 [Hive canary]Hive에 Metastore canary red alert및 hive log파일에 Duplicate entry '123456' for key 'NOTIFICATION_LOG_EVENT_ID'가 발생시 조치사항 gooper 2023.03.10 67
42 hive의 메타정보 테이블을 MariaDB로 사용하는 경우 table comment나 column comment에 한글 입력시 깨지는 경우 utf8로 바꾸는 방법. gooper 2023.03.10 93

A personal place to organize information learned during the development of such Hadoop, Hive, Hbase, Semantic IoT, etc.
We are open to the required minutes. Please send inquiries to gooper@gooper.com.

위로