Microsoft Distributed cache appfabric (velocity)-Administrator's Guide

Source: Internet
Author: User
Tags configuration settings management studio sql server management sql server management studio

1. installation and configuration

This section describes how to store clusters on sqlserver. You need to consider many factors to decide which storage method to choose for your application.ProgramIs the best choice. Sqlserver is recommended for storage configuration. Using a network shared directory may be faster than using sqlserver in small application or development scenarios.

We strongly recommend that you use SQL Server Management studio to manage cache permissions.

1.1 Use sqlserver to store cache cluster configuration files

1. select an appropriate server as the database host.

2. Configure the database instance to be consistent with the enterprise connection standards.

3. Create a database. A small distributed cache system may only need several MB of data storage space. The database installed at the location of 50 MB of available space should be more than enough, and it can even manage the cache clusters of 100 services.

4. Create a sqlserver Security Identifier and prepare to install the cache instance. Make sure that the access ID of the cache cluster data has the db_owner permission. To create a cache service account, you must also have the SysAdmin permission. The following is an SQL authorization script.

The following is an example of the permissions granted by the installer during the installation of the SQL Server cache server. Based on the name of the Windows service on the cache host running on the cache server, the actual Transact-SQLCodeIt will be different.

-- Create logon for cache host serviceCreate login [corporatedomainname \ cacheservercomputername $] from windows with default_database = [cacheconfigdatabase] Go-- Create user account for cache host serviceUse [cacheconfigdatabase] gocreate user [corporatedomainname \ cacheservercomputername $] For Login [corporatedomainname \ cacheservercomputername $]-- Grant permissions for cache host serviceExec sp_addrolemember N'Db_datareader', N'Corporatedomainname \ cacheservercomputername $'Exec sp_addrolemember N'Db_datawriter', N'Corporatedomainname \ cacheservercomputername $'Grant execute to [corporatedomainname \ cacheservercomputername $] Go

 

The following is an example of the Security Identifier of the "velocity" installation to be run by an SQL server script. The system administrator is required because the installer tries to create a new account for each SQL server instance of the cache server.

 -- Create login for security identity of person installing Create login [corporatedomainname \ personinstallingcacheserver] from windows with default_database = [Master] Go -- Grant SysAdmin permissions for security identity of person installing Exec master .. SP_ADDSRVROLEMEMBER @ loginame = N' Corporatedomainname \ personinstallingcacheserver ', @ Rolename = N' SysAdmin ' -- Create user account for security identity of person installing Use [cacheconfigdatabase] gocreate user [corporatedomainname \ personinstallingcacheserver] For Login [corporatedomainname \ personinstallingcacheserver] With default_schema = [DBO] -- Grant permissions for security identity of person installing Exec sp_addrolemember N' Db_owner ', N' Corporatedomainname \ personinstallingcacheserver 'Go

1.2 use a shared directory to store cache cluster configuration files

1. select an appropriate host and submit a directory share

2. Create a security authentication user to ensure that other cache hosts can access the shared directory. This security demonstration account requires the Administrator permission to access the shared directory.

3. Allow this account to use the window service of the cache host. Each cache host must have the read and write permissions for the shared directory.

1.2 install the cache host

1. Configure the access permission for the cluster configuration file location

2. allows hosts in the domain to read and write cluster configurations.

3. Create an editable cluster configuration

4. Install the powershell-based Cache administrator tool and all cache-related eaglets

5. Install the Windows Service of the cache host and specify that the service runs under the network account.

6. Applies security permissions on the installation folders used by the cache host service and the powershell-based Cache administration tool.

7. configures the necessary firewall exceptions for the cache host service. For more information

1.3 install the cache client assembly

To use the cache cluster, the cache application server or a workstation in the Visual Studio development environment must have a local copy of Microsoft Project code called "velocity. These components are installed on the cache server of the "velocity" installer. Copy the installation folders of some Assembly Cache servers to a single folder on your application server or development Workstation:

Cachebaselibrary. dll

Clientlibrary. dll

Fabriccommon. dll

Casbase. dll

2. Deployment Options)

To simplify the discussion of deployment options, this topic will focus on three different examples:

Development and deployment: A single computer is used to deploy cache-enabled applications. All components and services are deployed on a machine for development.

Medium-sized deployment: Multi-computer installation. If SQL server is not used, lead hosts executes the cluster management role.

Because sqlserver is not used for cluster configuration management, the use of the network shared directory is restricted by the connection data, and it is not easy to expand the cluster. For Windows XP and Windows Vista, Windows Vista supports up to 10 connections to access shared directories. Of course, these operating systems are not recommended as cache hosts.

Enterprise deployment: Multi-computer installation. The SQL Server is used to store cluster configuration settings and perform cluster management.

Compared with the other two solutions, such deployment is the most reliable and has the strongest load capacity. It requires an SQL Server database.

 

3. Automatic Installation of Cache Server)

 Velocity provides automatic installation. Security authentication is required for each service during automatic installation through the GUI.

When you install velocity, you must edit the cluster configuration. If you configure it as a network shared directory, the configuration file may beClusterconfig. SDF. For this reason, we recommend that you install the cache service one by one when using shared directories.

Sqlserver has an advantage in processing file concurrency. When you use sqlserver to configure the storage location, you can install the cache service at the same time without sharing conflicts.

4. How to install velocity for the first time

1. First decide the mode to choose to store cluster configuration.

2. Set proper access permissions for cluster configurations to ensure that they can be accessed by other hosts.

3. Confirm the hardware and software environments on each cache server.

4. Download the velocity Installation File and copy it to the cache server. Select a 32-bit or 64-bit version based on different operating systems for installation.

4.1 visual installation: double-click the installation file to install

4.2 automatic installation: Open the cmd.exe command line tool to locate the installation file. Then run the automatic installation command (for more information, see API)

5. Open the powershell administrator tool. In Windows 6.x, right-click the velocity installer and select "Run as administrator ".

6. Set the policy for running the signed assembly in powershell. This is the cmdlet for the Cache Management to be run. Select different execution policies based on the cluster configuration. Follow the prompts or manually run the command: set-executionpolicy's allsigned setting policy

7. Use start-cacheculster to enable the cluster.

8. (optional) create a cache named firstcache and use the new-Cache firstcache command.

9. Install the Assembly used by the cache client in the development environment for developing cache-enabled applications

 

5. How to add a cache server (install an additional Cache Server)

(Omitted. In the previous section, the commands used are not the same. Add the Host:Set-executionpolicy allsigned:Start-cachehost-hostname cacheserver1-cacheport 22233)

 

Velocity has many configurations, including cluster configuration and cache client configuration. For more information, see the management documentation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.