Clone the Master code from cruise control UI and UI does not pop up
Gk8143197049 opened this issue · 22 comments
I'm having the same issue. CC 2.0.25 is up and working on port 0.0.0.0:9099. I can reach the API from other hosts, e.g. http://kafka-host.fqdn:9099/kafkacruisecontrol/state, but browsing to http://kafka-host.fqdn:9099/ does not work. I'm not using CORS, the UI files are in the correct location (according to the docs) with correct permissions. My config.csv contiains dev,dev,/kafkacruisecontrol
, but I have also tried dev,dev,http://kafka-host.fqdn:9099/kafkacruisecontrol/
, restarting CC between changes.
cc built-in jetty is not serving the CCFE's index file.
Were there any changes made to the config/cruisecontrol.properties
?
# REST API default prefix
# (dont forget the ending *)
webserver.api.urlprefix=/kafkacruisecontrol/*
# Location where the Cruise Control frontend is deployed
webserver.ui.diskpath=./cruise-control-ui/dist/
# URL path prefix for UI
# (dont forget the ending *)
webserver.ui.urlprefix=/*
are the default values for CC's built-in jetty to find out where the webapp is deployed.
These webserver properties are unchanged from defaults in my cc properties file.
Tried to reproduce the 404 problem and i couldn't, here is the complete screengrab of whats tried (similar to above wiki)
- Get and build CC-2.0.25
localhost:/tmp user$ wget https://github.com/linkedin/cruise-control/archive/2.0.25.tar.gz
localhost:/tmp user$ tar zxf cruise-control-2.0.25.tar.gz
localhost:/tmp user$ cd cruise-control-2.0.25
localhost:cruise-control-2.0.25 user$ git init
Initialized empty Git repository in /tmp/cruise-control-2.0.25/.git/
localhost:cruise-control-2.0.25 user$ ./gradlew jar
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/4.8/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
> Task :cruise-control-core:compileJava
Note: /tmp/cruise-control-2.0.25/cruise-control-core/src/main/java/com/linkedin/cruisecontrol/common/config/ConfigDef.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :cruise-control-metrics-reporter:compileJava
Note: /tmp/cruise-control-2.0.25/cruise-control-metrics-reporter/src/main/java/com/linkedin/kafka/cruisecontrol/metricsreporter/metric/MetricsUtils.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
> Task :cruise-control:compileScala
Pruning sources from previous analysis, due to incompatible CompileSetup.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 50s
8 actionable tasks: 8 executed
- Get and build CCFE in same folder
localhost:cruise-control-2.0.25 user$ git clone https://github.com/linkedin/cruise-control-ui
Cloning into 'cruise-control-ui'...
remote: Enumerating objects: 37, done.
remote: Counting objects: 100% (37/37), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 128 (delta 16), reused 14 (delta 6), pack-reused 91
Receiving objects: 100% (128/128), 1.98 MiB | 4.07 MiB/s, done.
Resolving deltas: 100% (32/32), done.
localhost:cruise-control-2.0.25 user$ cd cruise-control-ui/
localhost:cruise-control-ui user$ npm install
> fsevents@1.2.7 install /tmp/cruise-control-2.0.25/cruise-control-ui/node_modules/fsevents
> node install
node-pre-gyp WARN Using needle for node-pre-gyp https download
[fsevents] Success: "/tmp/cruise-control-2.0.25/cruise-control-ui/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node" is installed via remote
added 1204 packages from 658 contributors and audited 8411 packages in 25.676s
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
localhost:cruise-control-ui user$ npm run build
> cruise-control-ui@0.1.0 build /tmp/cruise-control-2.0.25/cruise-control-ui
> test -d cruise-control-ui && cd cruise-control-ui; node build/build.js
⠙ building for production...
Starting to optimize CSS...
Processing static/css/app.css...
Processed static/css/app.css, before: 167785, after: 148702, ratio: 88.63%
Hash: 6692b57525d72d32b3bb
Version: webpack 2.7.0
Time: 15197ms
Asset Size Chunks Chunk Names
static/js/app.js 143 kB 0 [emitted] app
static/js/vendor.js 357 kB 1 [emitted] [big] vendor
static/js/manifest.js 1.39 kB 2 [emitted] manifest
static/css/app.css 149 kB 0 [emitted] app
static/css/app.css.map 275 kB 0 [emitted] app
index.html 453 bytes [emitted]
static/config.csv 29 bytes [emitted]
static/cc-logo.png 15.3 kB [emitted]
Build complete.
Tip: built files are meant to be served over an HTTP server.
Opening index.html over file:// won't work.
localhost:cruise-control-ui user$ pwd
/tmp/cruise-control-2.0.25/cruise-control-ui
localhost:cruise-control-ui user$ cd ../cruise-control
localhost:cruise-control user$ pwd
/tmp/cruise-control-2.0.25/cruise-control
localhost:cruise-control user$ cd ..
- Update config & start CC
localhost:cruise-control-2.0.25 user$ vim config/cruisecontrol.properties # update zookeeper, kafka settings
localhost:cruise-control-2.0.25 user$ ./kafka-cruise-control-start.sh ./config/cruisecontrol.properties # start cc
...
[2019-03-14 16:46:22,599] INFO Started @16569ms (org.eclipse.jetty.server.Server)
>> ********************************************* <<
>> Application directory : /tmp/cruise-control-2.0.25
>> REST API available on : /kafkacruisecontrol/*
>> Web UI available on : /*
>> Web UI Directory : ./cruise-control-ui/dist/
>> Cookie prefix path : /
>> Kafka Cruise Control started on : http://0.0.0.0:9090
>> CORS Enabled ? : false
>> ********************************************* <<
...
localhost:~ user$ curl -s http://localhost:9090/index.html | md5
f541fd173d48c5eb54535cf0873f8df0
localhost:~ user$ curl -s http://localhost:9090/static/config.csv
dev,dev,/kafkacruisecontrol/
localhost:~ user$
- Verify
localhost:~ user$ curl -s http://localhost:9090/index.html | md5
f541fd173d48c5eb54535cf0873f8df0
localhost:~ user$ curl -s http://localhost:9090/static/config.csv
dev,dev,/kafkacruisecontrol/
localhost:~ user$
Are the npm steps required? The docs don’t mention them.
it can be either pre-built code thats available in the releases section or npm built files. Both should have same files & structure (i.e ./cruise-control-ui/dist/*
). CC is pre-configured to serve the files under this directory structure when users hit /
of CC.
You mention a releases section, but I don’t see one. Am I missing it?
I am getting this error( Insufficient number of racks where can it be fixed) :
com.linkedin.kafka.cruisecontrol.exception.OptimizationFailureException: [RackAwareGoal] Insufficient number of racks to distribute each replica (Current: 1, Needed: 2).
at com.linkedin.kafka.cruisecontrol.analyzer.goals.RackAwareGoal.initGoalState(RackAwareGoal.java:186)
at com.linkedin.kafka.cruisecontrol.analyzer.goals.AbstractGoal.optimize(AbstractGoal.java:87)
at com.linkedin.kafka.cruisecontrol.analyzer.GoalOptimizer.optimizations(GoalOptimizer.java:414)
at com.linkedin.kafka.cruisecontrol.analyzer.GoalOptimizer.optimizations(GoalOptimizer.java:350)
at com.linkedin.kafka.cruisecontrol.analyzer.GoalOptimizer$ProposalCandidateComputer.run(GoalOptimizer.java:669)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
I also have kafka clusters which don’t span racks (due to installation limitations). You should remove the RackAwareGoal from your cruise-control config. If the number of racks isn’t >= your highest topic replication, then CC will be unable to meet that goal.
Below are the logs and screenshot when I hit the http://localhost:9090. How do I fix this issue ( I am not using the npm way but directly clonning)
log4j:WARN No appenders could be found for logger (org.apache.kafka.clients.Metadata).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
********************************************* <<
Application directory : xxxxxxxxx/cruise-control
REST API available on : /kafkacruisecontrol
Web UI available on : /*
Web UI Directory : xxxxxxxxxxxx/cruise-control/cruise-control-ui-master/static
Cookie prefix path : /
Kafka Cruise Control started on : http://0.0.0.0:9090
CORS Enabled ? : false
********************************************* <<
My verification does not work:
curl -s http://localhost:9090/index.html | md5
-bash: md5: command not found
(23) Failed writing body
[kafka@kafka01 logs]$ curl -s http://localhost:9090/index.html
HTTP ERROR 404
Problem accessing /index.html. Reason:
Not Found
Powered by Jetty:// 9.4.6.v20170531
[user@kafka logs]$ curl -s http://localhost:9090/static/config.csv <title>Error 404 Not Found</title>
HTTP ERROR 404
Problem accessing /static/config.csv. Reason:
Not Found
Powered by Jetty:// 9.4.6.v20170531
@pmbuko it worked to remove the racks error. now we need to figure out how to fix the UI issue
Thanks
@nareshv Will you be able to fix the issue. I was not able to get the UI up and running.
I mean help on this UI issue
@pmbuko does this UI work for you..
Please let me know.
Thanks
It's not a high priority for me at the moment so I've put off further attempts.
@Gk8143197049 the web-ui directory should be xxxxxxxxxxxx/cruise-control/cruise-control-ui-master
so that the app can get loaded via index.html thats in the directory.
It is in /opt/kafka/xxxxxx/cruise-control/cruise-control-ui-master/static.
Did you want me to restart the linkedin CC once again
If you are using this webserver.ui.diskpath=/opt/kafka/xx/cruise-control/cruise-control-ui-master/static/
then you should see the following files in the directory.
├── index.html
└── static
├── cc-logo.png
├── config.csv
├── css
│ ├── app.css
│ └── app.css.map
└── js
├── app.js
└── manifest.js
3 directories, 7 files
Also, i am just guessing that you have just cloned the repo and updated the webserver.ui.diskpath
right ? You need to run the following commands after git clone : cd /opt/kafka/xx/cruise-control/cruise-control-ui-master && npm install && npm run build
. Later update the webserver.ui.diskpath=/opt/kafka/xx/cruise-control/cruise-control-ui-master/dist
which should show the CCFE correctly.
closing this due to inactivity. please file a new one in case the problem persists.
Just following up on this issue since I finally resolved it. I had to use the full path to the dist directory as the value for webserver.ui.diskpath
instead of the relative path.