# Jibe and SMB Providers SMB2 change notifications can be used to identify files and folders that have been modified outside the Access Anywhere and sync them with the Access Anywhere metadata. #### Jibe Sync with SMB Notifications {{ /jibe:smb-notify:smb-notify-arch.png?600 |}} For general information on Jibe see [[/jibe]]. ## Overview * **Near Real-Time** - Metadata in Access Anywhere is updated in most cases within 15 seconds after objects are updated in SMB. # Getting Started ## SMB Setup Account credentials are required with at least list-only access to the file servers being monitored. ## Access Anywhere Setup Jibe needs a Access Anywhere account with an Administrator role in order to synchronize files and folders. ## Jibe Installation See [[/jibe/docker|Installation]]. ### Configuration File Change the endpoint and credentials in `jibe-config.json` to those of your Access Anywhere Server. Create an "SMB" source. { "endpoint": "https://example.com", "login": "adminuser@example.com", "password": "*****", "sources": [ { "name" : "Provider Name", "flavor" : "SMB", "share" : "ExampleShare", "smb_dir" : "", "smb_server" : "smb.example.com", "smb_username" : "smbuser", "smb_password" : "smbpass" } ] } For more information see [[/jibe/configuration|Jibe Configuration]] and [[/jibe/logging|Jibe Logging]]. # Implementation Notes ## SMB Change Notifications The SMB2 protocol supports subscribing to change notifications via blocking requests (aka long polling). For more information: * [MS-SMB2: SMB2 CHANGE_NOTIFY Request](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/598f395a-e7a2-4cc8-afb3-ccb30dd2df7c) * [MS-SMB2: Algorithm for Change Notifications in an Object Store](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/1e03994f-ccce-4fc8-a370-4efa610b3e05) ## Recovery Since we’re using an event stream rather than logs or queues if Jibe is not actively listening to the event stream, changes are lost; there is no history to use for recovery. For recovery of missing events, use a full provider resync. You could also run Jibe on two different nodes so that Jibe somewhere is always listening to SMB events. ## Folders SMB notification logic currently does not distinguish files from folders. Jibe will try to sync an event as a file, and based on the event and error may retry as a folder. ## Folder Rename When a folder is renamed or moved Jibe will process the SMB event as separate delete and add events. That is, as if a folder is being deleted and a new folder created. When Access Anywhere detects a removed folder on sync it will start a background delete task to remove child metadata. When Access Anywhere detects a new folder on sync it does not automatically sync the new folder tree. In this case Jibe will start a deep cloud refresh task in the background. For new folders Jibe can also walk the new folder tree (depth-first) and run resyncs on each subfolder. To set this behavior for the instance or a source use this setting: "use_providersyncinbackground": false Renaming a folder generates two SMB events, remove and add. ## Batching Jibe batches in groups of 5 seconds for better performance. ## Cache Consistency A 5-15 second delay is added before SMB events are processed. ## Access Anywhere Files Jibe will not synchronize internal files and temp files created by Access Anywhere processes. For more information see the configuation settings for `skip_naapath`, `skip_tmp` and ``skip_lock``. ## Remote Nasuni Filers Jibe does not currently process ```STATUS_NOTIFY_ENUM_DIR``` events which indicate changes were made on a remote filer. ## Heartbeat A file is created/removed if an SMB event is not seen for 10 minutes, configurable with `heartbeat_minutes`. Disable by setting `heartbeat` to false. The hearbeat file is /jibe-heartbeat.txt. It can be changed with `heartbeat_folder` and `heartbeat_filename`. An extension 'txt' is always added. If no events are seen for 20 minutes the SMB connection is closed and reopened. This is configurable with `no_events_restart_minutes`. Disable with `no_events_restart`. ### Heartbeat A file is created/removed if an SMB event is not seen for 10 minutes, configurable with `heartbeat_minutes`. Disable by setting `heartbeat` to false. The default hearbeat file is /jibe-heartbeat.txt. It can be changed with `heartbeat_folder` and `heartbeat_filename`. An extension 'txt' is always added. { "heartbeat" : true, "heartbeat_minutes" : 10, "heartbeat_folder" : "/", "heartbeat_filename" : "jibe-heartbeat" } If no events are seen for 20 minutes the SMB connection is closed and reopened. This is configurable with `no_events_restart_minutes`. Disable with `no_events_restart`. { "no_events_restart" : true, "no_events_restart_minutes" : 15 } ## Vendors We have tested with the following implementations. * Windows NT * Nasuni UniFS * AWS FSx for Windows * Azure NetApp Files * Hidden folders supported