1)一般启动方式
启动:[[email protected] ~]# /usr/local/zabbix-3.2.6/sbin/zabbix_server
[[email protected] core5]# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1221/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1079/master
tcp 0 0 0.0.0.0:8027 0.0.0.0:* LISTEN 35705/nginx
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 35530/php-fpm
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 10391/mysqld
tcp 0 0 :::22 :::* LISTEN 1221/sshd
tcp 0 0 ::1:25 :::* LISTEN 1079/master
udp 0 0 0.0.0.0:68 0.0.0.0:* 898/dhclient
[[email protected] core5]# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1221/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1079/master
tcp 0 0 0.0.0.0:8027 0.0.0.0:* LISTEN 35705/nginx
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 101277/zabbix_serve
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 35530/php-fpm
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 10391/mysqld
tcp 0 0 :::22 :::* LISTEN 1221/sshd
tcp 0 0 ::1:25 :::* LISTEN 1079/master
udp 0 0 0.0.0.0:68 0.0.0.0:* 898/dhclient
关闭:[[email protected] ~]# pkill -9 zabbix
此时,再观察端口的变化。
2)利用脚本启动方式
[[email protected] ~]# find / -name zabbix_server /usr/local/src/zabbix-3.2.6/src/zabbix_server /usr/local/src/zabbix-3.2.6/src/zabbix_server/zabbix_server /usr/local/src/zabbix-3.2.6/misc/init.d/tru64/zabbix_server /usr/local/src/zabbix-3.2.6/misc/init.d/freebsd/zabbix_server /usr/local/src/zabbix-3.2.6/misc/init.d/fedora/core5/zabbix_server /usr/local/src/zabbix-3.2.6/misc/init.d/fedora/core/zabbix_server /usr/local/src/zabbix-3.2.6/misc/init.d/suse/9.3/zabbix_server /usr/local/src/zabbix-3.2.6/misc/init.d/suse/9.1/zabbix_server /usr/local/src/zabbix-3.2.6/misc/init.d/suse/9.2/zabbix_server /usr/local/zabbix-3.2.6/sbin/zabbix_server
[[email protected] ~]# cd /usr/local/src/zabbix-3.2.6/misc/init.d/fedora/core5/
[[email protected] core5]# ls
zabbix_agentd zabbix_server
[[email protected] core5]#vim zabbix_server
ZABBIX_BIN="/usr/local/zabbix-3.2.6/sbin/zabbix_server" 修改安装路径。
[[email protected] core5]# ./zabbix_server start
正在启动 Zabbix Server: [确定]
[[email protected] core5]# ./zabbix_server stop
停止 Zabbix Server: [确定]
[[email protected] core5]# ./zabbix_server restart
停止 Zabbix Server: [失败]
正在启动 Zabbix Server: [确定]
为了符合常规操作习惯,做一下调整:
[[email protected] core5]# cp zabbix_server /etc/init.d/zabbix_server
[[email protected] core5]# ll
总用量 8
-rwxr-xr-x. 1 1000 1000 1355 5月 5 22:50 zabbix_agentd
-rwxr-xr-x. 1 1000 1000 1415 9月 27 22:39 zabbix_server
[[email protected] core5]# cd -
/etc/init.d
[[email protected] init.d]# ls
auditd functions ip6tables killall mysqld netfs postfix restorecond sandbox single udev-post
crond halt iptables messagebus netconsole network rdisc rsyslog saslauthd sshd zabbix_server
[[email protected] init.d]# /etc/init.d/zabbix_server restart
停止 Zabbix Server: [确定]
正在启动 Zabbix Server: [确定]
[[email protected] init.d]#
3)两种启动管理方式的比较
第一种启动方式每次要跟上绝对路径,感觉比较麻烦(可以尝试用软链接来启动),关闭要用pkill 来执行,如果需要重启zabbix服务,这种方式就比较繁琐
第二种是我比较喜欢的方式,每次启动关闭,重启都比较方便,调整后,也比较符合常规操作习惯。推荐~