24
Samba as a gateway to OpenAFS Fabrizio Manfredi Furuholmen SambaXP April 2007

Samba as a gateway to OpenAFS

Embed Size (px)

Citation preview

Page 1: Samba as a gateway to OpenAFS

Samba as a gateway to OpenAFS

Fabrizio Manfredi Furuholmen

SambaXP April 2007

Page 2: Samba as a gateway to OpenAFS

Page 2

GoalSolutionGateway ArchitectureGateway ConfigurationIntegration ToolsTuning PerformanceResult

Agenda

Page 3: Samba as a gateway to OpenAFS

Page 3

Primary goal of the project was to design and build an inexpensive storage system

Requirements:Handle terabytes of data Transparent to final user Working in WAN environmentGood level of scalability

Goals

Project Goal

Page 4: Samba as a gateway to OpenAFS

Page 4

Centralize Storage (hardware solution)SAN

Blockdevice interface Performance

NASFilesystem interfaceShared filesystem

Distributed Filesystem (software solution)Filesystem interfaceSingle file system across multiple computer nodes

Solution

Considerations

Page 5: Samba as a gateway to OpenAFS

Page 5

Big Server vs Small Server (Google Techs)

Small number of inexpensive fileserversprovides similar performance to client side

Increase in capacity are inexpensive

Better manageability and redundancy.

Solution

Considerations

Page 6: Samba as a gateway to OpenAFS

Page 6

Terabyte Cost (SAS/FB)14k euro NAS/SAN4k euro DFS

Disks Size143 vs 300 SAS/FB reduce 30%

Disks Type250/500 SATA Disk reduce >50%

Installation

Software

Discount

Administration

Solution

Storage Price

59.200210.800201.200TOTAL for 14 Tb

12.20062.80053.200TOTAL for 1.5 Tb

1.2001.2001.2002 Switch Gb

2.0002.0002 Server Gw

6.0002 Switch FB

1.6004 FB interface

56.00014 Server Storage 1Tb (SAS)

9.0003 Server Storage 500Gb (SAS)

200.000200.000Storage 14TB 100 disks (110/150)

52.00052.000Storage1.5 Tb with 10 disks (110/150)

DFSSANNASComponents

Page 7: Samba as a gateway to OpenAFS

Page 7

Distributed FilesystemAFS

Free available and stable Support of large installations (>200TB with 40 milion Files) More then 20 platforms are supportedAggressive Roadmap ($350,000 per year from CSG)

Samba (Gateway)AFS windows client uses internal file server emulation (slow)ClientlessFast and stable

User IdentityHeimdal Kerberos Autentichation (SSO)

KA emulationLDAP backend2b protocol (large kerberos ticket)

OpenldapCentralize storage

User administration scripts (custom provisioning)

Solution

Solution

Page 8: Samba as a gateway to OpenAFS

Page 8

Transparent Access and Uniform NamespaceCellPartitions and volumesMount PointsIn-use volume moves

ScalabilityClient CachingReplicationLoad balance among servers while data is in use

SecurityAuthentication and secure communicationAuthorization and flexible access control

System ManagementSingle system interfaceAdministration tasks without system outageDelegationBackup

SolutionAFS Features

Page 9: Samba as a gateway to OpenAFS

Page 9

ScalabilityStorage scalability

(Filesystem layer)User scalability

(Samba Gateway layer)

PerformanceLoad balancingRoaming user/branch office

Clientless

Centralized IdentityKerberosLdap

Gateway Architeture

Architeture

Page 10: Samba as a gateway to OpenAFS

Page 10

Compile OptionsEnable KA server emulation--with-fake-kaserver

Enable AFS ACL mapping--with-vfs-afsacl

Don’t use AFS clear text password switch (old not supported)--with-afs

Setting Samba Trusting (undocumented)Obtain KeyFile from AFS fileserver (/usr/afs/etc/)Import an OpenAFS KeyFile into secrets.tdb:net afs key AFSKeyFile

Custom script for AFSKeyFile sync (Key rotation)

Useful command (undocumented)Impersonate user, create a token for user@cell:net afs impersonate <user> <cell>

Gateway Configuration

Enable AFS in Samba

Page 11: Samba as a gateway to OpenAFS

Page 11

Mapping Domain User<-> PtsSingle domain/unique identification:

afs username map = %[email protected]

Multiple domain/duplicated identificationStore DOMAIN+user:

afs username map = %D+%[email protected]

Store the SID in pt server:afs username map = %[email protected]

Enable AFS share afs share = yes

Gateway Configuration

smb.conf

Page 12: Samba as a gateway to OpenAFS

Page 12

Access only from samba serverSamba default

Access only from samba and local gwDisable oplocks , level2 oplocks .. Only with Byte-range locking on AFS client (AFS>1.5.X)

Access from all system Enable strict locking option (mandatory lock)

Gateway Configuration

smb.conf locking

Page 13: Samba as a gateway to OpenAFS

Page 13

Primary server HA (DFS Root) Heartbeat VIP associated to primary Samba Server

Transparent Access (MSDFS)No compile option required Enable DFS on Primary Samba serverhost msdfs = yes

Samba Scalability DFS Proxy,

Share redirection Name resolved with DNS (link is FQDN)

(ex. msdfs proxy = \gw1.intranet.zeropiu.it\share)DFS root ,

Directory link Fault tolerance (ex. ln –s msdfs:\\server1\share1,server2\share1 share1)

Gateway Configuration

Samba scalability and HA

Page 14: Samba as a gateway to OpenAFS

Page 14

Heimdal integrationCompile

Enable ldap backend (--with-openldap)

