영화 평점 데이터 → 사람별로 나눔
실제로는 한줄로 되어있으니 이걸 UserID
로 묶는 코드를 파이썬으로 작성할 예정
port fowarding → 8000 되어있슴
ambari에서 Hbase시작
무슨 이유에서인지 RegionServer는 하나도 없고….. 이따 다시 도전해본다
hbase hbck -repair
root 비밀번호 까먹음
sudo -s # 이거하면 root권한 생김 passwd 입력하면 비밀번호 설정 가능
/usr/hdp/current/hbase-master/bin/hbase-daemon.sh start rest -p 8000 -infoport 8001
from starbase import Connection
c = Connection('127.0.0.1', '8000')
ratings = c.table('ratings')
if ratings.exists():
print('dropping existing ratings table')
ratings.drop()
ratings.create('rating')
ratingFile = open(PATH_TO_u.data, 'r')
batch = ratings.batch()
for line in ratingsFile:
(userID, movieID, rating, timestamp) = line.split()
batch.update(userID, {'rating': {movieID: rating}})
batch.commit(finalize=True)
/usr/hdp/current/hbase-master/bin/hbase-daemon.sh stop rest