mac服务

文章目录
  1. 1. brew
    1. 1.1. brew 常用命令
    2. 1.2. brew 清除locks
    3. 1.3. brew 安装node低版本
    4. 1.4. brew 安装nginx
    5. 1.5. brew redis
    6. 1.6. brew 安装 activemq
    7. 1.7. brew 安装 rabbitmq
    8. 1.8. brew 安装 mongodb
  2. 2. 服务启动
    1. 2.1. nacos 启动命令
    2. 2.2. elasticsearch-head 安装和启动 -elasticsearch GUI客户端
    3. 2.3. RocketMQ

brew

brew 常用命令

# brew 搜索软件
$ brew search nginx

# brew 安装软件
$ brew install nginx

# brew 卸载软件
$ brew uninstall nginx

# brew 升级
$ sudo brew update

# 查看安装信息
$ sudo brew info nginx

# 查看已安装软件
$ brew list

brew 清除locks

brew install 如果没有取消自动更新,每次都要更新好久,如果这时候意外按下control+z

再次执行 brew install 会提示

Error: Another active Homebrew update process is already in progress.Please wait for it to finish or terminate it to continue.

解决办法:

rm -rf /usr/local/var/homebrew/locks

brew 安装node低版本

使用使用 brew install node 默认是最高版本。

  1. 需要先执行 brew unlink node 来解绑 node
  2. 安装需要的版本,例如 brew install node@10
  3. 执行 brew link node@10,这一步可能会报错,按照提示命令执行就可以
  4. 执行 brew link –overwrite –force node@10
  5. node -v 查看版本是否是想要的低版本

brew 安装nginx

# 安装
$ sudo brew install nginx

# 启动
$ sudo brew services start nginx

# 重启
$ sudo brew services restart nginx

# 停止
$ sudo brew services stop nginx

# 查看
$ cat /usr/local/etc/nginx/nignx.conf

brew redis

# 启动
$ redis-server /usr/local/etc/redis-6379.conf

# 停止
$ redis-cli -p 6379 shutdown

brew 安装 activemq

# 安装
$ brew install activemq

# 查看版本
$ activemq —version

# 启动
$ activemq start

# 地址
# http://localhost:8161 admin admin

brew 安装 rabbitmq

# 安装
$ brew install rabbitmq

# 启动
$ brew services start rabbitmq

# 地址
# http://localhost:15672 guest guest

brew 安装 mongodb

参考:https://blog.csdn.net/ligh_sqh/article/details/81112428

# mongo

# 启动 mongodb 客户端
$ cd ~/software/adminmongo
$ npm start

# 客户端地址 http://localhost:1234

服务启动

nacos 启动命令

$ sh ~/software/nacos/bin/startup.sh -m standalone

elasticsearch-head 安装和启动 -elasticsearch GUI客户端

$ git clone git://github.com/mobz/elasticsearch-head.git
$ cd elasticsearch-head
$ npm install
$ npm run start

# http://localhost:9100

RocketMQ

https://rocketmq.apache.org/docs/quick-start/