text stringlengths 0 59.1k |
|---|
```console |
kubectl exec spark-master-controller-<ID> -i -t -- bash -i |
root@spark-master-controller-c1sqd:/# . /setup_client.sh <Service IP> 7077 |
root@spark-master-controller-c1sqd:/# pyspark |
Python 2.7.9 (default, Mar 1 2015, 12:57:24) |
[GCC 4.9.2] on linux2 |
Type "help", "copyright", "credits" or "license" for more information. |
15/06/26 14:25:28 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable |
Welcome to |
____ __ |
/ __/__ ___ _____/ /__ |
_\ \/ _ \/ _ `/ __/ '_/ |
/__ / .__/\_,_/_/ /_/\_\ version 1.4.0 |
/_/ |
Using Python version 2.7.9 (default, Mar 1 2015 12:57:24) |
SparkContext available as sc, HiveContext available as sqlContext. |
>>> file = sc.textFile("/mnt/glusterfs/somefile.txt") |
>>> counts = file.flatMap(lambda line: line.split(" ")).map(lambda word: (word, 1)).reduceByKey(lambda a, b: a + b) |
>>> counts.saveAsTextFile("/mnt/glusterfs/output") |
``` |
While still in the container, you can see the output of your Spark Job in the Distributed File System by running the following: |
```console |
root@spark-master-controller-c1sqd:/# ls -l /mnt/glusterfs/output |
``` |
<|endoftext|> |
# source: k8s_examples/_archived/spark/spark-gluster/spark-master-service.yaml type: yaml |
kind: Service |
apiVersion: v1 |
metadata: |
name: spark-master |
namespace: spark-cluster |
labels: |
component: spark-master-service |
spec: |
ports: |
- port: 7077 |
targetPort: 7077 |
selector: |
component: spark-master |
<|endoftext|> |
# source: k8s_examples/_archived/meteor/meteor-service.json type: json |
{ |
"kind": "Service", |
"apiVersion": "v1", |
"metadata": { |
"name": "meteor" |
}, |
"spec": { |
"ports": [ |
{ |
"port": 80, |
"targetPort": "http-server" |
} |
], |
"selector": { |
"name": "meteor" |
}, |
"sessionAffinity": "ClientIP", |
"sessionAffinityConfig": { |
"clientIP": { |
"timeoutSeconds": 90 |
} |
}, |
"type": "LoadBalancer" |
} |
} |
<|endoftext|> |
# source: k8s_examples/_archived/meteor/mongo-service.json type: json |
{ |
"kind": "Service", |
"apiVersion": "v1", |
"metadata": { |
"name": "mongo", |
"labels": { |
"name": "mongo" |
} |
}, |
"spec": { |
"ports": [ |
{ |
"port": 27017, |
"targetPort": "mongo" |
} |
], |
"selector": { |
"name": "mongo", |
"role": "mongo" |
} |
} |
} |
<|endoftext|> |
# source: k8s_examples/_archived/meteor/mongo-pod.json type: json |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.