Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!
openssl genrsa -des3 -out rootCA.key 4096
package main | |
import ( | |
"io/ioutil" | |
"log" | |
"net/http" | |
"net/url" | |
"strings" | |
"crypto/rsa" |
Use your service account's key JSON file to get an access token to call Google APIs.
Good for seeing how things work, including the creation of JWT token.
To create a JWT token, you can replace create-jwt-token.sh
script with tools like step.
If you just want to get an access token for a service account,
package main | |
import ( | |
"context" | |
"encoding/base64" | |
"flag" | |
"fmt" | |
"log" | |
"google.golang.org/api/container/v1" |
select role, processUuid, | |
max(heapMemoryTotalUsed)/(1024*1024) maxHeapMemoryMB, | |
avg(processCpuLoad)/1000000000 avgProcessCpuLoad | |
from profiler_CpuAndMemory | |
where appId = 'application_1508123456789_12345678' | |
and role = 'executor' | |
group by 1, 2 |
spark-submit --deploy-mode cluster --master yarn --conf spark.jars=hdfs://hdfs_url/lib/jvm-profiler-0.0.5.jar --conf spark.driver.extraJavaOptions=-javaagent:jvm-profiler-0.0.5.jar --conf spark.executor.extraJavaOptions=-javaagent:jvm-profiler-0.0.5.jar --class com.company.SparkJob spark_job.jar |
hdfs dfs -put target/jvm-profiler-0.0.5.jar hdfs://hdfs_url/lib/jvm-profiler-0.0.5.jar |
java -javaagent:target/jvm-profiler-0.0.5.jar=reporter=com.uber.profiling.reporters.KafkaOutputReporterbrokerList=localhost:9092,topicPrefix=profiler_ -cp target/jvm-profiler-0.0.5.jar com.uber.profiling.examples.HelloWorldApplication |
... | |
ConsoleOutputReporter - CpuAndMemory: {"nonHeapMemoryTotalUsed":1.080164E7,"bufferPools":[{"totalCapacity":0,"name":"direct","count":0,"memoryUsed":0},{"totalCapacity":0,"name":"mapped","count":0,"memoryUsed":0}],"heapMemoryTotalUsed":2.1689544E7,"epochMillis":1522433751081,"nonHeapMemoryCommitted":1.3303808E7,"heapMemoryCommitted":2.57425408E8... |
java -javaagent:target/jvm-profiler-0.0.5.jar=reporter=com.uber.profiling.reporters.ConsoleOutputReporter -cp target/jvm-profiler-0.0.5.jar com.uber.profiling.examples.HelloWorldApplication |