- 浏览: 2569655 次
- 性别:
- 来自: 成都
-
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
EFS and SOLR Cloud Backup(1)EFS Set Up for EC2 and Docker
EFS Set Up
Amazon Elastic File System EFS provide simple, scalable file storage for EC2 instance.
In the EFS console, we can create a File System, there is a File system ID and then we can set up config in Elastic Beantalk.
In the configuration file .ebextensions/storage-efs-mountfilesystem.config
###################################################################################################
#### Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
####
#### Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
#### except in compliance with the License. A copy of the License is located at
####
#### http://aws.amazon.com/apache2.0/
####
#### or in the "license" file accompanying this file. This file is distributed on an "AS IS"
#### BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#### License for the specific language governing permissions and limitations under the License.
###################################################################################################
###################################################################################################
#### This configuration file mounts an Amazon EFS file system to a directory named /efs. To mount
#### the file system to a different path, modify the MOUNT_DIRECTORY value in the "option_settings"
#### section.
####
#### The FILE_SYSTEM_ID setting references a resource named "FileSystem", which is created by the
#### storage-efs-createfilesystem.config configuration file. To use this file to mount a
#### file system that you created outside of AWS Elastic Beanstalk, replace the Ref with the
#### resource ID (e.g., fs-e7605f4e):
####
#### FILE_SYSTEM_ID: fs-e7605f4e
####
#### If your environment and file system are in a custom VPC, you must configure the VPC to allow
#### DNS resolution and DNS host names. See this topic in the VPC User Guide for more information:
#### http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html
###################################################################################################
option_settings:
aws:elasticbeanstalk:application:environment:
FILE_SYSTEM_ID: 'fs-a5838eec'
MOUNT_DIRECTORY: '/efs'
##############################################
#### Do not modify values below this line ####
##############################################
REGION: '`{"Ref": "AWS::Region"}`'
packages:
yum:
nfs-utils: []
jq: []
commands:
01_mount:
command: "/tmp/mount-efs.sh"
files:
"/tmp/mount-efs.sh":
mode: "000755"
content : |
#!/bin/bash
EFS_REGION=$(/opt/elasticbeanstalk/bin/get-config environment | jq -r '.REGION')
EFS_MOUNT_DIR=$(/opt/elasticbeanstalk/bin/get-config environment | jq -r '.MOUNT_DIRECTORY')
EFS_FILE_SYSTEM_ID=$(/opt/elasticbeanstalk/bin/get-config environment | jq -r '.FILE_SYSTEM_ID')
echo "Mounting EFS filesystem ${EFS_DNS_NAME} to directory ${EFS_MOUNT_DIR} ..."
echo 'Stopping NFS ID Mapper...'
service rpcidmapd status &> /dev/null
if [ $? -ne 0 ] ; then
echo 'rpc.idmapd is already stopped!'
else
service rpcidmapd stop
if [ $? -ne 0 ] ; then
echo 'ERROR: Failed to stop NFS ID Mapper!'
exit 1
fi
fi
echo 'Checking if EFS mount directory exists...'
if [ ! -d ${EFS_MOUNT_DIR} ]; then
echo "Creating directory ${EFS_MOUNT_DIR} ..."
mkdir -p ${EFS_MOUNT_DIR}
if [ $? -ne 0 ]; then
echo 'ERROR: Directory creation failed!'
exit 1
fi
else
echo "Directory ${EFS_MOUNT_DIR} already exists!"
fi
mountpoint -q ${EFS_MOUNT_DIR}
if [ $? -ne 0 ]; then
echo "mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 ${EFS_FILE_SYSTEM_ID}.efs.${EFS_REGION}.amazonaws.com:/ ${EFS_MOUNT_DIR}"
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 ${EFS_FILE_SYSTEM_ID}.efs.${EFS_REGION}.amazonaws.com:/ ${EFS_MOUNT_DIR}
if [ $? -ne 0 ] ; then
echo 'ERROR: Mount command failed!'
exit 1
fi
chmod 777 ${EFS_MOUNT_DIR}
runuser -l ec2-user -c "touch ${EFS_MOUNT_DIR}/it_works"
if [[ $? -ne 0 ]]; then
echo 'ERROR: Permission Error!'
exit 1
else
runuser -l ec2-user -c "rm -f ${EFS_MOUNT_DIR}/it_works"
fi
else
echo "Directory ${EFS_MOUNT_DIR} is already a valid mountpoint!"
fi
echo 'EFS mount complete.'
Because we use Docker in the Elastic Beantalk EC2 Host Machine, so we will mount that to our Docker as well.
elasticbeanstalk/Dockerrun.aws.json
{
"AWSEBDockerrunVersion": 2,
"volumes": [{
"name": "solr-home",
"host": {
"sourcePath": "/solr"
}
},
{
"name": "efs-directory",
"host": {
"sourcePath": "/efs"
}
}],
"containerDefinitions": [{
"name": "solr",
"image": “xxxxxxx.dkr.ecr.us-east-1.amazonaws.com/odt/solr:latest",
"environment": [{
"name": "OPERATION",
"value": "run-solr"
}],
"essential": true,
"memory": 35000,
"mountPoints": [{
"sourceVolume": "solr-home",
"containerPath": "/solr"
},
{
"sourceVolume": "awseb-logs-solr",
"containerPath": "/opt/solr/server/logs"
},
{
"sourceVolume": "efs-directory",
"containerPath": "/efs"
}
],
"portMappings": [{
"hostPort": 8983,
"containerPort": 8983
}]
},
{
"name": "init",
"image": “xxxxxx.dkr.ecr.us-east-1.amazonaws.com/odt/solr:latest",
"environment": [{
"name": "OPERATION",
"value": "join-cloud"
}],
"essential": false,
"memory": 1000,
"links": [
"solr"
],
"mountPoints": [{
"sourceVolume": "solr-home",
"containerPath": "/solr"
}]
},
{
"name": "healthcheck",
"image": “xxxx.dkr.ecr.us-east-1.amazonaws.com/odt/solr-healthcheck:latest",
"essential": true,
"memory": 1000,
"links": [
"solr"
],
"portMappings": [{
"hostPort": 8080,
"containerPort": 8080
}]
}
]
}
References:
https://aws.amazon.com/efs/?sc_channel=PS&sc_campaign=acquisition_US&sc_publisher=google&sc_medium=efs_b&sc_content=aws_efs_e&sc_detail=efs%20aws&sc_category=efs&sc_segment=208381315165&sc_matchtype=e&sc_country=US&s_kwcid=AL!4422!3!208381315165!e!!g!!efs%20aws&ef_id=WDe8wQAABKdZQ0gc:20180111034816:s
EFS Set Up
Amazon Elastic File System EFS provide simple, scalable file storage for EC2 instance.
In the EFS console, we can create a File System, there is a File system ID and then we can set up config in Elastic Beantalk.
In the configuration file .ebextensions/storage-efs-mountfilesystem.config
###################################################################################################
#### Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
####
#### Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
#### except in compliance with the License. A copy of the License is located at
####
#### http://aws.amazon.com/apache2.0/
####
#### or in the "license" file accompanying this file. This file is distributed on an "AS IS"
#### BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#### License for the specific language governing permissions and limitations under the License.
###################################################################################################
###################################################################################################
#### This configuration file mounts an Amazon EFS file system to a directory named /efs. To mount
#### the file system to a different path, modify the MOUNT_DIRECTORY value in the "option_settings"
#### section.
####
#### The FILE_SYSTEM_ID setting references a resource named "FileSystem", which is created by the
#### storage-efs-createfilesystem.config configuration file. To use this file to mount a
#### file system that you created outside of AWS Elastic Beanstalk, replace the Ref with the
#### resource ID (e.g., fs-e7605f4e):
####
#### FILE_SYSTEM_ID: fs-e7605f4e
####
#### If your environment and file system are in a custom VPC, you must configure the VPC to allow
#### DNS resolution and DNS host names. See this topic in the VPC User Guide for more information:
#### http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html
###################################################################################################
option_settings:
aws:elasticbeanstalk:application:environment:
FILE_SYSTEM_ID: 'fs-a5838eec'
MOUNT_DIRECTORY: '/efs'
##############################################
#### Do not modify values below this line ####
##############################################
REGION: '`{"Ref": "AWS::Region"}`'
packages:
yum:
nfs-utils: []
jq: []
commands:
01_mount:
command: "/tmp/mount-efs.sh"
files:
"/tmp/mount-efs.sh":
mode: "000755"
content : |
#!/bin/bash
EFS_REGION=$(/opt/elasticbeanstalk/bin/get-config environment | jq -r '.REGION')
EFS_MOUNT_DIR=$(/opt/elasticbeanstalk/bin/get-config environment | jq -r '.MOUNT_DIRECTORY')
EFS_FILE_SYSTEM_ID=$(/opt/elasticbeanstalk/bin/get-config environment | jq -r '.FILE_SYSTEM_ID')
echo "Mounting EFS filesystem ${EFS_DNS_NAME} to directory ${EFS_MOUNT_DIR} ..."
echo 'Stopping NFS ID Mapper...'
service rpcidmapd status &> /dev/null
if [ $? -ne 0 ] ; then
echo 'rpc.idmapd is already stopped!'
else
service rpcidmapd stop
if [ $? -ne 0 ] ; then
echo 'ERROR: Failed to stop NFS ID Mapper!'
exit 1
fi
fi
echo 'Checking if EFS mount directory exists...'
if [ ! -d ${EFS_MOUNT_DIR} ]; then
echo "Creating directory ${EFS_MOUNT_DIR} ..."
mkdir -p ${EFS_MOUNT_DIR}
if [ $? -ne 0 ]; then
echo 'ERROR: Directory creation failed!'
exit 1
fi
else
echo "Directory ${EFS_MOUNT_DIR} already exists!"
fi
mountpoint -q ${EFS_MOUNT_DIR}
if [ $? -ne 0 ]; then
echo "mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 ${EFS_FILE_SYSTEM_ID}.efs.${EFS_REGION}.amazonaws.com:/ ${EFS_MOUNT_DIR}"
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 ${EFS_FILE_SYSTEM_ID}.efs.${EFS_REGION}.amazonaws.com:/ ${EFS_MOUNT_DIR}
if [ $? -ne 0 ] ; then
echo 'ERROR: Mount command failed!'
exit 1
fi
chmod 777 ${EFS_MOUNT_DIR}
runuser -l ec2-user -c "touch ${EFS_MOUNT_DIR}/it_works"
if [[ $? -ne 0 ]]; then
echo 'ERROR: Permission Error!'
exit 1
else
runuser -l ec2-user -c "rm -f ${EFS_MOUNT_DIR}/it_works"
fi
else
echo "Directory ${EFS_MOUNT_DIR} is already a valid mountpoint!"
fi
echo 'EFS mount complete.'
Because we use Docker in the Elastic Beantalk EC2 Host Machine, so we will mount that to our Docker as well.
elasticbeanstalk/Dockerrun.aws.json
{
"AWSEBDockerrunVersion": 2,
"volumes": [{
"name": "solr-home",
"host": {
"sourcePath": "/solr"
}
},
{
"name": "efs-directory",
"host": {
"sourcePath": "/efs"
}
}],
"containerDefinitions": [{
"name": "solr",
"image": “xxxxxxx.dkr.ecr.us-east-1.amazonaws.com/odt/solr:latest",
"environment": [{
"name": "OPERATION",
"value": "run-solr"
}],
"essential": true,
"memory": 35000,
"mountPoints": [{
"sourceVolume": "solr-home",
"containerPath": "/solr"
},
{
"sourceVolume": "awseb-logs-solr",
"containerPath": "/opt/solr/server/logs"
},
{
"sourceVolume": "efs-directory",
"containerPath": "/efs"
}
],
"portMappings": [{
"hostPort": 8983,
"containerPort": 8983
}]
},
{
"name": "init",
"image": “xxxxxx.dkr.ecr.us-east-1.amazonaws.com/odt/solr:latest",
"environment": [{
"name": "OPERATION",
"value": "join-cloud"
}],
"essential": false,
"memory": 1000,
"links": [
"solr"
],
"mountPoints": [{
"sourceVolume": "solr-home",
"containerPath": "/solr"
}]
},
{
"name": "healthcheck",
"image": “xxxx.dkr.ecr.us-east-1.amazonaws.com/odt/solr-healthcheck:latest",
"essential": true,
"memory": 1000,
"links": [
"solr"
],
"portMappings": [{
"hostPort": 8080,
"containerPort": 8080
}]
}
]
}
References:
https://aws.amazon.com/efs/?sc_channel=PS&sc_campaign=acquisition_US&sc_publisher=google&sc_medium=efs_b&sc_content=aws_efs_e&sc_detail=efs%20aws&sc_category=efs&sc_segment=208381315165&sc_matchtype=e&sc_country=US&s_kwcid=AL!4422!3!208381315165!e!!g!!efs%20aws&ef_id=WDe8wQAABKdZQ0gc:20180111034816:s
发表评论
-
Update Site will come soon
2021-06-02 04:10 1701I am still keep notes my tech n ... -
Hadoop Docker 2019 Version 3.2.1
2019-12-10 07:39 313Hadoop Docker 2019 Version 3.2. ... -
Nginx and Proxy 2019(1)Nginx Enable Lua and Parse JSON
2019-12-03 04:17 473Nginx and Proxy 2019(1)Nginx En ... -
Data Solution 2019(13)Docker Zeppelin Notebook and Memory Configuration
2019-11-09 07:15 318Data Solution 2019(13)Docker Ze ... -
Data Solution 2019(10)Spark Cluster Solution with Zeppelin
2019-10-29 08:37 266Data Solution 2019(10)Spark Clu ... -
AMAZON Kinesis Firehose 2019(1)Firehose Buffer to S3
2019-10-01 10:15 342AMAZON Kinesis Firehose 2019(1) ... -
Rancher and k8s 2019(3)Clean Installation on CentOS7
2019-09-19 23:25 338Rancher and k8s 2019(3)Clean In ... -
Pacemaker 2019(1)Introduction and Installation on CentOS7
2019-09-11 05:48 363Pacemaker 2019(1)Introduction a ... -
Crontab-UI installation and Introduction
2019-08-30 05:54 476Crontab-UI installation and Int ... -
Spiderkeeper 2019(1)Installation and Introduction
2019-08-29 06:49 536Spiderkeeper 2019(1)Installatio ... -
Supervisor 2019(2)Ubuntu and Multiple Services
2019-08-19 10:53 388Supervisor 2019(2)Ubuntu and Mu ... -
Supervisor 2019(1)CentOS 7
2019-08-19 09:33 344Supervisor 2019(1)CentOS 7 Ins ... -
Redis Cluster 2019(3)Redis Cluster on CentOS
2019-08-17 04:07 385Redis Cluster 2019(3)Redis Clus ... -
Amazon Lambda and Version Limit
2019-08-02 01:42 451Amazon Lambda and Version Limit ... -
MySQL HA Solution 2019(1)Master Slave on MySQL 5.7
2019-07-27 22:26 552MySQL HA Solution 2019(1)Master ... -
RabbitMQ Cluster 2019(2)Cluster HA and Proxy
2019-07-11 12:41 478RabbitMQ Cluster 2019(2)Cluster ... -
Running Zeppelin with Nginx Authentication
2019-05-25 21:35 335Running Zeppelin with Nginx Aut ... -
Running Zeppelin with Nginx Authentication
2019-05-25 21:34 337Running Zeppelin with Nginx Aut ... -
ElasticSearch(3)Version Upgrade and Cluster
2019-05-20 05:00 342ElasticSearch(3)Version Upgrade ... -
Jetty Server and Cookie Domain Name
2019-04-28 23:59 421Jetty Server and Cookie Domain ...
相关推荐
请创建一个EFS挂载点挂载到本地文件系统和容器环境致谢 (用作引导程序)路线图检查系统是否已安装NFS utils(在启动时)要求主机上安装的NFS工具( ) Docker 1.8+ AWS EFS支持的区域上的AWS EC2主机用法启动插件$ ...
标题"I959_EFS_Backup_Restore_WIN"表明这是一个针对特定型号手机(I959)的EFS(Embedded File System)备份与恢复工具的Windows版本。EFS是Android系统中一个至关重要的部分,它存储了设备的网络锁、IMEI(国际...
1. 连接手机到电脑:使用USB数据线将N7100与装有N7100_EFS_Backup_Restore_WIN的Windows计算机相连,并确保手机处于开发者模式,开启了USB调试。 2. 启动工具:运行N7100_EFS_Backup_Restore_WIN程序,软件会自动...
2. **恢复丢失的证书**: 如果用户失去了EFS证书,该工具会尝试从备份中恢复,或者查找其他可能存在的证书副本。 3. **支持多种恢复场景**: 包括但不限于用户账户被删除、硬盘故障、系统崩溃、恶意软件攻击等。 4. ...
在移动通信领域,特别是涉及到Qualcomm芯片组的设备,EFS(Ethernet for Fast Switching)文件系统是存储网络配置和身份信息的重要部分。本文将深入探讨如何使用Qualcomm的QPST(Qualcomm Product Support Tool)...
1. **EFS(Encrypting File System)**:是Windows操作系统中的一个文件加密技术,它允许用户对NTFS分区上的文件和文件夹进行透明加密,保护敏感数据免受未经授权的访问。 2. **数据解密**:EFS加密的数据需要对应...
1. **备份EFS证书和私钥**:在用户的个人证书存储区中,EFS加密文件关联的证书和私钥需要被备份。这可以通过导出证书并保存到安全的位置来完成,通常是一个密码保护的.pfx或.p12文件。 2. **备份恢复代理**:在企业...
在IT领域,efs解密工具是一种专门用于处理 Encrypting File System (EFS) 加密文件的软件。EFS是Windows操作系统内置的一种文件加密技术,它允许用户对个人文件和文件夹进行加密,确保数据在存储和传输过程中的安全...
三星7100EFS是针对三星Galaxy Note 2(型号N7100)的一个关键组件,主要涉及手机的基带系统。基带,或称无线电固件,是移动设备中负责处理无线通信的部分,包括蜂窝网络、Wi-Fi、蓝牙等。EFS(Encrypting File ...
### EFS 文件解密知识点详解 #### 一、EFS(Encrypting File System)概述 EFS(Encrypting File System),即加密文件系统,是一种专为NTFS文件系统设计的数据加密技术,它允许用户对存储在本地硬盘上的数据进行...
2. 下载并安装EFS备份工具,如“EFS Backup & Restore”等。 3. 连接设备到电脑,确保手机处于USB调试模式。 4. 使用工具进行备份操作,保存备份文件到安全位置。 5. 完成备份后,可以将备份文件存储在云服务或外部...
1. **安装软件**:首先,你需要运行"**EFS秘钥解密.msi**"这个安装程序来安装Advanced EFS Data Recovery。安装过程中可能需要管理员权限,以允许软件访问系统文件和设置。 2. **扫描NTFS分区**:启动软件后,选择...
- 示例3:加密`efs1`目录中的`ichat.txt`文件。 ```cmd cipher /e /a:efs1\ichat.txt ``` 2. **查询加密目录和加密文件**: - 示例4:查询F盘中的`efs`目录是否被加密。 ```cmd cipher /e efs ``` - 示例5...
1. `aefsdr.exe`:这是主应用程序文件,包含了执行EFS数据恢复的逻辑和算法。 2. `elcom_reg.dll`和`elcom_xml.dll`:这些是动态链接库文件,可能包含注册和XML处理相关的功能,支持工具的正常运行。 3. `注册运行....
1. **深度扫描**:Advanced EFS Data Recovery可以深入扫描硬盘,寻找所有受EFS加密的文件,并尝试恢复关联的恢复代理证书或备份密钥。 2. **兼容性广泛**:支持各种版本的Windows操作系统,包括Windows XP、...
使用N719_EFS_Backup_Restore_WIN这个工具进行备份和恢复操作相对简单。首先,您需要在电脑上安装该工具,并确保手机已经通过USB连接到电脑。运行工具后,选择备份功能,软件会将EFS分区的内容完整地保存到本地文件...
2. 运行"NOTE3 N9009 EFS备份还原工具",选择备份选项,程序会创建EFS分区的完整镜像文件,保存在用户的电脑上。 3. 若需恢复,选择还原选项,将之前备份的EFS镜像文件回写到设备的EFS分区。 4. 在整个过程中,确保...
### Efs C# 帮助文档知识点梳理 #### 第一章 概述 - **Efs框架定位**:Efs作为一个企业级快速开发的UI层框架,主要目的是简化ExtJS框架的使用复杂度,让开发者能更专注于业务逻辑而非页面布局与组件的构建。 - **...
【小米6_EFS分区备份.zip】是一个专门为小米6智能手机用户准备的数据备份文件,它包含了手机中的EFS(Embedded File System)分区的重要数据。EFS分区是Android系统中一个至关重要的部分,尤其是对于小米6这样的设备...
1. EFS备份的必要性: - 数据安全:EFS存储的数据直接影响到设备的正常运行和安全性。意外刷机、系统更新或者硬件故障可能导致EFS文件损坏,备份EFS可以在出现问题时恢复原始状态。 - 防止锁死:误操作或恶意软件...