Splunk SmartStore & Azure Blob配置
1. 使用 AKSK 方式
1.1 所有数据存储在 Blob 上
1.1.1 索引器配置:
- 在
$SPLUNK_HOME/etc/system/local/server.conf中:
# 表示这部分配置是关于 Splunk 集群相关的设置。
[clustering]
# 将当前索引器节点在集群中的角色设定为从节点,从节点主要负责数据的索引和处理等工作。
mode = slave
# 指定集群主节点的访问地址,从节点通过此地址与主节点通信,获取配置信息、同步数据等,`<cluster_master_host>` 需替换为实际的集群主节点主机名或 IP 地址,`8089` 是默认的管理端口。
master_uri = https://<cluster_master_host>:8089
- 在
$SPLUNK_HOME/etc/system/local/indexes.conf中,为每个索引配置:
# 定义具体的索引名称,需根据实际情况替换,如 `[main_index]` 等。
[<index_name>]
# 指定该索引热数据的存储路径,这里表示存储在名为 `my_smartstore_volume` 的存储卷下对应的索引路径中,热数据是近期频繁访问和写入的数据。
homePath = volume:my_smartstore_volume/<index_name>/db
# 指定索引冷数据的存储路径,冷数据是不再频繁访问的数据,会转移到该路径存储。
coldPath = volume:my_smartstore_volume/<index_name>/colddb
# 指定索引解冻数据的存储路径,当冷数据需要再次访问时,会先解冻并存储在此路径。
thawedPath = volume:my_smartstore_volume/<index_name>/thaweddb
1.1.2 集群主节点配置:
- 在
$SPLUNK_HOME/etc/system/local/server.conf中:
# 集群相关配置节。
[clustering]
# 将当前节点设定为集群主节点,主节点负责管理集群的配置、协调从节点等工作。
mode = master
- 在
$SPLUNK_HOME/etc/system/local/indexes.conf中:
# 定义名为 `my_smartstore_volume` 的存储卷配置。
[volume:my_smartstore_volume]
# 表明该存储卷使用远程存储。
storageType = remote
# 指定远程存储路径,`azure://` 是 Azure 远程存储前缀,`<container_name>` 是 Azure Blob 存储容器名,`<path>` 是容器内具体路径。
path = azure://<container_name>/<path>
# 指定 Azure 存储账户名称,用于标识存储资源。
remote.azure.account = <storage_account_name>
# 指定访问 Azure 存储的访问密钥(AK)。
remote.azure.key = <access_key>
# 指定访问 Azure 存储的秘密密钥(SK),与访问密钥配合进行身份验证。
remote.azure.secret_key = <secret_key>
# 表示使用分隔符来列出远程存储上的对象,提高列表效率。
remote.azure.use_delimiter = true
# 指定使用的最小 SSL/TLS 版本为 TLS 1.2 进行连接。
remote.azure.sslVersions = tls1.2
# 设置为不验证服务器证书。
remote.azure.sslVerifyServerCert = false
# 设置为不进行 TLS 主机名验证检查。
remote.azure.sslVerifyServerName = false
# 设置为保持与 Azure 存储 API 的连接通道打开。
remote.azure.httpKeepAlive = true
# 表示远程存储支持版本控制。
remote.azure.supports_versioning = true
# 指定 Azure Blob 存储端点地址。
remote.azure.endpoint = https://<storage_account_name>.blob.core.windows.net/
# 指定使用的 Azure 存储容器名称。
remote.azure.container_name = <container_name>
# 指定上传数据时每个块的最大大小为 75MB(78643200 字节)。
remote.azure.upload.chunk_size = 78643200
# 指定上传操作的并发线程数为 5。
remote.azure.upload.concurrency = 5
# 指定下载数据时每个块的最大大小为 75MB(78643200 字节)。
remote.azure.download.chunk_size = 78643200
# 指定下载操作的并发线程数为 5。
remote.azure.download.concurrency = 5
# 指定一次从远程存储下载的最大对象数为 50。
remote.azure.max_download_batch_size = 50
# 指定一次列出 Blob 的最大数量为 1000。
remote.azure.max_listing_page_size = 1000
# 设置远程文件操作的重试策略为最大重试次数。
remote.azure.retry_policy = max_count
# 设置最大重试次数为 3 次。
remote.azure.max_count.max_retries_in_total = 3
# 设置重试的初始延迟为 4000 毫秒(4 秒)。
remote.azure.backoff.initial_delay_ms = 4000
# 设置最大重试延迟为 120000 毫秒(120 秒)。
remote.azure.backoff.max_retry_delay_ms = 120000
# 表示不进行数据完整性验证。
remote.azure.data_integrity_validation = disabled
# 表示不压缩文件。
remote.azure.compression = false
# 指定当启用压缩时,要压缩的文件扩展名为 `tsidx`。
remote.azure.compression_extension_list = tsidx
1.2 所有数据在本地
1.2.1 索引器配置:
- 在
$SPLUNK_HOME/etc/system/local/server.conf中:
# 表示这部分配置是关于 Splunk 集群相关的设置。
[clustering]
# 将当前索引器节点在集群中的角色设定为从节点,从节点主要负责数据的索引和处理等工作。
mode = slave
# 指定集群主节点的访问地址,从节点通过此地址与主节点通信,获取配置信息、同步数据等,`<cluster_master_host>` 需替换为实际的集群主节点主机名或 IP 地址,`8089` 是默认的管理端口。
master_uri = https://<cluster_master_host>:8089
- 在
$SPLUNK_HOME/etc/system/local/indexes.conf中,为每个索引配置:
# 定义具体的索引名称,需根据实际情况替换,如 `[main_index]` 等。
[<index_name>]
# 指定索引热数据存储在本地 `$SPLUNK_DB` 路径下对应的索引路径中。
homePath = $SPLUNK_DB/<index_name>/db
# 指定索引冷数据存储在本地 `$SPLUNK_DB` 路径下对应的索引冷数据路径中。
coldPath = $SPLUNK_DB/<index_name>/colddb
# 指定索引解冻数据存储在本地 `$SPLUNK_DB` 路径下对应的索引解冻数据路径中。
thawedPath = $SPLUNK_DB/<index_name>/thaweddb
1.2.2 集群主节点配置:
- 在
$SPLUNK_HOME/etc/system/local/server.conf中:
# 集群相关配置节。
[clustering]
# 将当前节点设定为集群主节点,主节点负责管理集群的配置、协调从节点等工作。
mode = master
- 此时无需在
indexes.conf中配置 SmartStore 相关存储卷,因为不使用远程存储。
1.3 一些在 Blob,一些在本地
1.3.1 索引器配置:
- 在
$SPLUNK_HOME/etc/system/local/server.conf中:
# 表示这部分配置是关于 Splunk 集群相关的设置。
[clustering]
# 将当前索引器节点在集群中的角色设定为从节点,从节点主要负责数据的索引和处理等工作。
mode = slave
# 指定集群主节点的访问地址,从节点通过此地址与主节点通信,获取配置信息、同步数据等,`<cluster_master_host>` 需替换为实际的集群主节点主机名或 IP 地址,`8089` 是默认的管理端口。
master_uri = https://<cluster_master_host>:8089
- 在
$SPLUNK_HOME/etc/system/local/indexes.conf中区分索引:
- 对于存储在本地的索引:
# 定义具体的索引名称,需根据实际情况替换,如 `[main_index]` 等。
[<index_name>]
# 指定索引热数据存储在本地 `$SPLUNK_DB` 路径下对应的索引路径中。
homePath = $SPLUNK_DB/<index_name>/db
# 指定索引冷数据存储在本地 `$SPLUNK_DB` 路径下对应的索引冷数据路径中。
coldPath = $SPLUNK_DB/<index_name>/colddb
# 指定索引解冻数据存储在本地 `$SPLUNK_DB` 路径下对应的索引解冻数据路径中。
thawedPath = $SPLUNK_DB/<index_name>/thaweddb
- 对于存储在 Blob 上的索引:
# 定义存储在 Blob 上的索引名称。
[<blob_index_name>]
# 指定存储在 Blob 上的索引热数据在 `my_smartstore_volume` 存储卷下的路径。
homePath = volume:my_smartstore_volume/<blob_index_name>/db
# 指定存储在 Blob 上的索引冷数据在 `my_smartstore_volume` 存储卷下的路径。
coldPath = volume:my_smartstore_volume/<blob_index_name>/colddb
# 指定存储在 Blob 上的索引解冻数据在 `my_smartstore_volume` 存储卷下的路径。
thawedPath = volume:my_smartstore_volume/<blob_index_name>/thaweddb
1.3.2 集群主节点配置:
- 在
$SPLUNK_HOME/etc/system/local/server.conf中:
# 集群相关配置节。
[clustering]
# 将当前节点设定为集群主节点,主节点负责管理集群的配置、协调从节点等工作。
mode = master
- 在
$SPLUNK_HOME/etc/system/local/indexes.conf中:
# 定义名为 `my_smartstore_volume` 的存储卷配置。
[volume:my_smartstore_volume]
# 表明该存储卷使用远程存储。
storageType = remote
# 指定远程存储路径,`azure://` 是 Azure 远程存储前缀,`<container_name>` 是 Azure Blob 存储容器名,`<path>` 是容器内具体路径。
path = azure://<container_name>/<path>
# 指定 Azure 存储账户名称,用于标识存储资源。
remote.azure.account = <storage_account_name>
# 指定访问 Azure 存储的访问密钥(AK)。
remote.azure.key = <access_key>
# 指定访问 Azure 存储的秘密密钥(SK),与访问密钥配合进行身份验证。
remote.azure.secret_key = <secret_key>
# 表示使用分隔符来列出远程存储上的对象,提高列表效率。
remote.azure.use_delimiter = true
# 指定使用的最小 SSL/TLS 版本为 TLS 1.2 进行连接。
remote.azure.sslVersions = tls1.2
# 设置为不验证服务器证书。
remote.azure.sslVerifyServerCert = false
# 设置为不进行 TLS 主机名验证检查。
remote.azure.sslVerifyServerName = false
# 设置为保持与 Azure 存储 API 的连接通道打开。
remote.azure.httpKeepAlive = true
# 表示远程存储支持版本控制。
remote.azure.supports_versioning = true
# 指定 Azure Blob 存储端点地址。
remote.azure.endpoint = https://<storage_account_name>.blob.core.windows.net/
# 指定使用的 Azure 存储容器名称。
remote.azure.container_name = <container_name>
# 指定上传数据时每个块的最大大小为 75MB(78643200 字节)。
remote.azure.upload.chunk_size = 78643200
# 指定上传操作的并发线程数为 5。
remote.azure.upload.concurrency = 5
# 指定下载数据时每个块的最大大小为 75MB(78643200 字节)。
remote.azure.download.chunk_size = 78643200
# 指定下载操作的并发线程数为 5。
remote.azure.download.concurrency = 5
# 指定一次从远程存储下载的最大对象数为 50。
remote.azure.max_download_batch_size = 50
# 指定一次列出 Blob 的最大数量为 1000。
remote.azure.max_listing_page_size = 1000
# 设置远程文件操作的重试策略为最大重试次数。
remote.azure.retry_policy = max_count
# 设置最大重试次数为 3 次。
remote.azure.max_count.max_retries_in_total = 3
# 设置重试的初始延迟为 4000 毫秒(4 秒)。
remote.azure.backoff.initial_delay_ms = 4000
# 设置最大重试延迟为 120000 毫秒(120 秒)。
remote.azure.backoff.max_retry_delay_ms = 120000
# 表示不进行数据完整性验证。
remote.azure.data_integrity_validation = disabled
# 表示不压缩文件。
remote.azure.compression = false
# 指定当启用压缩时,要压缩的文件扩展名为 `tsidx`。
remote.azure.compression_extension_list = tsidx
2. 使用客户端方式(基于 Azure 活动目录客户端令牌认证)
2.1 所有数据存储在 Blob 上
2.1.1 索引器配置:
- 在
$SPLUNK_HOME/etc/system/local/server.conf中:
# 表示这部分配置是关于 Splunk 集群相关的设置。
[clustering]
# 将当前索引器节点在集群中的角色设定为从节点,从节点主要负责数据的索引和处理等工作。
mode = slave
# 指定集群主节点的访问地址,从节点通过此地址与主节点通信,获取配置信息、同步数据等,`<cluster_master_host>` 需替换为实际的集群主节点主机名或 IP 地址,`8089` 是默认的管理端口。
master_uri = https://<cluster_master_host>:8089
- 在
$SPLUNK_HOME/etc/system/local/indexes.conf中,为每个索引配置:
# 定义具体的索引名称,需根据实际情况替换,如 `[main_index]` 等。
[<index_name>]
# 指定该索引热数据的存储路径,这里表示存储在名为 `my_smartstore_volume` 的存储卷下对应的索引路径中,热数据是近期频繁访问和写入的数据。
homePath = volume:my_smartstore_volume/<index_name>/db
# 指定索引冷数据的存储路径,冷数据是不再频繁访问的数据,会转移到该路径存储。
coldPath = volume:my_smartstore_volume/<index_name>/colddb
# 指定索引解冻数据的存储路径,当冷数据需要再次访问时,会先解冻并存储在此路径。
thawedPath = volume:my_smartstore_volume/<index_name>/thaweddb
2.1.2 集群主节点配置:
- 在
$SPLUNK_HOME/etc/system/local/server.conf中:
# 集群相关配置节。
[clustering]
# 将当前节点设定为集群主节点,主节点负责管理集群的配置、协调从节点等工作。
mode = master
- 在
$SPLUNK_HOME/etc/system/local/indexes.conf中:
# 定义名为 `my_smartstore_volume` 的存储卷配置。
[volume:my_smartstore_volume]
# 表明该存储卷使用远程存储。
storageType = remote
# 指定远程存储路径,`azure://` 是 Azure 远程存储前缀,`<container_name>` 是 Azure Blob 存储容器名,`<path>` 是容器内具体路径。
path = azure://<container_name>/<path>
# 指定 Azure 存储账户名称。
remote.azure.account = <storage_account_name>
# 指定认证方法为 OAuth,通过 Azure 活动目录进行身份验证。
remote.azure.auth_method = oauth
# 指定 Azure 活动目录租户 ID,用于标识租户。
remote.azure.tenant = <tenant_id>
# 指定客户端 ID,用于 OAuth 认证中标识应用程序。
remote.azure.client_id = <client_id>
# 指定客户端密钥,与客户端 ID 配合进行 OAuth 认证。
remote.azure.client_secret = <client_secret>
# 表示使用分隔符来列出远程存储上的对象,提高列表效率。
remote.azure.use_delimiter = true
# 指定使用的最小 SSL/TLS 版本为 TLS 1.2 进行连接。
remote.azure.sslVersions = tls1.2
# 设置为不验证服务器证书。
remote.azure.sslVerifyServerCert = false
# 设置为不进行 TLS 主机名验证检查。
remote.azure.sslVerifyServerName = false
# 设置为保持与 Azure 存储 API 的连接通道打开。
remote.azure.httpKeepAlive = true
# 表示远程存储支持版本控制。
remote.azure.supports_versioning = true
# 指定 Azure Blob 存储端点地址。
remote.azure.endpoint = https://<storage_account_name>.blob.core.windows.net/
# 指定使用的 Azure 存储容器名称。
remote.azure.container_name = <container_name>
# 指定上传数据时每个块的最大大小为 75MB(78643200 字节)。
remote.azure.upload.chunk_size = 78643200
# 指定上传操作的并发线程数为 5。
remote.azure.upload.concurrency = 5
# 指定下载数据时每个块的最大大小为 75MB(78643200 字节)。
remote.azure.download.chunk_size = 78643200
# 指定下载操作的并发线程数为 5。
remote.azure.download.concurrency = 5
# 指定一次从远程存储下载的最大对象数为 50。
remote.azure.max_download_batch_size = 50
# 指定一次列出 Blob 的最大数量为 1000。
remote.azure.max_listing_page_size = 1000
# 设置远程文件操作的重试策略为最大重试次数。
remote.azure.retry_policy = max_count
# 设置最大重试次数为 3 次。
remote.azure.max_count.max_retries_in_total = 3
# 设置重试的初始延迟为 4000 毫秒(4 秒)。
remote.azure.backoff.initial_delay_ms = 4000
# 设置最大重试延迟为 120000 毫秒(120 秒)。
remote.azure.backoff.max_retry_delay_ms = 120000
# 表示不进行数据完整性验证。
remote.azure.data_integrity_validation = disabled
# 表示不压缩文件。
remote.azure.compression = false
# 指定当启用压缩时,要压缩的文件扩展名为 `tsidx`。
remote.azure.compression_extension_list = tsidx
2.2 所有数据在本地
2.2.1 索引器配置:
- 在
$SPLUNK_HOME/etc/system/local/server.conf中:
# 表示这部分配置是关于 Splunk 集群相关的设置。
[clustering]
# 将当前索引器节点在集群中的角色设定为从节点,从节点主要负责数据的索引和处理等工作。
mode = slave
# 指定集群主节点的访问地址,从节点通过此地址与主节点通信,获取配置信息、同步数据等,`<cluster_master_host>` 需替换为实际的集群主节点主机名或 IP 地址,`8089` 是默认的管理端口。
master_uri = https://<cluster_master_host>:8089
- 在
$SPLUNK_HOME/etc/system/local/indexes.conf中,为每个索引配置:
# 定义具体的索引名称,需根据实际情况替换,如 `[main_index]` 等。
[<index_name>]
# 指定索引热数据存储在本地 `$SPLUNK_DB` 路径下对应的索引路径中。
homePath = $SPLUNK_DB/<index_name>/db
# 指定索引冷数据存储在本地 `$SPLUNK_DB` 路径下对应的索引冷数据路径中。
coldPath = $SPLUNK_DB/<index_name>/colddb
# 指定索引解冻数据存储在本地 `$SPLUNK_DB` 路径下对应的索引解冻数据路径中。
thawedPath = $SPLUNK_DB/<index_name>/thaweddb
2.2.2 集群主节点配置:
- 在
$SPLUNK_HOME/etc/system/local/server.conf中:
# 集群相关配置节。
[clustering]
# 将当前节点设定为集群主节点,主节点负责管理集群的配置、协调从节点等工作。
mode = master
- 此时无需在
indexes.conf中配置 SmartStore 相关存储卷,因为不使用远程存储。
2.3 一些在 Blob,一些在本地
2.3.1 索引器配置:
- 在
$SPLUNK_HOME/etc/system/local/server.conf中:
# 表示这部分配置是关于 Splunk 集群相关的设置。
[clustering]
# 将当前索引器节点在集群中的角色设定为从节点,从节点主要负责数据的索引和处理等工作。
mode = slave
# 指定集群主节点的访问地址,从节点通过此地址与主节点通信,获取配置信息、同步数据等,`<cluster_master_host>` 需替换为实际的集群主节点主机名或 IP 地址,`8089` 是默认的管理端口。
master_uri = https://<cluster_master_host>:8089
- 在
$SPLUNK_HOME/etc/system/local/indexes.conf中区分索引:
- 对于存储在本地的索引:
# 定义具体的索引名称,需根据实际情况替换,如 `[main_index]` 等。
[<index_name>]
# 指定索引热数据存储在本地 `$SPLUNK_DB` 路径下对应的索引路径中。
homePath = $SPLUNK_DB/<index_name>/db
# 指定索引冷数据存储在本地 `$SPLUNK_DB` 路径下对应的索引冷数据路径中。
coldPath = $SPLUNK_DB/<index_name>/colddb
# 指定索引解冻数据存储在本地 `$SPLUNK_DB` 路径下对应的索引解冻数据路径中。
thawedPath = $SPLUNK_DB/<index_name>/thaweddb
- 对于存储在 Blob 上的索引:
# 定义存储在 Blob 上的索引名称。
[<blob_index_name>]
# 指定存储在 Blob 上的索引热数据在 `my_smartstore_volume` 存储卷下的路径。
homePath = volume:my_smartstore_volume/<blob_index_name>/db
# 指定存储在 Blob 上的索引冷数据在 `my_smartstore_volume` 存储卷下的路径。
coldPath = volume:my_smartstore_volume/<blob_index_name>/colddb
# 指定存储在 Blob 上的索引解冻数据在 `my_smartstore_volume` 存储卷下的路径。
thawedPath = volume:my_smartstore_volume/<blob_index_name>/thaweddb
2.3.2 集群主节点配置:
- 在
$SPLUNK_HOME/etc/system/local/server.conf中:
# 集群相关配置节。
[clustering]
# 将当前节点设定为集群主节点,主节点负责管理集群的配置、协调从节点等工作。
mode = master
- 在
$SPLUNK_HOME/etc/system/local/indexes.conf中:
# 定义名为 `my_smartstore_volume` 的存储卷配置。
[volume:my_smartstore_volume]
# 表明该存储卷使用远程存储。
storageType = remote
# 指定远程存储路径,`azure://` 是 Azure 远程存储前缀,`<container_name>` 是 Azure Blob 存储容器名,`<path>` 是容器内具体路径。
path = azure://<container_name>/<path>
# 指定 Azure 存储账户名称。
remote.azure.account = <storage_account_name>
# 指定认证方法为 OAuth,通过 Azure 活动目录进行身份验证。
remote.azure.auth_method = oauth
# 指定 Azure 活动目录租户 ID,用于标识租户。
remote.azure.tenant = <tenant_id>
# 指定客户端 ID,用于 OAuth 认证中标识应用程序。
remote.azure.client_id = <client_id>
# 指定客户端密钥,与客户端 ID 配合进行 OAuth 认证。
remote.azure.client_secret = <client_secret>
# 表示使用分隔符来列出远程存储上的对象,提高列表效率。
remote.azure.use_delimiter = true
# 指定使用的最小 SSL/TLS 版本为 TLS 1.2 进行连接。
remote.azure.sslVersions = tls1.2
# 设置为不验证服务器证书。
remote.azure.sslVerifyServerCert = false
# 设置为不进行 TLS 主机名验证检查。
remote.azure.sslVerifyServerName = false
# 设置为保持与 Azure 存储 API 的连接通道打开。
remote.azure.httpKeepAlive = true
# 表示远程存储支持版本控制。
remote.azure.supports_versioning = true
# 指定 Azure Blob 存储端点地址。
remote.azure.endpoint = https://<storage_account_name>.blob.core.windows.net/
# 指定使用的 Azure 存储容器名称。
remote.azure.container_name = <container_name>
# 指定上传数据时每个块的最大大小为 75MB(78643200 字节)。
remote.azure.upload.chunk_size = 78643200
# 指定上传操作的并发线程数为 5。
remote.azure.upload.concurrency = 5
# 指定下载数据时每个块的最大大小为 75MB(78643200 字节)。
remote.azure.download.chunk_size = 78643200
# 指定下载操作的并发线程数为 5。
remote.azure.download.concurrency = 5
# 指定一次从远程存储下载的最大对象数为 50。
remote.azure.max_download_batch_size = 50
# 指定一次列出 Blob 的最大数量为 1000。
remote.azure.max_listing_page_size = 1000
# 设置远程文件操作的重试策略为最大重试次数。
remote.azure.retry_policy = max_count
# 设置最大重试次数为 3 次。
remote.azure.max_count.max_retries_in_total = 3
# 设置重试的初始延迟为 4000 毫秒(4 秒)。
remote.azure.backoff.initial_delay_ms = 4000
# 设置最大重试延迟为 120000 毫秒(120 秒)。
remote.azure.backoff.max_retry_delay_ms = 120000
# 表示不进行数据完整性验证。
remote.azure.data_integrity_validation = disabled
# 表示不压缩文件。
remote.azure.compression = false
# 指定当启用压缩时,要压缩的文件扩展名为 `tsidx`。
remote.azure.compression_extension_list = tsidx
本文来自博客园,作者:SprogQVQ,转载请注明原文链接:https://www.cnblogs.com/sprogqvq/p/18825179

浙公网安备 33010602011771号