[Tutor] creating a cluster

shubham goyal skgoyal721 at gmail.com
Wed May 3 01:22:43 EDT 2017

Hello tutors,

here i am trying to create a cluster on cloud using json data but its
giving some error
can you walk me through it. thankyou

import urllib2
import requests
  "spark_version": null,
  "presto_version": null,
  "label": [
  "disallow_cluster_termination": false,
  "force_tunnel": false,
  "enable_ganglia_monitoring": false,
  "node_bootstrap_file": null,
  "tunnel_server_ip": null,
  "ec2_settings": {
    "aws_preferred_availability_zone": "Any",
    "aws_region": "us-east-1",
    "compute_validated": false,
    "vpc_id": null,
    "subnet_id": null,
    "bastion_node_public_dns": null,
    "master_elastic_ip": null,
    "instance_tenancy": null,
    "compute_secret_key": "",
    "compute_access_key": "AKIAITFMYWE7A3BG5BDQ",
    "use_account_compute_creds": true
  "hadoop_settings": {
    "use_hbase": null,
    "use_spark": false,
    "custom_config": null,
    "use_hadoop2": false,
    "use_qubole_placement_policy": true,
    "is_ha": null,
    "enable_rubix": false,
    "fairscheduler_settings": {
      "default_pool": null
  "node_configuration": {
    "master_instance_type": "m1.large",
    "slave_instance_type": "m1.xlarge",
    "initial_nodes": 1,
    "max_nodes": 1,
    "idle_cluster_timeout": null,
    "slave_request_type": "spot",
    "fallback_to_ondemand": null,
    "spot_instance_settings": {
      "maximum_bid_price_percentage": 100,
      "timeout_for_request": 10,
      "maximum_spot_instance_percentage": 50
    "cluster_name": "qa_qbol_acc5572_cl67507"
  "security_settings": {
    "encrypted_ephemerals": false
  "presto_settings": {
    "enable_presto": false,
    "custom_config": null
  "spark_settings": {
    "custom_config": null
  "errors": [
  "datadog_settings": {
    "datadog_api_token": null,
    "datadog_app_token": null
  "spark_s3_package_name": null,
  "zeppelin_s3_package_name": null,
  "engine_config": {},
  "zeppelin_interpreter_mode": null
print url
req = requests.post(url, data,headers)
#base64string = base64.encodestring('%s:%s' % (u, p)).replace('\n', '')
#req.add_header("Authorization", "Basic %s" %base64string)
for line in req:
print line


Traceback (most recent call last):
  File "createCluster.py", line 83, in <module>
    f = urllib2.urlopen(req)
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1240, in https_open
  File "/usr/lib/python2.7/urllib2.py", line 1197, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 111] Connection refused>

More information about the Tutor mailing list