注意:笔者使用的是 Apple Mac M1 进行开发工作的,因此以下安装的软件均使在 Mac M1 电脑环境下进行。

1、安装 Java JDK

jdk 8 :https://cdn.azul.com/zulu/bin/zulu8.72.0.17-ca-jdk8.0.382-macosx_aarch64.tar.gz

jdk 11:https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz

jdk 17:https://cdn.azul.com/zulu/bin/zulu17.44.15_1-ca-jdk17.0.8-macosx_aarch64.tar.gz

 1# 环境变量配置
 2JAVA_8_HOME=/Users/liew/Env/jdk8
 3JAVA_11_HOME=/Users/liew/Env/jdk11
 4JAVA_17_HOME=/Users/liew/Env/jdk17
 5
 6# 默认使用 jdk 11
 7PATH=$PATH:$JAVA_11_HOME/bin:
 8export PATH
 9export JAVA_HOME
10
11# 通过 java8、java11等切换 jdk版本
12alias java8='export JAVA_HOME=$JAVA_8_HOME'
13alias java11='export JAVA_HOME=$JAVA_11_HOME'
14alias java17='export JAVA_HOME=$JAVA_17_HOME'
15
16# 默认选择 jdk11
17java11

2、安装 IDEA

专业版https://download-cdn.jetbrains.com/idea/ideaIU-2023.2-aarch64.dmg

社区版:https://download-cdn.jetbrains.com/idea/ideaIC-2023.2-aarch64.dmg

3、安装 Maven 或 Gradle

Maven 3.8.3:https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz

配置本地仓库:<localRepository>/Users/liew/Env/maven-repo</localRepository>

1# 定义 maven 的安装路径
2MAVEN_HOME=/Users/liew/Env/apache-maven
3PATH=$PATH:$MAVEN_HOME/bin:
4export MAVEN_HOME

注意:Maven 3.8.3 要求 JDK 1.7 或者以上环境运行

Gradle 4.7 :https://downloads.gradle.org/distributions/gradle-4.7-bin.zip

 1# 定义 gradle 的安装路径
 2GRADLE_HOME=/Users/liew/Env/gradle
 3# 定义 gradle 包下载的仓库路径
 4GRADLE_USER_HOME=/Users/liew/Env/gradle-repo
 5GRADLE_OPTS=-Dgradle.user.home=/Users/liew/Env/gradle-repo
 6
 7PATH=$PATH:$GRADLE_HOME/bin:
 8
 9export GRADLE_HOME
10export GRADLE_OPTS
11export GRADLE_USER_HOME

4、安装 Redis

下载地址:https://codeload.github.com/redis/redis/tar.gz/refs/tags/6.2.7

 1# 编译 redis源代码
 2cd /redis安装目录/src
 3sudo make test
 4sudo make install
 5
 6# 配置环境变量
 7REDIS_HOME=/Users/liew/Env/redis-server
 8PATH=$PATH:$REDIS_HOME/bin:
 9
10# 启动 redis
11./redis安装目录/src/redis-server

安装成功后如图所示:

image-20230810171034091

5、安装 MySQL

下载地址:https://cdn.mysql.com//Downloads/MySQL-8.1/mysql-8.1.0-macos13-arm64.tar.gz

1# mysql安装路径
2MYSQL_HOME=/Users/liew/Env/mysql
3#配置路径
4PATH=$PATH:$MYSQL_HOME/bin:
5
6# 重命名mysql命令,快捷启动
7alias mysql-stop='sudo mysqladmin -uroot -p12345678 shutdown'
8alias mysql-start='mysqld'

6、安装 Scala

下载地址:https://downloads.lightbend.com/scala/2.11.12/scala-2.11.12.tgz

1# scala 安装目录
2SCALA_HOME=/Users/liew/Env/scala
3PATH=$PATH:$SCALA_HOME/bin:

7、安装 Whistlejs

详细安装流程参考:whistle安装流程与抓包使用

8、安装 Zookeeper

下载地址:https://dlcdn.apache.org/zookeeper/zookeeper-3.8.2/apache-zookeeper-3.8.2-bin.tar.gz

1# zookeeper 安装目录
2ZK_HOME=/Users/liew/Env/apache-zookeeper
3PATH=$PATH:$ZK_HOME/bin:
4
5# 自定义 zookeeper 服务别名
6alias zk-start='zkServer.sh start'
7alias zk-stop='zkServer.sh stop'

9、安装 Clickhouse

下载地址:

1# clickhouse 安装路径
2CK_HOME=/Users/liew/Env/clickhouse
3PATH=$PATH:$ZK_HOME/bin:$CK_HOME:
4
5# 自定义别名,快捷启动服务
6alias ck-start='cd /Users/liew/Env/clickhouse && ./clickhouse-server --config-file=/Users/liew/Env/clickhouse/server/config.xml'

10、安装 Consul

下载地址:https://releases.hashicorp.com/consul/1.16.1/consul_1.16.1_darwin_arm64.zip

1# consul 安装路径
2CONSUL_HOME=/Users/liew/Env/consul
3PATH=$PATH:$CONSUL_HOME:

11、安装 Etcd

下载地址:https://objects.githubusercontent.com/github-production-release-asset-2e65be/11225014/b992e701-5bcf-4624-8726-f9cf63d8e3b1?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230810%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230810T092802Z&X-Amz-Expires=300&X-Amz-Signature=22b79fdb715007c8f822815810eb16b1eed4531e63864129ece4dcfbd1147841&X-Amz-SignedHeaders=host&actor_id=23130466&key_id=0&repo_id=11225014&response-content-disposition=attachment%3B%20filename%3Detcd-v3.5.8-darwin-arm64.zip&response-content-type=application%2Foctet-stream

1# etcd 安装路径
2ETCD_HOME=/Users/liew/Env/etcd
3ETCD_UNSUPPORTED_ARCH=arm64
4
5# 配置路径
6PATH=$PATH:$ETCD_HOME/bin:
7export ETCD_UNSUPPORTED_ARCH

12、安装 Go SDK

下载地址:https://dl.google.com/go/go1.19.darwin-arm64.tar.gz

1# Go sdk 安装位置
2GOPATH=/Users/liew/Env/go
3PATH=$PATH:$GOPATH/bin:

13、安装 Grafana

详细安装流程查看:Mac M1编译Grafana源码并安装使用

14、安装 NodeJs

下载地址:https://nodejs.org/dist/v18.17.1/node-v18.17.1.pkg

 1# nodeJs 安装路径
 2NODE_HOME=/Users/liew/Env/node
 3PATH=$PATH:$NODE_HOME/bin:
 4
 5NPM_HOME=/Users/liew/Env/npm-repo/node_package/node_global
 6PATH=$PATH:$NPM_HOME/bin:
 7
 8# npm 仓库设置
 9npm config list
10cache = "/Users/liew/Env/npm-repo/node_package/node_cache"
11prefix = "/Users/liew/Env/npm-repo/node_package/node_global"
12registry = "https://mirrors.tencent.com/npm/"