我有一个非常简单的设置:1个主控,1个框架和一些代理。每个任务都需要一个我放入S3中的jar。当框架构建URI时,它将缓存设置为true。然而,对于每一项任务,缓存都会被绕过:
import java.lang.reflect.InvocationTargetException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
public class Main {
public static void main(String[] args){
Connection conn = null;
Properties properties = new Properties(); //I use Properties to make things easer.
properties.setProperty("user", "root");
properties.setProperty("password", "YourPassword");
properties.setProperty("useSSL", "false"); //Set useSSL to false to solve the problem.
try {
Class.forName("com.mysql.cj.jdbc.Driver").getConstructor().newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306", properties);
// Do something with the Connection
} catch (SQLException ex) {
// handle any errors
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
}catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
master,框架和任务以普通用户身份运行,而代理以root用户身份运行,从而可以确保资源隔离。
我以以下方式启动母版
I0630 17:26:15.740991 36722 fetcher.cpp:564] Fetcher Info: {"cache_directory":"\/tmp\/mesos\/fetch\/evan","items":[{"action":"BYPASS_CACHE","uri":{"extract":true,"value":"http:\/\/mybucket.s3.amazonaws.com\/myjar.jar"}}],"sandbox_directory":"\/tmp\/slaves\/03219e29-ad45-401d-9ed9-20ed2bd0ea7d-S0\/frameworks\/03219e29-ad45-401d-9ed9-20ed2bd0ea7d-0000\/executors\/task-000177\/runs\/e26f83ef-976b-4d97-95aa-bd0a76929c6f","stall_timeout":{"nanoseconds":60000000000},"user":"evan"}
我以以下方式启动代理:
$MESOS_HOME/bin/mesos-master.sh --advertise_ip=$externalip --ip=$ip --hostname=$masterhost --work_dir=/tmp
如您所见,启用了SSL。
如何获取要缓存的东西?
在相关说明中,如何使提取程序使用Content-Disposition标头?目前,我的jar世界是可读的,因为如果我使用签名的URL,那么下载的文件名中将包含查询参数。