ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

后端mac搭建环境

2020-12-15 15:29:59  阅读:275  来源: 互联网

标签:15 后端 -- nginx mac elasticsearch usr local 搭建


Homebrew

Homebrew是mac的包管理工具,官网,在mac上打开终端,输入以下命令安装

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

安装失败使用以下命令

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

 参考:https://blog.csdn.net/zouyunchong/article/details/106444873

 

iTerm2

可以直接去官网下载安装包安装即可使用

OH MY ZSH

iterm命令行中输入以下命令

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

JAVA7&JAVA8

去以下地址下载JAVA7和JAVA8的安装包,链接如下

jdk-8u60-macosx-x64.dmg

jdk-7u79-macosx-x64.dmg

安装完成后,执行以下命令

echo "alias setJdk7='export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)'" >> ~/.zshrc 
echo "alias setJdk8='export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)'" >> ~/.zshrc 
echo "export JAVA_HOME=`/usr/libexec/java_home -v 1.7`" >> ~/.zshrc
source ~/.zshrc

MAVEN

 brew install maven

验证

$ mvn -v
Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; 2015-03-14T04:10:27+08:00) Maven home: /usr/local/Cellar/maven/3.3.1/libexec
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac"

配置

~/.m2目录下创建settings.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups></pluginGroups> <proxies></proxies>
<servers> <server>
<id>terminus</id> <username>REPO用户名</username> <password>REPO密码</password>
</server> </servers> <mirrors></mirrors> <profiles>
<profile> <id>terminus</id> <repositories>
<repository>
<id>terminus</id> <url>http://repo.terminus.io/content/groups/public/</url> <releases>
<enabled>true</enabled> </releases>
<snapshots>
<enabled>true</enabled> </snapshots>
</repository> </repositories>
</profile> </profiles>
<activeProfiles> <activeProfile>terminus</activeProfile>
</activeProfiles> </settings>

Nginx

安装

brew install nginx

验证

$ nginx -V
nginx version: nginx/1.6.3
built by clang 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/Cellar/nginx/1.6.3 --with-http_ssl_module --with-pcre --with-ipv6 --sbin-pat h=/usr/local/Cellar/nginx/1.6.3/bin/nginx --with-cc-opt='-I/usr/local/Cellar/pcre/8.36/include -I/usr/local/Cellar/opens sl/1.0.2a-1/include' --with-ld-opt='-L/usr/local/Cellar/pcre/8.36/lib -L/usr/local/Cellar/openssl/1.0.2a-1/lib' --conf-p ath=/usr/local/etc/nginx/nginx.conf --pid-path=/usr/local/var/run/nginx.pid --lock-path=/usr/local/var/run/nginx.lock -- http-client-body-temp-path=/usr/local/var/run/nginx/client_body_temp --http-proxy-temp-path=/usr/local/var/run/nginx/pro xy_temp --http-fastcgi-temp-path=/usr/local/var/run/nginx/fastcgi_temp --http-uwsgi-temp-path=/usr/local/var/run/nginx/u wsgi_temp --http-scgi-temp-path=/usr/local/var/run/nginx/scgi_temp --http-log-path=/usr/local/var/log/nginx/access.log - -error-log-path=/usr/local/var/log/nginx/error.log --with-http_gzip_static_module

修改配置文件

#user nobody;
worker_processes 2;
#error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on; #tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65; gzip on;
include servers/*.conf; }

Redis

安装

brew install redis

验证

 $ redis-server -v
Redis server v=2.8.3 sha=00000000:0 malloc=libc bits=64 build=e836d8ad888e21a1

Mysql

安装

brew install mysql

验证

 $ mysql -V
mysql Ver 14.14 Distrib 5.6.15, for osx10.9 (x86_64) using EditLine wrapper

Elasticsearch

安装

下载链接:https://pan.baidu.com/s/1eQNPiEY

下载后解压,将解压后的文件夹放到想安装的目录

验证

打开Iterm2执行以下命令

# 跳转到解压目录(如 /home/xxx/download) $ cd [ES_HOME]
$ bin/elasticsearch

看到以下类似输出

[2016-02-20 15:14:44,271][INFO ][node 1/2016-01-27T13:32:39Z]
[2016-02-20 15:14:44,272][INFO ][node [2016-02-20 15:14:44,783][INFO ][plugins
ugins [elasticsearch-analysis-jieba], sites [] [2016-02-20 15:14:44,808][INFO ][env
] [Bennet du Paris] version[2.2.0], pid[71066], build[8ff36d ] [Bennet du Paris] initializing ...
] [Bennet du Paris] modules [lang-expression, lang-groovy], pl
] [Bennet du Paris] using [1] data paths, mounts [[/ (/dev/dis k0s2)]], net usable_space [68.6gb], net total_space [232.9gb], spins? [unknown], types [hfs]
[2016-02-20 15:14:44,808][INFO ][env ] [Bennet du Paris] heap size [989.8mb], compressed ordinary o bject pointers [true]
main dict load finished, time elapsed 885 ms
initialize user dictionary:/usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba
loading dict /usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba/sougou.dict
user dict /usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba/sougou.dict load finished, tot words:23203 0, time elapsed:740ms
loading dict /usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba/user.dict
user dict /usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba/user.dict load finished, tot words:3, time elapsed:1ms
initialize user dictionary:/usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba
initialize user dictionary:/usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba
initialize user dictionary:/usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba
[2016-02-20 15:14:48,213][INFO ][node
[2016-02-20 15:14:48,213][INFO ][node
[2016-02-20 15:14:48,320][INFO ][transport
dresses {[fe80::1]:9300}, {[::1]:9300}, {127.0.0.1:9300} [2016-02-20 15:14:48,326][INFO ][discovery
] [Bennet du Paris] initialized
] [Bennet du Paris] starting ...
] [Bennet du Paris] publish_address {127.0.0.1:9300}, bound_ad
] [Bennet du Paris] elasticsearch/0v749OKeRuKGsYVCrH201w
[2016-02-20 15:14:51,357][INFO ][cluster.service
YVCrH201w}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)
[2016-02-20 15:14:51,371][INFO ][http
dresses {[fe80::1]:9200}, {[::1]:9200}, {127.0.0.1:9200} [2016-02-20 15:14:51,371][INFO ][node
[2016-02-20 15:14:51,404][INFO ][gateway
] [Bennet du Paris] new_master {Bennet du Paris}{0v749OKeRuKGs ] [Bennet du Paris] publish_address {127.0.0.1:9200}, bound_ad
] [Bennet du Paris] started
] [Bennet du P

安装应用

Sequel Pro

Sequel Pro 是一款mysql的图形管理工具,可在官网下载安装

 

标签:15,后端,--,nginx,mac,elasticsearch,usr,local,搭建
来源: https://blog.csdn.net/xiefusi/article/details/100559316

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有