장고와 하둡과 하이브

김찬울·2021년 11월 5일
0

해당 명령은 가상환경(venv)사용

python3 -m venv venv
. ./venv/bin/activate

vi lyrics.py
소스코드 복사

pip install bs4 requests lxml

namenode에서
start-dfs.sh 만 하면되고

secondnode에서는
dfs.sh뿐만 아니라
mr-jobhistory-daemon.sh start historyserver
해당 코드도 실행해야한다.

이는 간단하게

ssh node명 '명령어'
를 입력하므로 접속하지 않고 건낼 수 있다.

50070은 세부사항 위주의 하둡이고
19888은 함수들 위주로 다룬 하둡이다(맵리듀스 같은 것)

룰베이스 - 통계모델 - 신경망(버트 - gpt-3)

하둡

hive

  1. hadoop 폴더 생성
    a. hdfs dfs -mkdir -p user/hive/warehouse
    b. hdfs dfs -chmod g+w /user/hive/warehouse
    c. hdfs dfs -mkdir /tmp
    d. hdfs dfs -chmod g+w /tmp

schematool -initSchema -dbType mysql
하이브 초기화

HIVEHOME/bin:HIVE_HOME/bin:PATH"
하이브 홈 경로추가

CREATE TABLE FILE (line STRING);

LOAD DATA INPATH '/input/*' OVERWRITE INTO TABLE FILE;

LOAD DATA INPATH '/input8/*' OVERWRITE INTO TABLE FILE;

CREATE TABLE word_counts3 AS
SELECT word, count(1) AS count FROM
(SELECT explode(split(line, ' ')) AS word FROM FILE)
GROUP BY word
ORDER BY word;

select * from word_counts3 order by count;
create external table if not exists stocks (
day string,
close int,
before int,
open int,
high int,
low int,
trade int,
symbol string,
name string
)
row format delimited fields terminated by ','
location '/stock/'
select symbol, max(close) as close_max from stocks group by symbol order by max(close) desc;
profile
코린코린이

0개의 댓글