汽车维修招聘,昆明学院教务管理系统,安全生产事故案例
目前官网不能直接下载,在网上找到1.8.0版本安装包下载到本地。
[root@iz2zei2y693gtrgwlibzlwz java]# ls jdk1.8.0_191 jdk-8u191-linux-x64.tar.gz
在文件中/etc/profile追加配置:
export java_home=/usr/local/java/jdk1.8.0_191 export classpath=.:$java_home/jre/lib/rt.jar:$java_home/lib/dt.jar:$java_home/lib/tools.jar export path=$path:$java_home/bin
使配置生效
[root@iz2zei2y693gtrgwlibzlwz java]# source /etc/profile
[root@iz2zei2y693gtrgwlibzlwz java]# java -version java version "1.8.0_191" java(tm) se runtime environment (build 1.8.0_191-b12) java hotspot(tm) 64-bit server vm (build 25.191-b12, mixed mode)
tar –zxvf zookeeper-3.4.10.tar.gz
# the number of milliseconds of each tick
ticktime=2000
# the number of ticks that the initial
# synchronization phase can take
initlimit=10
# the number of ticks that can pass between
# sending a request and getting an acknowledgement
synclimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
datadir=/usr/local/zookeeper/zookeeper-3.4.10/data
datalogdir=/usr/local/zookeeper/zookeeper-3.4.10/logs
# the port at which the clients will connect
clientport=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxclientcnxns=60
#
# be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
#
#
# the number of snapshots to retain in datadir
#autopurge.snapretaincount=3
# purge task interval in hours
# set to "0" to disable auto purge feature
#autopurge.purgeinterval=1
#2888,3888 are election port
server.1=39.**.**.**:2888:3888 #改成自己ip
其中,2888端口号是服务之间通信的端口,而3888是;zookeeper与其他应用程序通信的端口.
创建datadir参数指定的目录(这里指的是“/usr/local/zookeeper/zookeeper-3.4.10/data”),并在目录下创建文件,命名为“myid”。
在对应的ip的机器上输入对应的编号。如在zookeeper上,“myid”文件内容就是1。由于本次只在单点上进行安装配置,所以只有一个server.1。若还有其他服务器,比如地址为192.168.1.102,则在zoo.cfg文件中还需加入server.2=192.168.1.102:2888:3888。那么myid文件在192.168.1.102服务器上的内容就是2。至此,如果是多服务器配置,就需要将zookeeper-3.4.3目录拷贝到其他服务器,然后按照上述的方法修改myid。
在profile文件尾追加:
export path=$path:/usr/local/zookeeper/zookeeper-3.4.10/bin
安装完毕!
zkserver.sh start
输入jps命令查看进程
1573 quorumpeermain 1654 jps
其中,quorumpeermain是zookeeper进程,启动正常。
查看状态:zkserver.sh status
- jmx enabled by default using config: /usr/local/zookeeper-3.4.6/bin/../conf/zoo.cfg mode: standalone
启动客户端脚本:zkcli.sh -server ip:2181
停止zookeeper进程:zkserver.sh stop
下载地址:https://mirrors.cnnic.cn/apache/kafka
wget https://mirrors.cnnic.cn/apache/kafka/2.1.0/kafka_2.11-2.1.0.tgz
解压
tar -zxvf kafka_2.12-1.1.0.tgz
在/etc/profile文件中追加配置:
export kafka_home=/usr/local/kafka/kafka_2.11-2.1.0 export path=$kafka_home/bin:$path
使配置生效
[root@iz2zei2y693gtrgwlibzlwz kafka]# source /etc/profile
[root@iz2zei2y693gtrgwlibzlwz kafka]# echo $kafka_home /usr/local/kafka/kafka_2.11-2.1.0
broker.id=0 listeners=plaintext://:9092 advertised.listeners=plaintext://你的ip:9092 zookeeper.connect=localhost:2181
[root@iz2zei2y693gtrgwlibzlwz config]# kafka-server-start.sh -daemon $kafka_home/config/server.properties
[root@iz2zei2y693gtrgwlibzlwz config]# jps 24177 quorumpeermain 899 kafka 8506 jps
先关闭kafka,在关闭zookeeper
kafka-server-stop.sh
zookeeper-server-stop.sh
查看服务是否已关闭
[root@localhost ~]# jps 15462 jps
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Net Core Web Api项目与在NginX下发布的方法
asp.net core3.1 引用的元包dll版本兼容性问题解决方案
IdentityServer4实现.Net Core API接口权限认证(快速入门)
ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径的实现
网友评论