메뉴 건너뛰기

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로 접근하여 패스워드를 입력해야 접근가능함)

번호 제목 글쓴이 날짜 조회 수
80 [Kerberos인증] /var/log/krb5kdc.log파일 기준으로 인증요청(AS), 티켓확인(TGS)이 진행되는 로그 기록 gooper 2022.09.21 36
79 [vi] test.nq파일에서 특정문자열(예, <>)을 찾아서 포함되는 라인을 삭제한 동일한 이름의 파일을 만드는 방법 총관리자 2017.01.25 36
78 Github를 이용하는 전체 흐름 이해하기 총관리자 2016.11.18 36
77 5건의 triple data를 이용하여 특정 작업 폴더에서 작업하는 방법/절차 총관리자 2016.06.16 36
76 S2RDF모듈의 실행부분만 추출하여 별도록 실행하는 방법(draft) 총관리자 2016.06.14 36
75 kerberos연동된 CDH 6.3.4에서 default realm값이 잘못된 상태에서 서비스 기동시 오류 gooper 2022.10.14 35
74 [TLS/SSL]Kudu Tablet Server설정 총관리자 2022.05.13 35
73 Oracle NLOB type의 데이터를 import하는 경우 No Java type for SQL type 2011 for column rst와 같은 오류 발생시 조치사항 총관리자 2022.01.14 35
72 CM의 Impala->Query tab에서 FINISHED query가 보이지 않는 현상 총관리자 2021.08.31 35
71 tar를 이용한 리눅스 백업 총관리자 2018.05.13 35
70 core 'gc_shard3_replica2' is already locked라는 오류가 발생할때 조치사항 총관리자 2017.09.14 35
69 spark에서 hive table을 읽어 출력하는 예제 소스 총관리자 2017.03.09 35
68 ServerInfo객체파일 총관리자 2016.07.21 35
67 AnalysisException: Incomplatible return type 'DECIMAL(38,0)' and 'DECIMAL(38,5)' of exprs가 발생시 조치 총관리자 2021.07.26 34
66 fuseki에서 제공하는 script중 s-post를 사용하는 예문 총관리자 2017.09.15 34
65 restaurant-controller,에서 등록 예시 총관리자 2022.04.30 33
64 [Kerberos]병렬 kinit 호출시 cache파일이 손상되어 Bad format in credentials cache 혹은 No credentials cache found 혹은 Internal credentials cache error 오류 발생시 gooper 2023.01.20 32
63 Failed to write to server: (no server available): 총관리자 2022.01.17 32
62 Cloudera Hadoop and Spark Developer Certification 준비(참고) 총관리자 2018.05.16 32
61 파일은 남겨두고 파일 내용만 지우고자 할 때. 총관리자 2017.08.30 32

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.

위로