ConfigurationEnable ldap backend Enable 2b token for Kerberos V integration Only if have old client: enable-kaserver / afs3-salt

LDAPOpenldap 2.3 (SASL EXTERNAL)Extending Schema (Samba,hdb ..)nss_switch with ldap support

PAMPAM Kerberos V integration

Gateway Configuration

Identity Storage

Page 15: Samba as a gateway to OpenAFS

Page 15

Custom user administration script (iauser.pl)Unix user (ldap)Samba user (ldap)Kerberos user (ldap)Pt server user Volume and mount point

Groups administration script (iagroup.pl)Create unix group (ldap)Create samba group (ldap)Create pt server group

Syncronization administration script (ptsSync.pl)Synchronization user from ldap to pt server

Integration ToolsIdentity Administration

Page 16: Samba as a gateway to OpenAFS

Page 16

Hardware 3 FileServer Linux

2 GB of RAM, 3GHz Xeon processor 2x36Gb SAS RAID 1 for operating system partition 4x 143GB SAS RAID5 storage

2 Server Gateway Linux2 GB of RAM, 3GHz Xeon dual processor 2x36Gb SCSI RAID 1 for operating system partition

SoftwareSamba 3.22OpenAFS 1.4.2IOzone 3.8

Performance

Test Enviroment

Page 17: Samba as a gateway to OpenAFS

Page 17

Samba Client

Client: Windows XP sp2

Server: Linux 2.6.9Samba 3.22

Write: 30-43MB/secRead: 40-50MB/sec

Performance

64

256

1024

4096

16384

65536

262144

4

64

1024

16384

0

5000

10000

15000

20000

25000

30000

35000

40000

45000

kb

block

write

40000-4500035000-4000030000-3500025000-3000020000-2500015000-2000010000-150005000-100000-5000

64

256

1024

4096

16384

65536

262144

4

64

1024

16384

0

10000

20000

30000

40000

50000

60000

70000

kb

block

read

60000-7000050000-6000040000-5000030000-4000020000-3000010000-200000-10000

Page 18: Samba as a gateway to OpenAFS

Page 18

AFS ClientClient:

Linux 2.6.9openafs 1.4.2

Server: Linux 2.6.9openafs 1.4.2

Write: 20-37MB/sec

Read Cold Cache: 22-28MB/secWarm Cache: >45MB/sec

Performance

64

256

1024

4096

16384

65536

262144

4

64

1024

16384

0

5000

10000

15000

20000

25000

30000

35000

40000

kb

block

write

35000-4000030000-3500025000-3000020000-2500015000-2000010000-150005000-100000-5000

4

16 64

256

1024

4096

16384

2048

16384

1310720

10000

20000

30000

40000

50000

60000

70000

80000

90000

a

43

read

80000-9000070000-8000060000-7000050000-6000040000-5000030000-4000020000-3000010000-200000-10000

Page 19: Samba as a gateway to OpenAFS

Page 19

Samba GW Server:

Linux 2.6.9openafs 1.4.2

Gateway: Linux 2.6.9OpenAFS 1.4.2Samba 3.22

Client:Windows XP sp2

Write: 18-25MB/sec

Read Warm Cache: 30-40MB/sec

Performance

64

256

1024

4096

16384

65536

262144

4

64

1024

16384

0

5000

10000

15000

20000

25000

kb

block

write

20000-2500015000-2000010000-150005000-100000-5000

64

256

1024

4096

16384

65536

262144

4

64

1024

16384

0

5000

10000

15000

20000

25000

30000

35000

40000

45000

kb

block

read

40000-4500035000-4000030000-3500025000-3000020000-2500015000-2000010000-150005000-100000-5000

Page 20: Samba as a gateway to OpenAFS

Page 20

Throughoutput Coparisonwrite

0

5000

10000

15000

20000

25000

30000

35000

40000

45000

512

1024

2048

4096

819216

384

3276

8

6553

613

1072

2621

4452

4288

filesize

AFSSambaSamba-GW

Performance

read

0

10000

20000

30000

40000

50000

60000

70000

80000

90000

512

1024

2048

4096

8192

1638

4

3276

8

6553

613

1072

2621

4452

4288

AFSSambaSamba-GW

Page 21: Samba as a gateway to OpenAFS

Page 21

Samba Configuration (increase 30%)Enable socket options = TCP_NODELAY (Default)Increase SO_RCVBUF (16384)

Increase SO_SNDBUF (32768)

AFS Cache Manager (increase 20%)Increase block size (chunksize 19) Increase cache elements (dcache 5000) Increase server daemon (daemons 6)Increase rx packet (rxpck 2000) Increase data cache file (files 50000)Increase Cache size (cache size 4gb)Use separated disk for cache

Performance

Tuning

Page 22: Samba as a gateway to OpenAFS

Page 22

Reduced costReduced storage cost 40.000 Euro (1.5TB Storage)Reduced down time

Increase performanceClient side

Simplify System Administration taskData accessible from everywhereHigh security level (kerberos base)Single sign-on Disaster recovery (Volume replication)

Result

Benefit

Page 23: Samba as a gateway to OpenAFS

Page 23

OpenAFSLock subsystem, support AFS 1.5.X (Byte range)Windows client, support AFS 1.5.X Inode interface Socket communication vlserver/fileserverMemory cacheDisable fsync on write (AFS 1.5.X + patch)WebDav

SambaCluster

External project (www.beolink.org)Ptserver with ldap backend (ptsldap)Web Administration interface (AFS Manager)

Next

Under Testing

Page 24: Samba as a gateway to OpenAFS

Page 24

The End

Manfred at zeropiu.itwww.beolink.org