install.zh_CN - adyliu/jafka GitHub Wiki

#ๅฎ‰่ฃ…ๆŒ‡ๅ— ๆ–‡ๆกฃ>>ๅฎ‰่ฃ…ๆŒ‡ๅ—


ไธ‹่ฝฝๆœๅŠกๅŒ…

ไธ‹่ฝฝๅœฐๅ€๏ผšhttps://github.com/adyliu/jafka/releases

็›ฎๅฝ•็ป“ๆž„:

jafka-3.0.6
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ VERSION
โ”œโ”€โ”€ bin
โ”‚   โ”œโ”€โ”€ admin-console.sh
โ”‚   โ”œโ”€โ”€ consumer-console.sh
โ”‚   โ”œโ”€โ”€ dumper.sh
โ”‚   โ”œโ”€โ”€ env.sh
โ”‚   โ”œโ”€โ”€ getoffset-console.sh
โ”‚   โ”œโ”€โ”€ jafka-linux-x86-32
โ”‚   โ”œโ”€โ”€ jafka-linux-x86-64
โ”‚   โ”œโ”€โ”€ jafka-macosx-universal-32
โ”‚   โ”œโ”€โ”€ jafka-macosx-universal-64
โ”‚   โ”œโ”€โ”€ jafka-windows-x86-32.exe
โ”‚   โ”œโ”€โ”€ jafka.conf
โ”‚   โ”œโ”€โ”€ optional
โ”‚   โ”‚   โ”œโ”€โ”€ libwrapper-linux-x86-32.so
โ”‚   โ”‚   โ”œโ”€โ”€ libwrapper-linux-x86-64.so
โ”‚   โ”‚   โ”œโ”€โ”€ libwrapper-macosx-universal-32.jnilib
โ”‚   โ”‚   โ”œโ”€โ”€ libwrapper-macosx-universal-64.jnilib
โ”‚   โ”‚   โ”œโ”€โ”€ wrapper-windows-x86-32.dll
โ”‚   โ”‚   โ””โ”€โ”€ wrapper.jar
โ”‚   โ”œโ”€โ”€ producer-console.sh
โ”‚   โ”œโ”€โ”€ run.sh
โ”‚   โ”œโ”€โ”€ server.sh
โ”‚   โ”œโ”€โ”€ simple-consumer-console.sh
โ”‚   โ””โ”€โ”€ zookeeper-server.sh
โ”œโ”€โ”€ conf
โ”‚   โ”œโ”€โ”€ log4j.properties.sample
โ”‚   โ”œโ”€โ”€ server.properties.sample
โ”‚   โ””โ”€โ”€ zookeeper.properties
โ”œโ”€โ”€ lib
โ”‚   โ”œโ”€โ”€ jackson-annotations-2.9.0.jar
โ”‚   โ”œโ”€โ”€ jackson-core-2.9.8.jar
โ”‚   โ”œโ”€โ”€ jackson-databind-2.9.8.jar
โ”‚   โ”œโ”€โ”€ jafka-3.0.6.jar
โ”‚   โ”œโ”€โ”€ jopt-simple-5.0.4.jar
โ”‚   โ”œโ”€โ”€ log4j-3.6.07.jar
โ”‚   โ”œโ”€โ”€ netty-all-4.1.36.Final.jar
โ”‚   โ”œโ”€โ”€ optional
โ”‚   โ”‚   โ””โ”€โ”€ mx4j-tools-3.0.1.jar
โ”‚   โ”œโ”€โ”€ slf4j-api-1.7.26.jar
โ”‚   โ”œโ”€โ”€ slf4j-log4j12-1.7.26.jar
โ”‚   โ”œโ”€โ”€ zkclient-2.1.2.jar
โ”‚   โ””โ”€โ”€ zookeeper-3.4.9.jar
โ””โ”€โ”€ logs

ๅ…ถไธญ bin ็›ฎๅฝ•ๅญ˜ๆ”พๅฏๅŠจ่„šๆœฌ๏ผŒconf ็›ฎๅฝ•ๅญ˜ๆ”พ้…็ฝฎๆ–‡ไปถ๏ผŒdata ็›ฎๅฝ•ๅญ˜ๆ”พๆ•ฐๆฎ๏ผŒlib ็›ฎๅฝ•ๅญ˜ๆ”พไพ่ต–ๅบ“๏ผŒlogs ็›ฎๅฝ•ๅญ˜ๆ”พๆ—ฅๅฟ—๏ผŒVERSION ๆ–‡ไปถๅญ˜ๆ”พ็‰ˆๆœฌไฟกๆฏใ€‚

่ฟ่กŒๆœๅŠก

ๆ‰ฉๅฑ•ๅŒ…ไธญๅชๅŒ…ๅซไบ†ไปฅไธ‹ Linux/Windows ไธค็งๅนณๅฐ๏ผŒๅ…ถๅฎƒๅนณๅฐๅฏไปฅๅ‚่€ƒJava Service Wrapper,ๅŸบๆœฌ็ฑปไผผใ€‚

ๅœจ่ฟ่กŒไน‹ๅ‰๏ผŒๅปบ่ฎฎๅฐ† jafka.conf ไธญๅพ— JAFKA_HOME ็Žฏๅขƒๅ˜้‡ไฟฎๆ”นไฝ็ปๅฏน่ทฏๅพ„๏ผŒๅ‡ๅฐ‘ไธๅฟ…่ฆ็š„้บป็ƒฆใ€‚ไพ‹ๅฆ‚๏ผš

