Permission problem of Windows shared folder registration on Server on Linux

1. Scene

Two server sites are deployed on two virtual machines in Linux to form a cluster. Now, a folder must be opened in Windows as a data source for image service release, and it will not be copied to the server server.

Windows set up folder sharing (open nfs sharing). In the Windows machine, you need to add an arcgis local account, and the user name and password are consistent with the linux server machine (or use a user name and password that has read and write permissions for the local Windows shared folder).

Question: After Linux site A created the mount folder imagedata, permission 777 was opened to the arcgis account. But as long as the mount command is used to mount, arcgis will lose the write access to this shared folder and become root, causing the Server registration folder to fail.
Insert picture description here

2. Solution

1. Install NFS service under Windows

First, the NFS service needs to be installed in the Windows environment:
Insert picture description here
after the installation is complete, an nfs sharing tab will appear at the end of the Windows folder sharing menu.

2. Set up the arcgis account to access the share.

First enter the id arcgis command on the Linux machine to query the uid and gid of the arcgis account.
Then open the Windows nfs sharing tab:

Check to allow anonymous access and add the uid and gid of the arcgis account. This is 1001. save.

Insert picture description here

3. Linux machine register mount folder

A newly created imagedata2 folder is located at /nfsdata/imagedata2. The nfsdata here is the shared storage nfs access folder between Linux. But because it is a two-node cluster deployment, it is necessary to create the same folder /nfsdata/imagedata2 on machine B.

After the imagedata2 permissions are set, the mount command is:

mount -t cifs //10.118.3.42/image_data /nfsdata/imagedata2 -o username-arcgis password=xxxxxx,uid=1001,gid=1001,vers=2.0

Among them:
//10.118.3.42/image_data /nfsdata/imagedata2 is the Windows folder shared path; /nfsdata is the Linux mount folder path

In the same way, machine B needs to perform the same operation.

4. Write to the system

Edit the exports file
vim /etc/exports
and add in the exports file:

//10.118.3.42/image_data   /nfsdata/imagedata2   cifs  defaults,username=arcgis,password=xxxxxx,uid=1001,gid=1001,rw 0 2

Restart the nfs service:

service nfs restart 

Restart the rpcbind service

service rpcbind restart

Perform the same steps on machine B.

5. Auto mount at boot

At this time, the mount point becomes invalid after the Linux system is restarted, and the /etc/fstab file is modified to automatically start the mount. The AB machine adds the following content:

//10.118.3.42/image_data   /nfsdata/imagedata2   cifs  defaults,username=arcgis,password=xxxxxx,uid=1001,gid=1001,rw 02

6. Register folder to Server

Folders can be registered through AraMap or directly on the Server.
Registration reference:
Insert picture description here

The publisher path is the Windows shared path: \\10.118.3.42\image_data The
server folder path is the mount path on Linux: /nfsdata/imagedata2

Guess you like

Origin blog.csdn.net/suntongxue100/article/details/108461952