Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorial:adm:mssql_database_support [2020/06/24 15:09]
apeterova domain user note
tutorial:adm:mssql_database_support [2021/03/30 12:13]
doischert [Develop CzechIdM with MsSQL and a docker]
Line 126: Line 126:
 8. Finally, restart the Apache Tomcat8 service so all changes take place. 8. Finally, restart the Apache Tomcat8 service so all changes take place.
  
 +=== Windows Authentication with NTLM ===
  
 +If you need to use Windows Authentication but can't use the integrated authentication as above (e.g. you are not running IdM on Windows), it's possible to use [[https://docs.microsoft.com/en-us/sql/connect/jdbc/using-ntlm-authentication-to-connect-to-sql-server?view=sql-server-ver15|NTLM authentication]]. You will explicitly set username and password.
  
 +Example properties:
 +<code properties>
 +spring.datasource.url=jdbc:sqlserver://xsqlserver123\CZECHIDM:1433;databaseName=bcv_idm_storage;integratedSecurity=true;authenticationScheme=NTLM;domain=yourdomain.tld
 +spring.datasource.username=someserviceuser
 +spring.datasource.password=somepassword
 +spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
 +spring.datasource.test-on-borrow=true
 +spring.datasource.validationQuery=SELECT 1
 +</code>
 +
 +The example is valid for SQL server running on the server "xsqlserver123", instance "CZECHIDM", database "bcv\_idm\_storage", domain "yourdomain.tld". Note that you don't specify the domain in the username.
  
 ==== Scheduler setup (quartz.properties) ==== ==== Scheduler setup (quartz.properties) ====
Line 167: Line 180:
    $ docker exec test-mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P <SA-PASSWORD> -d master -i /import.sql    $ docker exec test-mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P <SA-PASSWORD> -d master -i /import.sql
  
 +==== Use docker-compose ====
 +You can also use the following docker-compose.yml file. The advantage is that it uses persistent volumes and docker-compose cleans after itself better. Copy and edit (if needed) the code below to a file called 'docker-compose.yml':
 +
 +<code>
 +version: "3.2"
 +services:
 +  sql-server-db:
 +    container_name: sql-server-db
 +    image: microsoft/mssql-server-linux:2017-latest
 +    ports:
 +      - "1433:1433"
 +    environment:
 +      SA_PASSWORD: "Password123456"
 +      ACCEPT_EULA: "Y"
 +      MSSQL_BACKUP_DIR: "/var/opt/sqlserver"
 +      MSSQL_DATA_DIR: "/var/opt/sqlserver"
 +      MSSQL_LOG_DIR: "/var/opt/sqlserver"
 +    volumes:
 +      - 'systemdbs:/var/opt/mssql'
 +      - 'userdbs:/var/opt/sqlserver'
 +volumes:
 +  systemdbs:
 +  userdbs:
 +</code>
  
 +Then, in the same directory, use the command `docker-compose up` to start the database.
 ===== Troubleshooting ===== ===== Troubleshooting =====
  
  • by doischert