我是这方面的新手。我使用mesosinaction.com的指令配置了6台ubuntu机器(3台主机和3台机器)。
当我访问一台主机时,它表示只注册了一个从机,并且指的是本地机器从机的主机(即使这应该被禁用)。如果我尝试连接到错误的机器,我会被重定向到主机。但是,当我开始我的奴隶他们立即停止,不要注册到主人,并给出错误。有人可以指点我正确的方向吗?
安装
在主节点上使用
安装Mesoselement1.getSubElements()
在从节点上,它是使用
安装的apt-get install mesos zookeeperd
我运行了以下脚本。
禁用母版上的奴隶
sudo apt-get install mesos
配置Zookeeper
使用
运行脚本echo "manual" | sudo tee /etc/init/mesos-slave
编辑zoo.cfg以包含
export MESOS_zk=zk://10.18.89.11:2181,10.18.89.12:2181,10.18.89.13:2181/mesos
export MESOS_quorum=2
export MESOS_work_dir=/var/lib/mesos
export MESOS_log_dir=/var/log/mesos
接着是
server.1=10.18.89.11:2888:3888
server.2=10.18.89.12:2888:3888
server.3=10.18.89.13:2888:3888
在Slave Nodes上我禁用了mesos master
#> service mesos-master restart
运行以下脚本
#> echo "manual" | sudo tee /etc/init/mesos-master
接着是
export MESOS_master=zk://10.18.89.11:2181,10.18.89.12:2181,10.18.89.13:2181/mesos
export MESOS_work_dir=/var/lib/mesos
export MESOS_log_dir=/var/log/mesos
日志 在/ var / log / mesos中,我在从机上获得以下文件。
#> service mesos-slave restart
mesos-slave.INFO包含以下内容。
mesos-slave.10-18-89-16.invalid-user.log.INFO.20160122-132419.7783
mesos-slave.10-18-89-16.invalid-user.log.INFO.20160122-132419.7805
mesos-slave.10-18-89-16.invalid-user.log.INFO.20160122-132419.7827
mesos-slave.10-18-89-16.invalid-user.log.INFO.20160122-132419.7849
mesos-slave.10-18-89-16.invalid-user.log.INFO.20160122-132419.7871
mesos-slave.10-18-89-16.invalid-user.log.INFO.20160122-132419.7893
mesos-slave.10-18-89-16.invalid-user.log.INFO.20160122-132419.7915
mesos-slave.10-18-89-16.invalid-user.log.INFO.20160122-132419.7937
mesos-slave.10-18-89-16.invalid-user.log.INFO.20160122-132419.7959
mesos-slave.10-18-89-16.invalid-user.log.INFO.20160122-132419.7981
mesos-slave.10-18-89-16.invalid-user.log.INFO.20160122-132419.8003
mesos-slave.INFO
My Mesos Master日志包含以下文件。
Log file created at: 2016/01/22 13:24:19
Running on machine: 10-18-89-16
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0122 13:24:19.600344 8003 logging.cpp:172] INFO level logging started!
I0122 13:24:19.600586 8003 main.cpp:185] Build: 2015-10-12 20:57:28 by root
I0122 13:24:19.600600 8003 main.cpp:187] Version: 0.25.0
I0122 13:24:19.600607 8003 main.cpp:190] Git tag: 0.25.0
I0122 13:24:19.600613 8003 main.cpp:194] Git SHA: 2dd7f7ee115fe00b8e098b0a10762a4fa8f4600f
I0122 13:24:19.600814 8003 containerizer.cpp:143] Using isolation: posix/cpu,posix/mem,filesystem/posix
I0122 13:24:19.605336 8003 linux_launcher.cpp:103] Using /sys/fs/cgroup/freezer as the freezer hierarchy for the Linux launcher
I0122 13:24:19.613593 8003 main.cpp:272] Starting Mesos slave
I0122 13:24:19.614564 8019 slave.cpp:190] Slave started on 1)@10.18.89.16:5051
I0122 13:24:19.614586 8019 slave.cpp:191] Flags at startup: --appc_store_dir="/tmp/mesos/store/appc" --authenticatee="crammd5" --cgroups_cpu_enable_pids_and_tids_count="false" --cgroups_enable_cfs="false" --cgroups_hierarchy="/sys/fs/cgroup" --cgroups_limit_swap="false" --cgroups_root="mesos" --container_disk_watch_interval="15secs" --containerizers="mesos" --default_role="*" --disk_watch_interval="1mins" --docker="docker" --docker_kill_orphans="true" --docker_remove_delay="6hrs" --docker_socket="/var/run/docker.sock" --docker_stop_timeout="0ns" --enforce_container_disk_quota="false" --executor_registration_timeout="1mins" --executor_shutdown_grace_period="5secs" --fetcher_cache_dir="/tmp/mesos/fetch" --fetcher_cache_size="2GB" --frameworks_home="" --gc_delay="1weeks" --gc_disk_headroom="0.1" --hadoop_home="" --help="false" --hostname_lookup="true" --image_provisioner_backend="copy" --initialize_driver_logging="true" --isolation="posix/cpu,posix/mem" --launcher_dir="/usr/libexec/mesos" --log_dir="/var/log/mesos" --logbufsecs="0" --logging_level="INFO" --master="zk://localhost:2181/mesos" --oversubscribed_resources_interval="15secs" --perf_duration="10secs" --perf_interval="1mins" --port="5051" --qos_correction_interval_min="0ns" --quiet="false" --recover="reconnect" --recovery_timeout="15mins" --registration_backoff_factor="1secs" --resource_monitoring_interval="1secs" --revocable_cpu_low_priority="true" --sandbox_directory="/mnt/mesos/sandbox" --strict="true" --switch_user="true" --systemd_runtime_directory="/run/systemd/system" --version="false" --work_dir="/tmp/mesos"
I0122 13:24:19.614917 8019 slave.cpp:354] Slave resources: cpus(*):2; mem(*):2929; disk(*):3867; ports(*):[31000-32000]
I0122 13:24:19.615025 8019 slave.cpp:390] Slave hostname: mesosslave3
I0122 13:24:19.615037 8019 slave.cpp:395] Slave checkpoint: true
I0122 13:24:19.617189 8019 state.cpp:54] Recovering state from '/tmp/mesos/meta'
I0122 13:24:19.617219 8019 state.cpp:690] No checkpointed resources found at '/tmp/mesos/meta/resources/resources.info'
包含以下内容的.INFO。
mesos-master.10-18-89-11.invalid-user.log.INFO.20160122-132301.23030
mesos-master.10-18-89-11.invalid-user.log.WARNING.20160122-132301.23030
mesos-master.INFO
mesos-master.WARNING
和.WARNING包含
Running on machine: 10-18-89-11
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0122 13:23:01.562093 23030 logging.cpp:172] INFO level logging started!
I0122 13:23:01.562300 23030 main.cpp:229] Build: 2015-10-12 20:57:28 by root
I0122 13:23:01.562312 23030 main.cpp:231] Version: 0.25.0
I0122 13:23:01.562319 23030 main.cpp:234] Git tag: 0.25.0
I0122 13:23:01.562325 23030 main.cpp:238] Git SHA: 2dd7f7ee115fe00b8e098b0a10762a4fa8f4600f
I0122 13:23:01.562367 23030 main.cpp:252] Using 'HierarchicalDRF' allocator
I0122 13:23:01.570297 23030 leveldb.cpp:176] Opened db in 7.861315ms
I0122 13:23:01.577780 23030 leveldb.cpp:183] Compacted db in 7.452531ms
I0122 13:23:01.577816 23030 leveldb.cpp:198] Created db iterator in 7011ns
I0122 13:23:01.577832 23030 leveldb.cpp:204] Seeked to beginning of db in 5688ns
I0122 13:23:01.577883 23030 leveldb.cpp:273] Iterated through 3 keys in the db in 42391ns
I0122 13:23:01.577913 23030 replica.cpp:744] Replica recovered with log positions 61 -> 62 with 0 holes and 0 unlearned
I0122 13:23:01.579000 23030 main.cpp:465] Starting Mesos master
I0122 13:23:01.579012 23049 log.cpp:238] Attempting to join replica to ZooKeeper group
I0122 13:23:01.579221 23047 recover.cpp:449] Starting replica recovery
I0122 13:23:01.579627 23045 recover.cpp:475] Replica is in VOTING status
I0122 13:23:01.579675 23045 recover.cpp:464] Recover process terminated
I0122 13:23:01.584900 23048 group.cpp:331] Group process (group(2)@10.18.89.11:5050) connected to ZooKeeper
I0122 13:23:01.584924 23048 group.cpp:805] Syncing group operations: queue size (joins, cancels, datas) = (1, 0, 0)
I0122 13:23:01.584934 23048 group.cpp:403] Trying to create path '/mesos/log_replicas' in ZooKeeper
I0122 13:23:01.585255 23030 master.cpp:376] Master 831f97c5-0580-4cad-8113-06af4d461665 (mesosmaster1) started on 10.18.89.11:5050
I0122 13:23:01.585325 23030 master.cpp:378] Flags at startup: --allocation_interval="1secs" --allocator="HierarchicalDRF" --authenticate="false" --authenticate_slaves="false" --authenticators="crammd5" --authorizers="local" --framework_sorter="drf" --help="false" --hostname_lookup="true" --initialize_driver_logging="true" --log_auto_initialize="true" --log_dir="/var/log/mesos" --logbufsecs="0" --logging_level="INFO" --max_slave_ping_timeouts="5" --port="5050" --quiet="false" --quorum="1" --recovery_slave_removal_limit="100%" --registry="replicated_log" --registry_fetch_timeout="1mins" --registry_store_timeout="5secs" --registry_strict="false" --root_submissions="true" --slave_ping_timeout="15secs" --slave_reregister_timeout="10mins" --user_sorter="drf" --version="false" --webui_dir="/usr/share/mesos/webui" --work_dir="/var/lib/mesos" --zk="zk://localhost:2181/mesos" --zk_session_timeout="10secs"
I0122 13:23:01.585500 23030 master.cpp:425] Master allowing unauthenticated frameworks to register
I0122 13:23:01.585553 23030 master.cpp:430] Master allowing unauthenticated slaves to register
I0122 13:23:01.585608 23030 master.cpp:467] Using default 'crammd5' authenticator
W0122 13:23:01.585664 23030 authenticator.cpp:505] No credentials provided, authentication requests will be refused
I0122 13:23:01.585820 23030 authenticator.cpp:512] Initializing server SASL
I0122 13:23:01.586278 23045 group.cpp:331] Group process (group(1)@10.18.89.11:5050) connected to ZooKeeper
I0122 13:23:01.586302 23045 group.cpp:805] Syncing group operations: queue size (joins, cancels, datas) = (0, 0, 0)
I0122 13:23:01.586313 23045 group.cpp:403] Trying to create path '/mesos/log_replicas' in ZooKeeper
I0122 13:23:01.587795 23050 group.cpp:331] Group process (group(3)@10.18.89.11:5050) connected to ZooKeeper
I0122 13:23:01.589221 23050 group.cpp:805] Syncing group operations: queue size (joins, cancels, datas) = (0, 0, 0)
I0122 13:23:01.589253 23050 group.cpp:403] Trying to create path '/mesos' in ZooKeeper
I0122 13:23:01.593644 23043 group.cpp:331] Group process (group(4)@10.18.89.11:5050) connected to ZooKeeper
I0122 13:23:01.593667 23043 group.cpp:805] Syncing group operations: queue size (joins, cancels, datas) = (0, 0, 0)
I0122 13:23:01.593852 23043 group.cpp:403] Trying to create path '/mesos' in ZooKeeper
I0122 13:23:01.601426 23045 network.hpp:415] ZooKeeper group memberships changed
I0122 13:23:01.601543 23045 group.cpp:674] Trying to get '/mesos/log_replicas/0000000040' in ZooKeeper
I0122 13:23:01.601898 23045 network.hpp:463] ZooKeeper group PIDs: { log-replica(1)@10.18.89.11:5050 }
I0122 13:23:01.602589 23046 master.cpp:1542] Successfully attached file '/var/log/mesos/mesos-master.INFO'
I0122 13:23:01.602622 23046 contender.cpp:149] Joining the ZK group
I0122 13:23:01.604877 23043 contender.cpp:265] New candidate (id='39') has entered the contest for leadership
I0122 13:23:01.605916 23047 detector.cpp:156] Detected a new leader: (id='39')
答案 0 :(得分:0)
感谢您的发布,以及阅读Mesos in Action!我看到你执行的步骤存在一些小问题,希望这会指出你正确的方向。
要在Ubuntu 14.04.x中禁用服务,您应该运行
echo "manual" | sudo tee /etc/init/mesos-slave.override
其次是
sudo service mesos-slave stop
缺少.override
是我的疏忽,在技术校对期间得到了纠正。您应该在下一个(也是最后一个)MEAP版本以及本书的最终版本中看到它。
看起来您正在尝试使用环境变量配置Mesos主服务器和从服务器,但使用的是Mesosphere包。虽然这通常可以与Upstart一起使用,但我建议使用基于文件的方法。
对于Mesos母版,请尝试以下配置:
echo -n "zk://10.18.89.11:2181,10.18.89.12:2181,10.18.89.13:2181/mesos" > /etc/mesos/zk
echo -n "2" > /etc/mesos-master/quorum
echo -n "/var/lib/mesos" > /etc/mesos-master/work_dir
echo -n "/var/log/mesos" > /etc/mesos-master/log_dir
对于Mesos slave,请尝试以下配置:
echo -n "zk://10.18.89.11:2181,10.18.89.12:2181,10.18.89.13:2181/mesos" > /etc/mesos/zk
echo -n "/var/lib/mesos" > /etc/mesos-slave/work_dir
echo -n "/var/log/mesos" > /etc/mesos-slave/log_dir
然后重新启动每项服务。
这应该让Mesos主服务器和从服务器正确配置并与ZooKeeper通信,我认为它已经正确配置并为客户端提供服务。
答案 1 :(得分:0)
在奴隶日志中,我看到奴隶试图连接的主人是本地主机。
--master =" ZK://本地主机:2181 / mesos"
您应该按照open.mesosphere.com的说明进行从站设置,以设置mesos从站以连接到右侧主站。正如@Roger所指出的,你需要在/ etc / mesos / zk中设置zookeeper信息来告诉奴隶关于主人的信息。