GoogleCloudPlatform / PerfKitBenchmarker

PerfKit Benchmarker (PKB) contains a set of benchmarks to measure and compare cloud offerings. The benchmarks use default settings to reflect what most users will see. PerfKit Benchmarker is licensed under the Apache 2 license terms. Please make sure to read, understand and agree to the terms of the LICENSE and CONTRIBUTING files before proceeding.
https://googlecloudplatform.github.io/PerfKitBenchmarker/
Apache License 2.0
1.91k stars 510 forks source link

MongoDB_ycsb not recognizing os_type=Centos7 #1831

Open adnavare opened 5 years ago

adnavare commented 5 years ago

I am using trying to run YCSB with MongoDB on Centos 7.5 and I am seeing it is failing to recognize the attributes. Below is the error

Exception running benchmark Traceback (most recent call last): File "/home/anupn/PerfKitBenchmarker/perfkitbenchmarker/pkb.py", line 860, in RunBenchmarkTask RunBenchmark(spec, collector) File "/home/anupn/PerfKitBenchmarker/perfkitbenchmarker/pkb.py", line 711, in RunBenchmark DoProvisionPhase(spec, detailed_timer) File "/home/anupn/PerfKitBenchmarker/perfkitbenchmarker/pkb.py", line 515, in DoProvisionPhase spec.ConstructVirtualMachines() File "/home/anupn/PerfKitBenchmarker/perfkitbenchmarker/benchmark_spec.py", line 370, in ConstructVirtualMachines vms = self.ConstructVirtualMachineGroup(group_name, group_spec) File "/home/anupn/PerfKitBenchmarker/perfkitbenchmarker/benchmark_spec.py", line 289, in ConstructVirtualMachineGroup static_vm_class = static_vm.GetStaticVmClass(vm_spec.os_type) File "/home/anupn/PerfKitBenchmarker/perfkitbenchmarker/static_virtual_machine.py", line 294, in GetStaticVmClass OS_TYPE=os_type) File "/home/anupn/PerfKitBenchmarker/perfkitbenchmarker/resource.py", line 47, in GetResourceClass (base_class.name, kwargs)) Exception: No BaseVirtualMachine subclass defined with the attributes: {'OS_TYPE': 'centos7', 'CLOUD': 'Static'} 2018-12-17 14:29:08,828 99e69746 MainThread mongodb_ycsb(1/1) ERROR Benchmark 1/1 mongodb_ycsb (UID: mongodb_ycsb0) failed. Execution will continue.

I am attaching my config file baremetal-static.txt

Do I have to use os_type=rhel even for Centos7?

adnavare commented 5 years ago

Okay I added the class Centos7BasedStaticVirtualMachine here https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/static_virtual_machine.py#L307 and passing the linux_virtual_machine.Centos7Mixin as the second parameter.

adnavare commented 5 years ago

Passed the issue of wrong attributes, but pkb is unable to restart Mongod service and it fails. Below is the error

pam_unix(runuser:session): session opened for user mongod by (uid=0) Dec 17 16:51:42 localhost.localdomain runuser[32840]: pam_unix(runuser:session): session closed for user mongod Dec 17 16:51:42 localhost.localdomain mongod[32827]: Starting mongod: [FAILED] Dec 17 16:51:42 localhost.localdomain systemd[1]: mongod.service: control process exited, code=exited status=1 Dec 17 16:51:42 localhost.localdomain systemd[1]: Failed to start SYSV: Mongo is a scalable, document-oriented database.. -- Subject: Unit mongod.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- Unit mongod.service has failed.

