LoginSignup
2
3

More than 5 years have passed since last update.

Azure SQLを使用してRedmine

Last updated at Posted at 2015-10-30

目的

  • 今後、RailsのデータベースにAzureSQLを使うことで容易に冗長化を図りたい。
  • 仮想マシンでいくつもデータベースを作成すると正しく冗長化していない場合、メンテナンスやセキュリティーリスクが高くなる。
  • RailsだけでなくPHPからも試してみたい好奇心

必要なパッケージのインストール

sudo apt-get install freetds-bin freetds-dev

Redmine設定

基本的にデータベースの設定のみ掲載します。
それ以外は自分でカスタマイズ。自分の記事を参照にしています。
Nginx & Passenger & Redmine(もしくはRails系導入)
データベース設定のみ以下のように変更をします。

config/database.yml
#サーバにMySQLが入っていない場合developmentとtestをコメントアウトするか、
#developmentとtest使用する場合もデータベースを変更して以下の設定を使用する。
#TODO: usernameは、hoge@SQLServerNameを指定
production:
  adapter: sqlserver
  mode: DBLIB
  port: PORT #ポート明記
  timeout: 10 #timeout設定
  azure: true #azureであることを明記
  database: redmine
  host: SQLHOST
  username: hoge@SQLServerName
  password: "Password"

developmentとtestをコメントアウトしたので、withoutをする。

bundle install --without development test postgresql sqlite mysql2

後書

この設定に届くまで時間がかかりました。
以下を参照に悩みました。あとは、権限系の設定をすると思いますが、
Windowsマシンがないとできない模様。

Cannot connect to Azure using tiny_tds #90
Ruby on Rails4.2でMicrosoft Azure SQL Databaseに移行

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3