service fabric docker 安装
1. 镜像拉取
docker pull microsoft/service-fabric-onebox
2. 配置docker(daemon.json)
{
"ipv6": true,
"fixed-cidr-v6": "fd00::/64"
}
3. 启动镜像
docker run -itd -p 19080:19080 --name sfonebox microsoft/service-fabric-onebox
4. 使用交互式运行,配置集群
docker exec -it sfonebox bash
./setup.sh
./run.sh
备注:等待比较长的时间的下载serviec fabric 就可启动了
5. 查看资源管理界面
![](https://images2018.cnblogs.com/blog/562987/201803/562987-20180316144351324-1869714238.png)
6. Service Fabric CLI 安装(python3)
pip3 install sfctl
7. Service Fabric CLI 使用
a. 选择集群
sfctl cluster select --endpoint http://localhost:19080
b. 集群状态信息查看
sfctl cluster health
输出信息
{
"additionalProperties": {},
"aggregatedHealthState": "Ok",
"applicationHealthStates": [
{
"additionalProperties": {},
"aggregatedHealthState": "Ok",
"name": "fabric:/System"
}
],
"healthEvents": [],
"healthStatistics": {
"additionalProperties": {},
"healthStateCountList": [
{
"additionalProperties": {},
"entityKind": "Node",
"healthStateCount": {
"additionalProperties": {},
"errorCount": 0,
"okCount": 3,
"warningCount": 0
}
},
{
"additionalProperties": {},
"entityKind": "Application",
"healthStateCount": {
"additionalProperties": {},
"errorCount": 0,
"okCount": 0,
"warningCount": 0
}
},
{
"additionalProperties": {},
"entityKind": "Service",
"healthStateCount": {
"additionalProperties": {},
"errorCount": 0,
"okCount": 0,
"warningCount": 0
}
},
{
"additionalProperties": {},
"entityKind": "Partition",
"healthStateCount": {
"additionalProperties": {},
"errorCount": 0,
"okCount": 0,
"warningCount": 0
}
},
{
"additionalProperties": {},
"entityKind": "Replica",
"healthStateCount": {
"additionalProperties": {},
"errorCount": 0,
"okCount": 0,
"warningCount": 0
}
},
{
"additionalProperties": {},
"entityKind": "DeployedApplication",
"healthStateCount": {
"additionalProperties": {},
"errorCount": 0,
"okCount": 0,
"warningCount": 0
}
},
{
"additionalProperties": {},
"entityKind": "DeployedServicePackage",
"healthStateCount": {
"additionalProperties": {},
"errorCount": 0,
"okCount": 0,
"warningCount": 0
}
}
]
},
"nodeHealthStates": [
{
"additionalProperties": {},
"aggregatedHealthState": "Ok",
"id": {
"additionalProperties": {},
"id": "b9d52c016a15a8f57673d3b8041e2d35"
},
"name": "N0030"
},
{
"additionalProperties": {},
"aggregatedHealthState": "Ok",
"id": {
"additionalProperties": {},
"id": "c2e9eff19761acc9924422c53c8943d0"
},
"name": "N0010"
},
{
"additionalProperties": {},
"aggregatedHealthState": "Ok",
"id": {
"additionalProperties": {},
"id": "cf68563e16a44f808e86197a9cf83de5"
},
"name": "N0020"
}
],
"unhealthyEvaluations": []
}
8. cli 命令大全
Service Fabric Command Line
application: Create, delete, and manage applications and application types.
chaos : Start, stop and report on the chaos test service.
cluster : Select, manage and operate Service Fabric clusters.
compose : Create, delete and manage Docker Compose applications.
is : Query and send commands to the infrastructure service.
node : Manage the nodes that form a cluster.
partition : Query and manage partitions for any service.
property : Store and query properties under Service Fabric names.
replica : Manage the replicas that belong to service partitions.
rpm : Query and send commands to the repair manager service.
sa-cluster : Manage stand-alone Service Fabric clusters.
service : Create, delete and manage service, service types and service packages.
store : Perform basic file level operations on the cluster image store.
9. 参考资料
https://docs.microsoft.com/zh-cn/azure/service-fabric/service-fabric-get-started-mac