-- The result is failed. Dec 17 16:51:42 localhost.localdomain systemd[1]: Unit mongod.service entered failed state. Dec 17 16:51:42 localhost.localdomain systemd[1]: mongod.service failed. Dec 17 16:51:42 localhost.localdomain polkitd[18967]: Unregistered Authentication Agent for unix-process:32821:1749848 (system bus name Dec 17 16:51:42 localhost.localdomain sudo[32806]: pam_unix(sudo:session): session closed for user root

I checked /var/lib/mongodb /var/log/mongod has mongod as the owner

cwilkes commented 5 years ago

Can you post the contents of the file(s) in /var/log/mongod? If you pass in "--run_stage=provision,prepare,run" PKB won't tear down the instance after it fails so you can get the log files.

After you get them you can tear down that instance by running PKB with these flags: --run_uri=8charFromLastRun --benchmarks=mongodb --run_stage=teardown which you should probably do immediately after getting the logs or else you'll forget to do it and then see it show up on your bill ;)

adnavare commented 5 years ago

@cwilkes : Thanks for the input, here are the logs from /var/log/mongodb/mongod.log mongodlog.log

I did run "--run_uri= --benchmarks=mongodb --run_stage=teardown" almost immediately :)

From the log, it looks like it is unable to write to a file? Do you see any other error?

cwilkes commented 5 years ago

@adnavare Can you post the log file or at least the part of the log that has the problem? That would help us debug it.

adnavare commented 5 years ago

@cwilkes : Sure, mongodb log from /var/log/ is above, if you are unable to view it properly I can attach again. Here is the pkb.log, as i ran "run_uri" later to teardown the instance, if you start looking at the logs from bottom you have to scroll up a little. Here is the log pkb_latest.log

Let me know if any more logs or other information is needed. Thanks

cwilkes commented 5 years ago

@adnavare sorry I didn't see the attached log. Do you know what user mongodb is being started up as? It is probably an account like "mongodb", but I can see referencing a data directory /home/anup/data/mongodb-data so maybe it is running under the "anup" account? Granted it could still be mongodb.

Can you do the following?

ls -ltrd /var/run/mongodb/ /var/run/mongodb/mongod.pid

the directory should exist and be owned (and +x) as the user that runs mongodb. If it isn't there or is owned by a different user you can do do

MONGOUSER=useryouwant
sudo mkdir /var/run/mongodb/
sudo chown -R $MONGOUSER /var/run/mongodb
sudo chmod +rx /var/run/mongodb/
adnavare commented 5 years ago

@cwilkes : ls -ltrd /var/run/mongodb/ /var/run/mongodb/mongod.pid ls: cannot access /var/run/mongodb/mongod.pid: No such file or directory drwxr-xr-x. 2 mongod mongod 40 Dec 18 22:32 /var/run/mongodb/

ls -ltrd /home/anup/data/ drwxrwxr-x. 3 anup anup 26 Dec 18 22:32 /home/anup/data/ [anup@localhost mongodb]$ ls -ltrd /home/anup/data/mongodb-data/ drwxrwxrwx. 2 anup anup 6 Dec 18 22:32 /home/anup/data/mongodb-data/

I don't see mongod.pid running. Is there any other location, I should check for .pid? I am copying the mongodb log again may be there was some problem earlier. mongodlog.log mongolog.txt

Thanks

adnavare commented 5 years ago

If you want I can share my screen, and we can debug this together if convenient for you.

adnavare commented 5 years ago

@cwilkes Attaching the pkb log as well, in case you were unable to view the log because of it's .log extention pkb_latest.txt

adnavare commented 5 years ago

@cwilkes : So I kept the dbpath as default i.e. /var/lib/mongo and then, the service restarts regularly. The only thing is i need to add was 'sudo' while running mkdir and chmod for 'mongodb-data'. I think there is some permissions issue that is causing the change in dbpath not work with the mongodb service. It would be good to identify what goes wrong when dbpath is changed. For now I was able to surpass that with keeping the dbpath as default.

adnavare commented 5 years ago

Any idea if dbpath change is mongodb, centos or PKB issue?

cwilkes commented 5 years ago

This sounds like an issue with your already running VM not having permissions setup correctly for mongodb to run. While PKB could do the chowns necessary to read from the dbpath it is probably best left up to the individual user to do that outside of PKB -- we don't really want to modify a user's system to work with us only to have it break for them when not running PKB.

What I would do is in your script that sets up your Centos 7.5 VM have it do the necessary chmod/chowns to get it into a state that PKB could run on it.

adnavare commented 5 years ago

@cwilkes : I had actually chown the directory on the name of the user, but that didn't help. Have you tried running on Centos with dbpath changed than the default?