官网地址 https://nsq.io/
下载地址 https://nsq.io/deployment/installing.html
下载 nsq-1.2.0.linux-amd64.go1.12.9.tar.gz
改名并且解压到/usr/local
tar -zxvf nsq-1.2.0.linux-amd64.go1.12.9.tar.gz -C /usr/local/
cd /usr/local
mv nsq-1.2.0.linux-amd64.go1.12.9/ nsq-1.2
配置开机启动
vi /usr/lib/systemd/system/nsqlookupd.service
[Unit]
Description=nsqlookup daemon Service
After=network.target remote-fs.target nss-lookup.target
[Service]
#Type=
PrivateTmp=yes
ExecStart=/usr/local/nsq-1.2/bin/nsqlookupd
Restart=on-abort
[Install]
WantedBy=multi-user.target
vi /usr/lib/systemd/system/nsqd.service
[Unit]
Description=nsqd daemon Service
After=network.target remote-fs.target nss-lookup.target
[Service]
#Type=
PrivateTmp=yes
ExecStart=/usr/local/nsq-1.2/bin/nsqd --lookupd-tcp-address=0.0.0.0:4160 --tcp-address=0.0.0.0:4150 --http-address=0.0.0.0:4151 --broadcast-address=127.0.0.1
#修改broadcast-address
Restart=on-abort
[Install]
WantedBy=multi-user.target
vi /usr/lib/systemd/system/nsqadmin.service
[Unit]
Description=nsqadmin daemon Service
After=network.target remote-fs.target nss-lookup.target
[Service]
#Type=
PrivateTmp=yes
ExecStart=/usr/local/nsq-1.2/bin/nsqadmin --lookupd-http-address=127.0.0.1:4161
Restart=on-abort
[Install]
WantedBy=multi-user.target
- 启动 systemcle start nsqd systemcle start nsqadmin systemcle start nsqlookupd
- 壹点资源网