Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Build Storage Gateway and create SMB and NFS services on AWS

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Create File Gateway

two。 Select EC2

3. Select the corresponding EC2 Instance. The official recommendation is m4.xlarge.

Set the network and subnet. This place should be selected in the same subnet as the Windows or Linux EC2 on which you want to mount the Storage Gateway later, because the subsequent SMB and NFS are mounted through the private network IP, such as the 172IP address range, not the public network IP.

Adding EBS is also critical, because this is the cache space that Storage Gateway automatically creates and uses later.

Security Group fill in the ports to be developed. These 111s and 20048 are particularly important. If not, SMB and NFS mounts will fail. For these two ports, the official documents are not written clearly, and there are differences between the old and new documents. I tried several times to figure out that these two ports must be added. For the IP that allows access to these ports, it is recommended to set it to the private network IP of the EC2 that needs to be accessed later. Because the subsequent activation of Gateway is through HTTP, especially for China, because public network http access is prohibited by default, Gateway can only be accessed and activated through private network IP EC2, which made me think in a roundabout way. There is no problem that foreign region Gateway can be accessed and activated through public network IP, but not in China.

Then you can Launch the Instance.

After waiting for Instance ready, return to this interface point Next

Enter private network IP (this can only be done in China) or public network IP activation, where China activation can copy the Windows EC2 linked to the same network segment to open activation: http://172.22.xx.xxx/?gatewayType=FILE_S3&activationRegion=cn-north-1

Activate this key, if it cannot be activated, you need to recreate the EC2 Instance, because after activation, the activated connection is no longer accessible. The activation process automatically initializes the previously created EBS volume to a cache.

After activation, you can see that the Gateway is displayed below

Then create a NFS or SMB

Let's talk about creating NFS first.

Create file share

Enter the S3 bucket name that needs to be bound to Gateway, and select NFS

Keep the default selection

Allow client enter the private network IP of the EC2 that needs to access this NFS

And then the File shares is created.

You can then mount the NFS through the command prompted below

The NFS client also needs to be installed for the loading of Windows Server. My test environment is Server 2012, and I need to add Client for NFS, otherwise CMD will prompt the problem that the mount command does not recognize.

After mounting, it can be used like a local disk.

The next step is to create SMB. Since the server I have is a Windosw environment, SMB is also very suitable.

Before creating a SMB, you must first set a password for accessing the SMB. Later, you need to use this password to verify the Windows mount. I did not know this one before, which led to a lot of detours in the creation prompt page to do Active Directory. In fact, you do not need AD support at all, just activate Guest access, and create Guest access is set here. Official documents are too fucked up. This point is not written clearly.

two。 Fill in the corresponding S3 bucket and select SMB

Choose by default

Select Guest access here, and then click close

After completion, you can see the following prompt command, but this command is not easy to use, constantly prompting errors with no permissions or incorrect password. I will mount it in another direct way.

Enter Windows EC2 and open Computer

Follow the prompts to enter the user name: smbguest, and the previously set SMB password to complete the mount

But outside:

A maximum of 10 File Share can be created for 1 Gateway

1 S3 bucket can only be hung under one File Share under the same gateway.

The created Storage Gateway instance can be accessed through the user name: adimin, but there is nothing special to set after login

Recommended for file gateway types

General-purpose instance family- m4 or m5 instance type.

Compute-optimized instance family- c4 or c5 instance types. Select the 2xlarge instance size or higher to meet the required RAM requirements.

Memory-optimized instance family-r3 instance types.

Storage-optimized instance family- i3 instance types.

NFS mount command, this command in windows when I copy and paste into windows prompted that there is a problem with the command, but manual typing works normally, I do not know why

Mount-o nolock-o mtype=hard 172.1.1.111:/s3-bucket X:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report