Mac環境搭建記錄


1.jdk安裝

下載jdk-8u121-macosx-x64.dmg,直接安裝。


2.item安裝

直接下載,並運行。


3.Homebrew安裝

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"  

回車,輸入密碼(此時會先下載Command Line Tools (macOS Sierra version 10.12) for Xcode,時間久,30分左右視網絡情況)。

然後第二次需要輸入密碼,然後安裝完成


4.idea

下載,並直接安裝。


5.git

Homebrew安裝過程中安裝了Xcode,git已經支持了,不需要再次安裝。

git相關配置(ssh key生成)參考:http://blog.163.com/www_iloveyou_com/blog/static/2116583722013111113954760/ 


6.安裝wget

brew install wget 

過程中下載依賴包,可能下載失敗自動切換數次鏡像地址。


7.oh my zsh安裝

wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh 

安裝完成退出並重啓item。


8.mysql

brew安裝方式詳見:http://blog.csdn.net/gongzi2311/article/details/68068135

(並不推薦這種方式)

安裝文件安裝,下載地址:https://dev.mysql.com/downloads/file/?id=469584 

我這裏下載的dmg文件,直接安裝成功後注意記錄彈出框裏面提示的默認root初始密碼。然後需要到"系統偏好設置"中的最下方找到mysql,單擊然後啓動服務,並設置開機自啓動。此時連接工具並不能成功連接mysql,必須重置默認的密碼,否則不能連接。

編輯.bash_profile 文件,添加環境變量配置:

export PATH=$PATH:/usr/local/mysql/bin; 

登錄msyql:mysql -u root -p 

修改密碼:mysql>SET PASSWORD = PASSWORD('123456') 

刷新:mysql>flush privileges;



9.zookeeper

解壓,修改conf下zoo_sample.cfg爲zoo.cfg,並編輯數據和日誌目錄

dataDir=~/Work/zookeeper-3.4.9/data
dataLogDir=~/Work/zookeeper-3.4.9/log

bin目錄下啓動

./zkServer.sh start


10.elasticsearch

參考:http://blog.csdn.net/gongzi2311/article/details/51699798


11.mongodb

解壓tar包,bin同級下創建db、logs、conf文件夾。
conf文件夾下建立配置文件mongodb.conf,內容如下

dbpath=/Users/dongchao/Work/mongodb-3.4.3/db
logpath=/Users/dongchao/Work/mongodb-3.4.3/logs/mongodb.log
logappend=true
fork=true
port=27017

啓動:
進入bin目錄執行:./mongod -f ../conf/mongodb.conf & 

創建庫及用戶:

./mongo連接庫,

>use assets 

>db.createUser({user:'assets',pwd:'assets',roles:[]})   進行創建用戶


12.redis

首先安裝依賴包gcc

brew install gcc


方式:redis源碼安裝
用戶:root

安裝目錄:/usr/local/redis


過程:

root創建 /usr/local/redis目錄,並授權 chmod a+rwx redis

解壓,進入src目錄

make PREFIX=/usr/local/redis install

安裝完成可make test一下。


創建/usr/local/redis/conf目錄,拷貝redis配置文件到該目錄下。創建log目錄用於存儲日誌。

 cp redis.conf /usr/local/redis/conf

修改部分配置

daemonize=yes

logfile "/usr/local/redis/log/redis.log"


最後啓動,./redis-server ../conf/redis.conf

參考:http://www.tuicool.com/articles/nM73Enr 



第二部分--安裝其他包

1.pycurl

sudo pip install pycurl -i https://pypi.tuna.tsinghua.edu.cn/simple --user


第三部分--輔助部分

1.設置vim語法高亮

新增~/.vimrc文件

文件內容如下

set ai                  " auto indenting
set history=100         " keep 100 lines of history
set ruler               " show the cursor position
syntax on               " syntax highlighting
set hlsearch            " highlight the last searched term
filetype plugin on      " use the file type plugins

" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章