Skip to content

Instantly share code, notes, and snippets.

@AK-10
Last active August 16, 2019 13:35
Show Gist options
  • Save AK-10/a6732a4909d936a20df40f8882fe7a45 to your computer and use it in GitHub Desktop.
Save AK-10/a6732a4909d936a20df40f8882fe7a45 to your computer and use it in GitHub Desktop.
isuconプロジェクトクローンからの流れ

大まかな流れ

  • git clone プロジェクト

  • dep のインストール

    • go自体にpathが通っているか確認
    • 通っていなければexport PATH=$HOME/local/go/bin:$HOME/go/bin:$PATH <- これとは限らないので臨機応変に
    • go get -u github.com/golang/dep/cmd/dep
  • gopathの設定

    • export GOPATH=/path/to/{プロジェクト名}/webapp/go
  • dep init

    • cd /path/to/{プロジェクト名}/webapp/go/src/{アプリ名}/ <- $GOPATH/src/ 以下じゃないとdep initできない
    • dep init
      • 注: echoがあるとなぜかできなかった(echoのバージョンの関係?). 一旦importされているものを消して, dep ensure すると良い
    • とりあえず dep ensure
  • buildする場合

    • go build -v {アプリ名}
  • redisのインストール

    • centos

      • sudo yum -y install epel-release
      • sudo yum install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
      • yum install redis --enablerepo=remi
      • sudo systemctl enable redis
      • sudo systemctl start redis
      • /etc/redis.conf をエディタで開く
      • 69行目のbind ... にPrivate IPを追加
      • 88行目のprotected-mode yesnoに変更(やらなくていいかも)
      • sudo systemctl restart redis
    • ubuntu

      • sudo apt-get update
      • sudo apt-get upgrade
      • sudo apt-get install redis-server
      • sudo systemctl enable redis-server.service
      • /etc/redis/redis.conf をエディタで開く
      • 69行目のbind ... にPrivate IPを追加
      • 88行目のprotected-mode yesnoに変更(やらなくていいかも)
      • sudo systemctl restart redis

reference

@AK-10
Copy link
Author

AK-10 commented Aug 16, 2019

TODO: GoModulesの調査

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment