mac m1+homebrew 安装MySQL/MongoDB/Redis/Elasticsearch,并启动服务

本文详细介绍了在Mac M1上通过Homebrew分别安装MongoDB、MySQL、Redis和Elasticsearch的方法,包括启动停止服务的命令和使用步骤,省略了不必要的配置步骤。

这里基本都是参考官网了,仅当做个笔录

MongoDB

1. 使用brew安装

        警告⚠️    不要直接 brew install mongodb

        而是要执行下面两步。当然,执行之前还是要在终端设置代理。

brew tap mongodb/brew
brew install mongodb-community@5.0

        安装的路径记录下(mac M1版):

/opt/homebrew/Cellar/mongodb-community/5.0.2

2. 启停mongo服务

To have launchd start mongodb/brew/mongodb-community now and restart at login:

  brew services start mongodb/brew/mongodb-community

Or, if you don't want/need a background service you can just run:

  mongod --config /opt/homebrew/etc/mongod.conf

        在安装成功的最后,有一段提示语如上。

        就是告诉我们如何启动mongo服务的。两者的区别嘛,自己翻译吧

        但是我直接像下面这样写,服务也能启动:

brew services start mongodb-community
brew services stop mongodb-community

        以上就是一启一停

        还可以使用如下命令检验是否启动成功:

brew services list

        “You should see the service mongodb-community listed as started.”

 3. 开始使用mongodb

        输入以下指令

mongo

MySQL

1. 使用brew安装

brew install mysql

        网上写还需要在 bash_profile文件中配置路径,但是我发现省了这一步,也不影响啊

2. 启停服务

brew services start mysql
brew services stop mysql

3.  开始使用mysql

mysql -u root -p

        具体操作可参考我的另一篇文章 

Redis

1. 使用brew安装

brew install redis

        网上写还需要在 bash_profile文件中配置路径,但是我发现省了这一步,也不影响啊

2. 启停服务

brew services start redis
brew services stop redis

3.  开始使用redis

redis-cli

       

Elasticsearch

1.使用brew安装

这里是按照官网的标准和建议安装的。

见网上的文章,也有直接 brew install elasticsearch 这样安装的,但是,

我试了之后,报错。 可能是我mac m1系统的问题

brew tap elastic/tap
brew install elastic/tap/elasticsearch-full

2. 启停服务

To have launchd start elasticsearch now and restart at login:

brew services start/stop elasticsearch-full

Or, if you don't want/need a background service you can just run:

elasticsearch

3. 查看数据库安装信息

brew info elasticsearch

4. kibana

4.1 安装

brew tap elastic/tap
brew install elastic/tap/kibana-full

4.2 启停服务

brew services start/stop kibana-full

4.3 插件

我直接安装的Chrome浏览器插件,不需要修改kibana配置。直接安装插件就好,以下为插件地址

https://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm?hl=zh-CNhttps://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm?hl=zh-CN安装好插件后,直接点击就可以连接上Elasticsearch。

就这些吧,随时补充

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

young_kp

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值