我在一台拥有10台以上机器的集群上运行Hadoop 1.1.2.对于HDFS和MapReduce,我想很好地向上和向下扩展.通过"很好",我的意思是我要求数据不会丢失(允许HDFS节点解除),并且在关闭之前运行任务的节点完成.
我注意到,一旦退役,datanode进程就会死掉,这很好.这是我删除节点的方法:
$ hadoop mradmin -refreshNodes
$ hadoop dfsadmin -refreshNodes
$ hadoop-daemon.sh stop tasktracker
要重新添加节点(假设它已被删除,如上所述),这就是我正在做的事情.
$ hadoop mradmin -refreshNodes
$ hadoop dfsadmin -refreshNodes
$ hadoop-daemon.sh start tasktracker
$ hadoop-daemon.sh start datanode
这是"很好地"向上和向下扩展的正确方法吗?按比例缩小时,我注意到某些不幸工作的工作持续时间急剧上升(因为他们在被移除的节点上运行的任务需要重新安排).
是否有一些方法可以在2D中获得更加有序的三角测量,就像Matlab Delaunay产生的那样?这是Matlab的2D Delaunay三角剖分的一个例子.
使用此代码:
xPoints = np.arange(0,11,1)
yPoints = np.arange(0,11,1)
gridPoints = np.array([[x,y] for y in yPoints for x in xPoints])
tri = Delaunay(gridPoints)
plt.triplot(gridPoints[:,0],gridPoints[:,1],tri.simplices.copy())
plt.plot(gridPoints[:,0],gridPoints[:,1],'bo')
plt.title("Triangulation Visualization")
Run Code Online (Sandbox Code Playgroud)
我得到以下三角测量:
注意Matlab结果中的对角弧如何具有相同的斜率; 但那些在scipy结果中的人是变化的.由于Matlab和Scipy都在内部使用QHull,我认为有一些方法来模仿Matlab结果.
在ADAL.Net 3.x中,UserPasswordCredential在2.x的UserCredential之上引入.但同一个UserPasswordCredential在同一个nuget包下的.Net Core中没有公开?
UserCredential类只有一个属性UserName
namespace Microsoft.IdentityModel.Clients.ActiveDirectory
{
//
// Summary:
// Credential used for integrated authentication on domain-joined machines.
public class UserCredential
{
//
// Summary:
// Constructor to create user credential. Using this constructor would imply integrated
// authentication with logged in user and it can only be used in domain joined scenarios.
public UserCredential();
//
// Summary:
// Constructor to create credential with client id and secret
//
// Parameters:
// userName:
// Identifier of the user application …
Run Code Online (Sandbox Code Playgroud) 我的映射器需要发送以下元组:
<custID,prodID,rate>
Run Code Online (Sandbox Code Playgroud)
并且我希望将减少器作为密钥发送到reducer,并将prodID和速率作为值一起发送,因为它们是减少阶段所需的.这是最好的方法吗?
public void map(Object key, Text value, Context context)
throws IOException, InterruptedException {
String[] col = value.toString().split(",");
custID.set(col[0]);
data.set(col[1] + "," + col[2]);
context.write(custID, data);
}
public void reduce(Text key, Iterable<Text> values, Context context)
throws IOException, InterruptedException {
for (Text val : values) {
String[] temp = val.toString().split(",");
Text rate = new Text(temp[1]);
result.set(rate);
context.write(key, result);
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个Web应用程序,它使用ADAL库通过Azure Active Directory进行身份验证.
此Web应用程序通过将ADAL标记字符串作为参数传递来调用C#REST服务.在我的REST服务中,我想验证此令牌.如果令牌有效,则服务将执行该操作.
我搜索了很多但是找不到在我的休息服务中验证JWT令牌的方法.你能帮帮我吗?
在Azure门户上启用了多因素身份验证,并且每当我登录到Dynamics 365时它将发送OTP。我想在C#控制台应用程序中使用MFA登录。
c# azure azure-active-directory dynamics-crm-365 multi-factor-authentication
我有一个托管 API 的本地服务器,并且我已按照此处提到的步骤使用 Azure AD 应用程序代理公开了该 API:https: //learn.microsoft.com/en-us/azure/active-directory/管理应用程序/应用程序代理添加本地应用程序
我可以使用 OAuth 2.0 通过代理访问 API,方法是从 Azure AD 获取授权代码,然后获取令牌,将代理 URI 指定为资源。
问题是,如何在不经过 OAuth 2.0 授权流程的情况下访问 API?
我通过创建另一个 Web API 应用程序 (App2) 并授予对代理应用程序的访问权限来尝试客户端凭据流程。我可以按照以下步骤使用客户端凭据流获取令牌。
https://login.microsoftonline.com/{tenantid}/oauth2/token
?grant_type=client_credentials
&client_id={clientId}
&client_secret={secret}
&resource={proxyurl}
Run Code Online (Sandbox Code Playgroud)
当我使用此令牌访问代理 API 时,它说
当我尝试使用令牌(通过授权流程)时,我能够访问代理 API,但是当我尝试使用给予 App2 的令牌访问代理 API 时,我认为它应该允许访问 API。
目前的结果是:
内部服务器错误:
目前无法访问此企业应用。请稍后再试...
后续步骤 客户端请求遇到内部服务器错误。
快速链接 了解有关应用程序代理服务的更多信息 对应用程序代理服务进行故障排除
我想从给定的 URL 获取访问令牌:
https://login.microsoftonline.com/{AzureTenantId}/oauth2/v2.0/token
Run Code Online (Sandbox Code Playgroud)
我正在传递以下参数,如 Microsoft 文档中所述:
client_id
, scope
, client_secret
, grant_type
。
当我点击此 URL 时,我收到“400 Bad Request”响应。
当我从 Postman 尝试同样的操作时,它成功并为我提供了一个访问令牌:
但不是来自我的代码:
public async Task<string> GetAuthorizationToken(string clientId, string ServicePrincipalPassword, string AzureTenantId) {
var result = "";
var requestURL = "https://login.microsoftonline.com/{AzureTenantId}/oauth2/v2.0/token";
var _httpClient = new HttpClient();
var model = new {
client_id = clientId,
scope = "{clentID}/.default",
client_secret = ServicePrincipalPassword,
grant_type = "client_credentials"
};
HttpContent httpContent = new StringContent(JsonConvert.SerializeObject(model), System.Text.Encoding.UTF8, "application/x-www-form-urlencoded");
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, new Uri(requestURL)) { …
Run Code Online (Sandbox Code Playgroud) Your access token has expired. Please renew it before submitting the request.
当我呼叫https://graph.windows.net/myorganization/oauth2PermissionGrants?api-version=1.5
端点时,我正在接收.
为了防止任何愚蠢的问题 - 是的,我知道Microsoft Graph
建议使用而不是Azure AD Graph
.我知道它,我正在使用它.但对于我目前的情况,我需要完全要求Azure AD Graph
.
测试案例:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=....
并获得code
响应.code
并继续access_token
前进https://login.microsoftonline.com/common/oauth2/v2.0/token
.Microsoft Graph
端点发出请求(即https://graph.microsoft.com/education/me/classes
).https://graph.windows.net/myorganization/oauth2PermissionGrants?api-version=1.5
.Authentication_ExpiredToken
Your access token has expired. Please renew it before submitting the request.
Microsoft Graph
端点发出请求,因此它access_token
是有效的.根据这篇文章:https://docs.microsoft.com/azure/active-directory/develop/active-directory-appmodel-v2-overview,我可以使用此访问令牌来访问Microsoft Graph API
以及Azure AD …
当我尝试安装 AzureAD 模块时,出现以下错误:
Import-Module -Name AzureAD
Run Code Online (Sandbox Code Playgroud)
导入模块:未加载指定的模块“AzureAD”,因为在任何模块目录中都找不到有效的模块文件。
c# ×4
azure ×3
adal ×2
hadoop ×2
.net-core ×1
access-token ×1
azure-devops ×1
delaunay ×1
java ×1
jwt ×1
mapper ×1
multi-factor-authentication ×1
numpy ×1
oauth-2.0 ×1
powershell ×1
python ×1
scipy ×1
validation ×1