λ°μν
livy-env.sh
export SPARK_HOME=/usr/lib/spark
export HADOOP_CONF_DIR=/etc/hadoop/conf
livy start
./bin/livy-server start
livy μ μλμνλμ§ sparkμμ ν μ€νΈνλ μμ
sudo pip install requests
import json, pprint, requests, textwrap
host = 'http://localhost:8998'
data = {'kind': 'spark'}
headers = {'Content-Type': 'application/json'}
r = requests.post(host + '/sessions', data=json.dumps(data), headers=headers)
r.json() {u'state': u'starting', u'id': 0, u'kind': u'spark'}
728x90
λ°μν