set.JAFKA_HOME=/opt/apps/jafka-3.6.0

ๆˆ–่€…

set.JAFKA_HOME=C:\jafka-3.6.0

Linux x86_64

[adyliu@adyliu-pc bin]$ ./run.sh
Usage: ./run.sh [ console | start | stop | restart | condrestart | status | install | remove | dump ]

Commands:
  console      Launch in the current console.
  start        Start in the background as a daemon process.
  stop         Stop if running as a daemon or in another console.
  restart      Stop if running and then start.
  condrestart  Restart only if already running.
  status       Query the current status.
  install      Install to start automatically when system boots.
  remove       Uninstall.
  dump         Request a Java thread dump if running.

ไปฅๅ‘ฝไปค่กŒๆ–นๅผ่ฟ่กŒๅช้œ€่ฆๅœจไปปไฝ•็›ฎๅฝ•ไธ‹ๆ‰ง่กŒไธ‹้ขๅ‘ฝไปคๅณๅฏ

./run.sh console

ไปฅๅŽๅฐๆœๅŠกๆ–นๅผ่ฟ่กŒ๏ผŒๅช้œ€่ฆๆ‰ง่กŒ

./run.sh start

้šๆ—ถ้ƒฝๅฏไปฅๆŸฅ็œ‹ๆœๅŠก็Šถๆ€๏ผŒๅŒ…ๆ‹ฌๆฒกๆœ‰่ฟ่กŒๆˆ–่€…่ฟ่กŒๅผ‚ๅธธ

./run.sh status

ๅœๆญขๆญฃๅœจ่ฟ่กŒ็š„ๆœๅŠก

./run.sh stop

Linux x86_32

32 ไฝ็š„ Linux ้œ€่ฆๅฐ† run.sh ไธญ็š„

#WRAPPER_CMD="./jafka"
WRAPPER_CMD="./jafka64"

ๆ›ฟๆขๆˆ

WRAPPER_CMD="./jafka"
#WRAPPER_CMD="./jafka64"

ๅณๅฏใ€‚ไนŸๅฐฑๆ˜ฏๆƒณๆ‰ง่กŒๅพ—ๅ‘ฝไปคๆขๆˆ 32 ไฝ็š„ไบŒ่ฟ›ๅˆถใ€‚

่ฟ่กŒๅ‘ฝไปคๅ’Œ Linux x86_64 ็›ธๅŒใ€‚

Windows x86_32/x86_64

Windows ็›ดๆŽฅๅŒๅ‡ป jafka.exe ๅณๅฏไปฅๅ‘ฝไปค่กŒๆ–นๅผ่ฟ่กŒใ€‚

ๅฎŒๆ•ดๅธฎๅŠฉ

jafka -?

ๅฎ‰่ฃ…ๆˆๆœๅŠก๏ผš

jafka -i jafka.conf

่ฟ่กŒๆœๅŠก๏ผš

jafka -t

ๅœๆญขๆœๅŠก๏ผš

jafka -p

ๅฎขๆˆท็ซฏไพ่ต–

Maven ไพ่ต–

<dependency>
  <groupId>com.sohu.jafka</groupId>
  <artifactId>jafka</artifactId>
  <version>3.6.0</version>
</dependency>

Maven ไธญๅคฎไป“ๅบ“ๅœฐๅ€: https://repo1.maven.org/maven2/io/jafka/jafka/

ๅ…ถๅฎƒ็”จๆณ•

ๅฎขๆˆท็ซฏไพ่ต–ๅŒ…


ๆบ็ ๅฎ‰่ฃ…

ๅฆ‚ๆžœๆ˜ฏๆบ็ ๅฎ‰่ฃ…๏ผŒๅฏ้‡‡็”จไธ‹้ข็š„ๆญฅ้ชคใ€‚๏ผˆ้€‚็”จไบŽ 1.1+ ็‰ˆๆœฌ๏ผ‰

###1. ไธ‹่ฝฝๆบไปฃ็ 

git clone https://[email protected]/adyliu/jafka.git

ๆˆ–่€…

wget -O jafka.zip https://github.com/adyliu/jafka/zipball/master
unzip jafka.zip

###2. ็ผ–่ฏ‘

mvn clean package assembly:single -Dmaven.test.skip=true

ๆˆ–่€…่ฟ่กŒไธ‹ๅ•ๅ…ƒๆต‹่ฏ•

mvn clean package assembly:single

###3. ๅฎ‰่ฃ…

็Žฐๅœจๅœจ target/็›ฎๅฝ•ไธ‹ๅฐฑๅพ—ๅˆฐไบ†ๆ‰“ๅŒ…ๅฅฝ็š„ๅฎ‰่ฃ…ๅŒ… jafka-1.x.x.tgzใ€‚ ๅฎ‰่ฃ…ๆญฅ้ชคๅ’ŒไธŠ้ขไธ‹่ฝฝๅ‘่กŒ็‰ˆๅฎ‰่ฃ…ๅŒ…็›ธๅŒใ€‚


Language: English | Simple Chinese

โš ๏ธ **GitHub.com Fallback** โš ๏ธ